Most differential equations can’t be solved with a neat formula. Euler’s method (say “OY-ler”) gets a numerical answer anyway: start at a known point, follow the tangent line a short distance, recompute the slope from the differential equation, and repeat. It is linearization used over and over, and it’s the numerical cousin of following a slope field. On the AP BC exam it usually appears as a short no-calculator part of a differential equations question.
Suppose dxdy=f(x,y) and you know the point (x0,y0) is on the solution. The slope there is f(x0,y0). Move right by a step sizeΔx along the tangent line:
Each step follows a tangent line, which drifts away from the true curve. Smaller steps stay closer to the curve and usually give better estimates, at the cost of more arithmetic.
The answer depends on the concavity of the solution:
If the solution is concave up (dx2d2y>0), tangent lines lie below the curve, so Euler’s method gives an underestimate.
If the solution is concave down (dx2d2y<0), tangent lines lie above the curve, so Euler’s method gives an overestimate.
You can find dx2d2y without solving the equation: differentiate dxdyimplicitly, then substitute the differential equation in for every dxdy. On the AP exam, justify with a sentence like ”dx2d2y>0 on this interval, so the solution curve is concave up and lies above its tangent lines; the Euler approximation is an underestimate.”
For the same equation, (a) approximate f(1) with four steps, (b) decide whether these approximations are under- or overestimates. (c) The exact solution is f(x)=2ex−x−1. Compare.
Solution.
(a) Now Δx=0.25:
x
y
dxdy=x+y
Δy=dxdy(0.25)
0
1
1
0.25
0.25
1.25
1.5
0.375
0.5
1.625
2.125
0.53125
0.75
2.15625
2.90625
0.7265625
1
2.8828125
So f(1)≈2.883.
(b) Differentiate the differential equation:
dx2d2y=1+dxdy=1+x+y
Starting from (0,1), x and y both stay positive (the slope x+y is positive, so y keeps increasing). So dx2d2y=1+x+y>0 for 0≤x≤1: the solution is concave up, its tangent lines lie below it, and both Euler approximations are underestimates.
(c) Exactly, f(1)=2e−2≈3.437. The two-step estimate is off by about 0.937; the four-step estimate is off by about 0.554. Halving the step size roughly halved the error.
Euler’s method for dxdy=x+y, y(0)=1: the polygons stay below the concave-up solution, and the smaller step gets closer.
A cold drink at 4∘C is set out in a 22∘C room. Its temperature T (in ∘C) after t minutes satisfies dtdT=−0.5(T−22). (a) Use Euler’s method with Δt=1 to estimate T(2). (b) Is your estimate too high or too low?
Solution.
(a)
t
T
dtdT=−0.5(T−22)
ΔT=dtdT(1)
0
4
9
9
1
13
4.5
4.5
2
17.5
So T(2)≈17.5∘C.
(b) Differentiate:
dt2d2T=−0.5dtdT=−0.5(−0.5(T−22))=0.25(T−22)
The drink stays colder than the room (T<22), so dt2d2T<0. The solution is concave down, the tangent lines lie above it, and 17.5 is an overestimate.
(The exact solution is T=22−18e−0.5t, so T(2)≈15.378∘C, which confirms it.)
Using the same slope for every step. The whole point is to recompute dxdy at each new point, using the new xand the new y.
Forgetting to multiply by the step size. The change is Δy=dxdy⋅Δx, not just dxdy. With Δx=0.5, a slope of 2 only raises y by 1.
Counting steps wrong. From x=0 to x=1 with Δx=0.25 is four steps, and the slope at the last point (x=1) is never used.
Mixing up concave up and under/over. Concave up means the curve bends above its tangent lines, so the tangent-line steps fall short: an underestimate. Picture y=x2 and its tangent lines if you’re unsure.
Forgetting to substitute when finding the second derivative.dxd(x+y)=1+dxdy, and then you must replace dxdy with x+y. An answer that still contains dxdy can’t be evaluated at a point.
1. (Warm-up) Let y=f(x) satisfy dxdy=2x with f(0)=1. Use Euler’s method with Δx=0.5 to approximate f(1).
Solution
x
y
dxdy=2x
Δy
0
1
0
0
0.5
1
1
0.5
1
1.5
f(1)≈1.5. (The exact solution y=x2+1 gives 2; since y′′=2>0, the estimate is low, as expected.)
2. (Warm-up) Given dxdy=y2−x and y(1)=2, use one step of Euler’s method with Δx=0.1 to approximate y(1.1).
Solution
The slope at (1,2) is 22−1=3, so
y(1.1)≈2+3(0.1)=2.3
3. (Warm-up) Given dxdy=x−y and y(0)=2, use Euler’s method with two equal steps to approximate y(1).
Solution
Δx=0.5.
x
y
dxdy=x−y
Δy
0
2
−2
−1
0.5
1
−0.5
−0.25
1
0.75
y(1)≈0.75.
4. (Core) Let y=f(x) be the solution of dxdy=xy with f(0)=1.
(a) Use Euler’s method with Δx=0.25 to approximate f(1). Give your answer to 3 decimal places.
(b) Find dx2d2y in terms of x and y, and decide whether your answer to (a) is an under- or overestimate.
Solution
(a)
x
y
dxdy=xy
Δy=dxdy(0.25)
0
1
0
0
0.25
1
0.25
0.0625
0.5
1.0625
0.53125
0.1328125
0.75
1.1953125
0.896484375
0.22412109375
1
1.41943359375
f(1)≈1.419.
(b) By the product rule, dx2d2y=y+xdxdy=y+x(xy)=y(1+x2).
The slope xy is never negative for x≥0 and y>0, so y never drops below 1. Then dx2d2y=y(1+x2)>0: the solution is concave up, so 1.419 is an underestimate. (The exact value is e1/2≈1.649.)
5. (Core) Given dxdy=y−x and y(0)=2:
(a) Use Euler’s method with Δx=0.2 to approximate y(0.4).
(b) Show that dx2d2y=y−x−1. Given that the solution satisfies y>x+1 for 0≤x≤0.4, is your estimate too high or too low?
Solution
(a)
x
y
dxdy=y−x
Δy
0
2
2
0.4
0.2
2.4
2.2
0.44
0.4
2.84
y(0.4)≈2.84.
(b) dx2d2y=dxdy−1=(y−x)−1. If y>x+1, then y−x−1>0, so the solution is concave up and 2.84 is too low. (The exact solution y=x+1+ex gives y(0.4)≈2.892.)
6. (Core) Water drains from a tank. The depth h in metres after t minutes satisfies dtdh=−0.2h, with h(0)=9.
(a) Use Euler’s method with Δt=1 to approximate h(2). Give your answer to 3 decimal places.
(b) Is the approximation an under- or overestimate? Justify.
Solution
(a) At t=0: slope =−0.29=−0.6, so h(1)≈9−0.6=8.4.
At t=1: slope =−0.28.4≈−0.5797, so h(2)≈8.4−0.5797≈7.820 m.
(b) By the chain rule,
dt2d2h=−0.2⋅2h1⋅dtdh=−h0.1(−0.2h)=0.02>0
The solution is concave up, so the estimate is an underestimate. (The exact solution is h=(3−0.1t)2, giving h(2)=7.84.)
7. (Core) A quantity satisfies dtdy=ky with y(0)=2. One step of Euler’s method with Δt=0.5 gives y(0.5)≈3. Find k.
Solution
The slope at (0,2) is 2k, so one step gives
2+2k(0.5)=3⇒2+k=3⇒k=1
8. (Challenge) Let y=f(x) satisfy dxdy=(y−1)x2 with f(0)=3.
(a) Use Euler’s method with two equal steps to approximate f(1).
(b) Find dx2d2y and explain why the approximation is an underestimate.
Solution
(a) Δx=0.5. At (0,3): slope =(2)(0)=0, so y(0.5)≈3. At (0.5,3): slope =(2)(0.25)=0.5, so f(1)≈3+0.5(0.5)=3.25.
Starting at y=3, the slope (y−1)x2 is never negative while y>1, so y stays at least 3. For 0<x≤1, both y−1>0 and x4+2x>0, so dx2d2y>0. The solution is concave up, so 3.25 is an underestimate. (The exact value is 1+2e1/3≈3.791.)
9. (Challenge) For dxdy=3−y with y(0)=1, show that Euler’s method with n equal steps from x=0 to x=1 gives y(1)≈3−2(1−n1)n. What happens as n→∞?
Solution
Let h=n1. One step gives yk+1=yk+(3−yk)h. Subtract both sides from 3:
3−yk+1=(3−yk)−(3−yk)h=(3−yk)(1−h)
So the gap 3−y is multiplied by (1−h) at each step. It starts at 3−1=2, so after n steps it is 2(1−h)n, and
y(1)≈3−2(1−n1)n
As n→∞, (1−n1)n→e−1, so the estimates approach 3−e2≈2.264. That is the exact value: the solution is y=3−2e−x. Smaller and smaller steps converge to the true answer.