Take y′ + 2y = 6 with y(0) = 0. Before solving anything, ask where the rate is zero: y′ = 6 − 2y, which is 0 at y = 3. If y ever sat at 3 it would stay there for ever. The question the rest of the lesson answers is what a solution does when it starts somewhere else.
Definition · Steady stateFor y′ + a·y = b with a ≠ 0, the steady state is the constant y* = b/a. It is the one constant solution, and it is attracting when a > 0, repelling when a < 0.
Theorem · The shifted exponentialThe solution of y′ + a·y = b with y(0) = y₀ is y = b/a + (y₀ − b/a)·e^(−a·t).
Let u = y − b/a. Then u′ = y′, and from the equation y′ = b − a·y = −a·(y − b/a) = −a·u.
So u′ = −a·u, which is the decay equation and has the solution u = u₀·e^(−a·t), a claim from Separable Equations, Growth and Decay that is not reproved here. The starting gap is u₀ = y₀ − b/a, and adding b/a back gives the formula.
□
y′ + 2y = 6, y(0) = 0
steady state: 6 − 2y = 0, so y* = 3
starting gap: 0 − 3 = −3
y = 3 − 3·e^(−2t)
The gap is never zero
The gap 3·e^(−2t) is positive for every t, because an exponential is never zero. So y comes closer to 3 and does not reach it at any finite time, however long you wait. A reader who sees the curve flatten in the drawing is looking at the gap getting smaller than a pixel, which is not the same as the gap being zero. The claim the lesson makes is about every finite t, and the formula proves it.
Nor is the steady state the starting value. The solution starts at y(0) = 0 and the steady state is 3; the starting value fixes the gap and the steady state fixes where the gap is measured from. Start at 5 instead and the gap is +2, giving y = 3 + 2·e^(−2t), which falls toward 3 from above and never crosses it, since the gap never changes sign.
When a is negative the steady state repels
Take y′ − y = 2, so a = −1, b = 2 and y* = −2. The solution from y(0) = 0 is y = −2 + 2·e^t: the gap is multiplied by e^t, so it grows. The lab prints the steady state as −2 (repelling). Starting exactly at −2 stays there; starting anywhere else, however close, leaves.
Euler's steps, exactly, beside the closed form
Run Euler on y′ + 2y = 6 from y(0) = 0 with h = 1/4. The factor 1 − a·h = 1 − 1/2 = 1/2 is an exact fraction, and so is every value: yₙ = 3 − 3·(1/2)ⁿ. The closed form at the same times is irrational, so the lab prints it rounded, to six figures, with ≈, in a separate column.
n tₙ yₙ (Euler, exact) y(tₙ) (rounded)
0 0 0 0
1 1/4 3/2 ≈ 1.18041
2 1/2 9/4 ≈ 1.89636
3 3/4 21/8 ≈ 2.33061
4 1 45/16 ≈ 2.59399
The fraction 45/16 is exactly 3 − 3/16, and it is 2.8125. The true value is 3 − 3·e^(−2) ≈ 2.59399, so Euler's polygon ends about 0.218506 above the curve. Every fraction in the column is right; none of them is the solution. Euler's gap shrinks by 1/2 per step, and the true gap shrinks by e^(−1/2) ≈ 0.606531 per step, which is why the polygon runs ahead.
Example · The same equation from above, and the repelling oneFrom y(0) = 5 the gap is +2 and Euler gives yₙ = 3 + 2·(1/2)ⁿ, so y₄ = 3 + 2/16 = 25/8: above the steady state at every step, as the true curve is.
For y′ − y = 2 from y(0) = 0 the factor is 1 − (−1)·(1/4) = 5/4, so y₄ = −2 + 2·(5/4)⁴ = 369/128. The gap is multiplied by a number bigger than one, and the polygon leaves the steady state exactly as the curve does.
One warning for later. The factor 1 − a·h is positive and below one for a small step, but it goes negative when h > 1/a, and its size passes one when h > 2/a. At h = 1/2 exactly, here, the factor is 0: the polygon lands on 3 after one step and stays there, which the curve never does. A polygon that follows the curve for h = 1/4 can run away for a larger step on the same equation. “Stiffness: When the Step Is Too Big” takes that up.