Calculus › Section G · Differential equations › Topic G.1

Slope fields and Euler's method

A differential equation describes how a quantity's rate of change depends on its current state. Even before you can solve one, slope fields and Euler stepping let you see and trace its solutions.

Equations whose answers are functions

Most equations you have solved answered with a number. A differential equation answers with a function: it relates an unknown function to its own derivatives, as in \(\frac{dy}{dt} = 0.03y\), and solving means finding a function that makes the identity true for every input. The order of the equation is the highest derivative appearing, so \(y'' + y = 0\) is second-order. Such equations describe anything whose future depends on its present: populations, bank balances, temperatures, falling objects. Writing the model means translating words into an equation: a population that "grows at a rate proportional to its size" satisfies \(\frac{dP}{dt} = kP\), and a drink that "cools at a rate proportional to its difference from room temperature" satisfies \(\frac{dT}{dt} = -k(T - T_{\text{room}})\), with \(k > 0\).

Checking is easier than solving

To test whether a proposed function actually solves a differential equation, substitute it in and see. Does \(y = Ce^{2t}\) satisfy \(y' = 2y\)? Differentiating: \(y' = 2Ce^{2t} = 2y\), identically, for every constant \(C\): an infinite family of solutions in one stroke. Does \(y = \sin t\) solve the second-order \(y'' + y = 0\)? With \(y'' = -\sin t\), the sum vanishes, yes. The verification habit matters all through Section G: checking a candidate is always mechanical, and it is how you both confirm your own work and catch your own errors.

Worked example: one constant, one condition

The family \(y = Ce^{3t}\) solves \(y' = 3y\), as substitution shows. But a physical problem never wants the whole family; it wants the member with a specific starting state. Impose \(y(0) = 4\): then \(Ce^{0} = C = 4\), and the solution is \(y = 4e^{3t}\). An equation plus an initial condition is an initial value problem, and this two-beat pattern, general family, then condition, is E.1's antiderivative bookkeeping promoted to a whole equation. For first-order equations one constant and one condition suffice; a second-order equation typically has two constants and needs two conditions.

What a slope field shows

Write the equation as \(y' = f(t, y)\) and read it aloud: at every point of the plane, the equation already knows what slope a solution passing through must have. So draw it: at each of many grid points \((t, y)\), sketch a short segment with slope \(f(t, y)\). The result is a slope field, a picture of every instruction the equation gives, and solution curves are exactly the curves that follow the segments the way iron filings trace a magnetic field. No solving required. Two quick things to read: segments are horizontal exactly where \(f(t, y) = 0\), and where \(|f(t, y)|\) is large the segments are steep, so solutions change quickly there.

Worked example: reading a field

Consider \(y' = y - t\). Compute instructions at a few points: at \((0, 0)\) the slope is \(0\); at \((1, 2)\) it is \(1\); at every point on the line \(y = t\) the slope is \(0\). Then test a candidate that the segments seem to favour: does the straight line \(y = t + 1\) solve it? Its slope is \(1\) everywhere, and the equation demands \(y - t = 1\) along it, which holds identically. So the line is a genuine solution, sitting inside the slope field like an unbent stream, while the solutions beside it flare away exponentially. A slope field makes such a solution visible before it is found.

Euler's method: walking the field

From a starting point \((t_0, y_0)\), the equation hands you the slope \(f(t_0, y_0)\). Step forward a small amount \(h\) along the tangent: \(y_1 = y_0 + h\, f(t_0, y_0)\). At the new point, read a new slope and step again:

y_{n+1} = y_n + h\, f(t_n, y_n)

This is Euler's method: chaining tangent-line steps through the slope field. It is the linear approximation of D.9 used one step at a time. Each step is a straight-line guess, so accuracy depends on the step size: for small \(h\), halving \(h\) roughly halves the error at a fixed endpoint.

Worked example: Euler in four steps

Approximate the solution of \(y' = y\), \(y(0) = 1\), at \(t = 1\) using \(h = 0.25\). Step one: \(y(0.25) \approx 1 + 0.25(1) = 1.25\). Step two: at slope \(1.25\), \(y(0.5) \approx 1.5625\). Step three: \(y(0.75) \approx 1.5625 + 0.25 \cdot 1.5625 = 1.9531\). Step four: \(y(1) \approx 2.4414\). The true value is \(e \approx 2.718\): four coarse tangent steps captured the shape but came out about 0.28 too low, roughly 10%. Because solutions of \(y' = y\) are concave up, every tangent step falls below the curve, so Euler's method underestimates here.

Equilibria and the phase line

For equations of the form \(y' = f(y)\), with no explicit \(t\), the key landmarks are the constant solutions: equilibria, found by solving \(f(y) = 0\). An equilibrium is stable when nearby solutions drift toward it and unstable when they flee. For \(y' = y(6 - y)\), the equilibria are \(0\) and \(6\), since either makes \(y'\) vanish. Between them \(y' > 0\), so solutions climb toward \(6\); above \(6\), \(y' < 0\), so solutions sink toward \(6\); below \(0\), \(y' < 0\), fleeing. The one-line sign chart of \(f(y)\), with arrows between equilibria, is called a phase line, and it predicts long-run behaviour without any formula for the solutions.

Where this all leads

Three methods now sit side by side for a first-order equation: exact symbolic solution where one exists (G.3 and G.5 supply two), slope fields for a global picture with no formula at all, and Euler stepping for numbers where the computer is strongest. In practice they support each other: a model such as the cooling equation can be solved exactly, sketched as a slope field to see its long-run behaviour, and checked with a few Euler steps. Many equations that arise in science have no formula solution at all, and then the field and the numerical method are all you have.

Common mistakes to avoid

The classics: treating a differential equation like an algebraic one and hunting a numerical answer, when the unknown is a function; forgetting the arbitrary constant, or applying the initial condition before the general form is found; swapping the coordinates when computing a segment, so the slope drawn at \((t, y)\) is really \(f(y, t)\); over-striding with Euler's method and trusting a coarse result without noting the error direction; and mixing up stable and unstable, an equilibrium is stable when nearby solutions move toward it, not merely when it exists. Finally, the phase line only applies to equations in \(y' = f(y)\) form, with no explicit \(t\).

Key takeaways

A differential equation relates a function to its derivatives; its order is the highest derivative; its solutions are functions, found in families and pinned by initial conditions. Check every candidate by substitution. The slope field of \(y' = f(t, y)\) draws the equation's instruction at each point, and solutions follow the segments. Euler's method, \(y_{n+1} = y_n + h f(t_n, y_n)\), walks those instructions numerically, with accuracy set by the step size. For \(y' = f(y)\), equilibria from \(f(y) = 0\) and one sign chart classify the long-run fate of every solution. Next: solving them on paper, starting with the ones that separate.

Flashcards

Flashcard

Differential equation

An equation in a function and its derivatives

Solutions are functions, not numbers.

Test your understanding

Question 1 of 5

What is the order of y‴ + 4y′ = y²?

Question 2 of 5

Which function solves y′ = y − t?

Question 3 of 5

Solve y′ = 3y with y(0) = 4.

Question 4 of 5

For y′ = y + 1 with y(0) = 0, what is Euler's estimate of y(0.5) using h = 0.5?

Question 5 of 5

For y′ = y(6 − y), which statement about the equilibria is true?

Standards: 7

← Previous topicNext topic →