Euler's method, explained with examples
Euler's method estimates the solution of a differential equation by taking many small straight-line steps along the slope. It is an AP Calculus BC topic and a common part of free-response questions on differential equations.
On this page
The idea
A differential equation such as dy/dx = x + y tells you the slope of the solution curve at every point, but not the curve itself. If you know one point on the curve, you can take a small step along the tangent line there, arrive at a new point, find the new slope, step again, and so on. The path of short straight segments approximates the true curve. This is Euler's method, named after the Swiss mathematician Leonhard Euler.
The formula
With step size h (also written Δx), each step uses:
xnew = xold + h
ynew = yold + h · (dy/dx at the old point)
This is just the tangent line approximation, repeated. The change in y over a small step is roughly slope times step size.
Organising the work in a table
A table keeps the steps tidy and is what AP readers expect to see. Use four columns: x, y, the slope dy/dx at that point, and the change Δy = slope × h. Each row's new y is the previous y plus the previous Δy.
Worked examples
Example 1: two steps
Given dy/dx = x + y and y(0) = 1, use Euler's method with step size 0.5 to estimate y(1).
- Step 1: at (0, 1), slope = 0 + 1 = 1. Δy = 0.5 × 1 = 0.5. New point (0.5, 1.5).
- Step 2: at (0.5, 1.5), slope = 0.5 + 1.5 = 2. Δy = 0.5 × 2 = 1. New point (1, 2.5).
- Estimate: y(1) ≈ 2.5. The exact solution is y = 2ex − x − 1, giving y(1) ≈ 3.44, so the estimate is too low.
Example 2: smaller steps
Repeat Example 1 with step size 0.25.
- (0, 1): slope 1, Δy = 0.25 → (0.25, 1.25).
- (0.25, 1.25): slope 1.5, Δy = 0.375 → (0.5, 1.625).
- (0.5, 1.625): slope 2.125, Δy = 0.53125 → (0.75, 2.15625).
- (0.75, 2.15625): slope 2.90625, Δy ≈ 0.72656 → (1, 2.88281).
- Estimate: y(1) ≈ 2.88, closer to the true 3.44. Halving the step size roughly halves the error.
Example 3: a decreasing solution
Given dy/dx = −2y and y(0) = 4, estimate y(0.2) using two steps of 0.1.
- (0, 4): slope −8, Δy = −0.8 → (0.1, 3.2).
- (0.1, 3.2): slope −6.4, Δy = −0.64 → (0.2, 2.56).
- y(0.2) ≈ 2.56. The exact value is 4e−0.4 ≈ 2.68.
Example 4: stepping backwards
Given dy/dx = 3x² and y(1) = 2, estimate y(0.8) with one step.
- The step goes left, so h = −0.2. Slope at (1, 2) is 3.
- y(0.8) ≈ 2 + (−0.2)(3) = 1.4. The exact value is 0.8³ + 1 = 1.512.
Example 5: a full AP-style question
The function f satisfies dy/dx = 2x − y with f(0) = 3. (a) Use Euler's method with two steps of 0.5 to approximate f(1). (b) Is this an overestimate or underestimate? Justify.
- (a) (0, 3): slope −3, Δy = −1.5 → (0.5, 1.5). (0.5, 1.5): slope −0.5, Δy = −0.25 → (1, 1.25). So f(1) ≈ 1.25.
- (b) d²y/dx² = 2 − dy/dx = 2 − (2x − y) = 2 − 2x + y. At the start this is 2 − 0 + 3 = 5 > 0, and it stays positive along the path, so the curve is concave up.
- Tangent lines lie below a concave-up curve, so the approximation is an underestimate. State the concavity, give the reason, and link it to the tangent lines for full credit. The exact value, f(1) ≈ 1.84, confirms the estimate is too low.
Is the estimate too high or too low?
AP questions often ask whether an Euler approximation is an overestimate or underestimate, with a justification. The answer depends on the concavity of the solution curve, found from the second derivative.
- If the solution is concave up (d²y/dx² > 0), tangent lines lie below the curve, so stepping forward gives an underestimate.
- If it is concave down (d²y/dx² < 0), tangent lines lie above the curve, so stepping forward gives an overestimate.
To find d²y/dx², differentiate dy/dx implicitly, remembering that y is a function of x. In Example 1, d²y/dx² = 1 + dy/dx = 1 + x + y, which is positive on the interval, so the curve is concave up and the estimate of 2.5 is too low, as we found.
Step size and accuracy
Each step follows the tangent rather than the curve, so a small error builds up every time. Smaller steps reduce the error but need more calculations. For Euler's method, the error is roughly proportional to the step size: halve h and the error roughly halves. More advanced methods, such as Runge–Kutta, are far more accurate and are what computers actually use, but they rest on the same idea.
Euler's method and slope fields
A slope field draws a short line segment with the correct slope at many points. Euler's method is like following the slope field from your starting point, step by step. If you sketch the steps on a slope field, you can see why the path drifts away from the true curve when the curve bends, and why the drift is worst where the curve is most sharply curved.
Common mistakes
- Using the slope at the new point instead of the old point.
- Forgetting that h is negative when stepping to the left.
- Adding the slope instead of slope × h.
- Justifying over- or underestimation using the first derivative instead of concavity.
- Rounding heavily between steps, which compounds the error.
Practice questions
Try each one before opening the answer.
Q1. dy/dx = 2x, y(0) = 1. Use one step of 0.5 to estimate y(0.5).
Show answer
Q2. dy/dx = y, y(0) = 1. Use two steps of 0.5 to estimate y(1).
Show answer
Q3. dy/dx = x − y, y(1) = 3. Use one step of 0.1 to estimate y(1.1).
Show answer
Q4. If d²y/dx² < 0, is a forward Euler estimate too high or too low?
Show answer
Frequently asked questions
Is Euler's method on AP Calculus AB?
No. Euler's method is a BC-only topic, in Unit 7 on differential equations.
Is Euler's method in A level Maths?
Not in A level Maths. Step-by-step numerical methods for differential equations appear in some Further Maths options.
Key takeaways
- Euler's method follows tangent lines in small steps.
- ynew = yold + h × (slope at the old point).
- Use a table: x, y, slope, Δy.
- Concave up gives an underestimate; concave down gives an overestimate.
- Smaller steps give better accuracy.