Calculus · Grade 12 and undergraduate

Euler's Method

Quick answer

Euler's method approximates the solution of dy/dx = f(x, y) through a point without solving the equation. From the current point, follow the tangent line for a step h: the new point is x + h and y + h·f(x, y). Repeating the step traces a broken line that follows the slope field. Smaller steps give better approximations, with the error shrinking roughly in proportion to h. When the solution curve is concave up the method underestimates, and when it is concave down it overestimates.

What you'll learn

  • Carry out Euler's method for a given step size
  • Explain Euler's method as repeated linear approximation
  • Decide from concavity whether an estimate is too high or too low
  • Describe how the error changes with the step size

Following the slope field

A slope field shows the direction a solution travels at every point, but most differential equations have no formula for their solutions. Euler’s method walks along the field instead. From the starting point, move a short distance in the direction the slope gives, look up the slope at the new point, and move again.

Definition

To approximate the solution of dydx=f(x,y)\tfrac{dy}{dx} = f(x, y) through (x0,y0)(x_0, y_0) with step size hh, repeat

xn+1=xn+hyn+1=yn+h⋅f(xn,yn)x_{n+1} = x_n + h \qquad\qquad y_{n+1} = y_n + h \cdot f(x_n, y_n)
Euler's method for dy/dx = y with step 0.5 The slope field of dy/dx = y with the exact solution y = eˣ through (0, 1). Euler's method, starting at (0, 1), takes four straight steps of width 0.5, drawn as a broken line with dots at each step. It stays below the curve and ends at (2, 5.06), while the exact value at x = 2 is e² ≈ 7.39. 122468xy (2, 5.06) (2, e²)
  • exact solution y = eˣ
Euler's method for dy/dx = y with step 0.5

Why each step is a tangent line

A single step is the linear approximation from the lesson on derivatives: y(x+h)≈y(x)+h y′(x)y(x + h) \approx y(x) + h\,y'(x). The differential equation supplies the derivative, y′=f(x,y)y' = f(x, y), so no formula for yy is needed. Euler’s method is linear approximation, repeated, with the slope field supplying each slope.

Each step errs a little, because the solution curves away from its tangent line, and the errors add up. Halving hh makes each step’s error about four times smaller but doubles the number of steps, so the total error at a fixed point is roughly halved.

Over or under?

The concavity of the solution decides the direction of the error. Where the solution is concave up, its tangent lines lie below it, so each step lands low and the estimate is too small, as in the graph. Where it is concave down, the estimate is too large. Find the concavity by differentiating the equation itself: for dydx=y\tfrac{dy}{dx} = y, d2ydx2=dydx=y>0\tfrac{d^2y}{dx^2} = \tfrac{dy}{dx} = y > 0.

Worked examples

Common mistakes

Practice problems

  1. Use two steps of size 0.10.1 to estimate y(0.2)y(0.2) for dydx=y\tfrac{dy}{dx} = y, y(0)=2y(0) = 2.

    Answer

    2.422.42

    Full solution

    y(0.1)≈2+0.1(2)=2.2y(0.1) \approx 2 + 0.1(2) = 2.2, then y(0.2)≈2.2+0.1(2.2)=2.42y(0.2) \approx 2.2 + 0.1(2.2) = 2.42.

  2. Use two steps of size 0.50.5 to estimate y(1)y(1) for dydx=x\tfrac{dy}{dx} = x, y(0)=0y(0) = 0. Compare with the exact solution.

    Answer

    0.250.25; the exact value is 0.50.5

    Full solution

    The slope at (0,0)(0, 0) is 00, so y(0.5)≈0y(0.5) \approx 0. The slope at (0.5,0)(0.5, 0) is 0.50.5, so y(1)≈0.25y(1) \approx 0.25. The exact solution is y=x22y = \tfrac{x^2}{2}, with y(1)=0.5y(1) = 0.5.

  3. Use two steps of size 0.50.5 to estimate y(1)y(1) for dydx=x−y\tfrac{dy}{dx} = x - y, y(0)=1y(0) = 1.

    Answer

    0.50.5

    Full solution

    The slope at (0,1)(0, 1) is −1-1: y(0.5)≈0.5y(0.5) \approx 0.5. The slope at (0.5,0.5)(0.5, 0.5) is 00: y(1)≈0.5y(1) \approx 0.5.

  4. Use two steps of size 0.50.5 to estimate y(2)y(2) for dydx=1x\tfrac{dy}{dx} = \tfrac{1}{x}, y(1)=0y(1) = 0. Is the estimate too high or too low?

    Answer

    About 0.8330.833, too high

    Full solution

    y(1.5)≈0+0.5(1)=0.5y(1.5) \approx 0 + 0.5(1) = 0.5 and y(2)≈0.5+0.5⋅11.5≈0.833y(2) \approx 0.5 + 0.5 \cdot \tfrac{1}{1.5} \approx 0.833. The solution is ln⁡x\ln x, with ln⁡2≈0.693\ln 2 \approx 0.693. It is concave down, since y′′=−1x2<0y'' = -\tfrac{1}{x^2} < 0, so the estimate is too high.

  5. Use two steps of size 0.50.5 to estimate y(1)y(1) for dydx=2xy\tfrac{dy}{dx} = 2xy, y(0)=1y(0) = 1.

    Answer

    1.51.5

    Full solution

    The slope at (0,1)(0, 1) is 00: y(0.5)≈1y(0.5) \approx 1. The slope at (0.5,1)(0.5, 1) is 11: y(1)≈1.5y(1) \approx 1.5.

  6. For dydx=−y\tfrac{dy}{dx} = -y, y(0)=1y(0) = 1, use two steps of size 0.50.5 to estimate y(1)y(1), and decide from concavity whether the estimate is too high or too low.

    Answer

    0.250.25, too low

    Full solution

    y(0.5)≈1−0.5=0.5y(0.5) \approx 1 - 0.5 = 0.5 and y(1)≈0.5−0.25=0.25y(1) \approx 0.5 - 0.25 = 0.25. Differentiating the equation, y′′=−y′=y>0y'' = -y' = y > 0, so the solution is concave up and the estimate is low. Indeed e−1≈0.368e^{-1} \approx 0.368.

  7. Use one step of size −0.5-0.5 to estimate y(0.5)y(0.5) for dydx=x+y\tfrac{dy}{dx} = x + y, y(1)=2y(1) = 2.

    Answer

    0.50.5

    Full solution

    The slope at (1,2)(1, 2) is 33, so y(0.5)≈2+(−0.5)(3)=0.5y(0.5) \approx 2 + (-0.5)(3) = 0.5.

  8. A function has f(2)=5f(2) = 5 and f′(x)=x2−1f'(x) = x^2 - 1. Use two steps of size 0.50.5 to estimate f(3)f(3), and compare with the exact value.

    Answer

    9.1259.125; the exact value is 313≈10.33\tfrac{31}{3} \approx 10.33

    Full solution

    The slope at x=2x = 2 is 33: f(2.5)≈6.5f(2.5) \approx 6.5. The slope at x=2.5x = 2.5 is 5.255.25: f(3)≈6.5+2.625=9.125f(3) \approx 6.5 + 2.625 = 9.125. Exactly, f(3)=5+∫23(x2−1) dx=5+163f(3) = 5 + \int_2^3 (x^2 - 1)\,dx = 5 + \tfrac{16}{3}.

  9. For dydx=y\tfrac{dy}{dx} = y, y(0)=1y(0) = 1, Euler’s method with step hh gives y(1)≈(1+h)1/hy(1) \approx (1 + h)^{1/h}. What happens as h→0h \to 0?

    Answer

    The estimates approach ee.

    Full solution

    Each of the 1h\tfrac{1}{h} steps multiplies yy by 1+h1 + h. The limit of (1+h)1/h(1 + h)^{1/h} as h→0h \to 0 is ee, the exact value of y(1)y(1).

  10. For dydx=y\tfrac{dy}{dx} = y, y(0)=1y(0) = 1, a student estimates y(0.1)y(0.1) with h=0.1h = 0.1 as 1+1=21 + 1 = 2. What went wrong?

    Hint

    How far does yy change over a run of 0.10.1 at slope 11?

    Answer

    The student added the slope instead of hh times the slope. The estimate is 1.11.1.

    Full solution

    y(0.1)≈y(0)+h⋅f(0,1)=1+0.1⋅1=1.1y(0.1) \approx y(0) + h \cdot f(0, 1) = 1 + 0.1 \cdot 1 = 1.1, close to e0.1≈1.105e^{0.1} \approx 1.105.

Frequently asked questions

What is the formula for Euler's method?

From (xₙ, yₙ), take x₍ₙ₊₁₎ = xₙ + h and y₍ₙ₊₁₎ = yₙ + h·f(xₙ, yₙ), where dy/dx = f(x, y) and h is the step size.

Why does Euler's method work?

Each step is a linear approximation: it follows the tangent line, whose slope the differential equation supplies, for a short distance.

How do I know if Euler's method overestimates or underestimates?

Check the concavity of the solution. Concave up means the tangent lines lie below the curve, so the estimate is too low; concave down means it is too high.

How does the step size affect the error?

Smaller steps give smaller errors. Halving h roughly halves the error at a fixed point, at the cost of twice as many steps.

Can Euler's method step backward?

Yes. Use a negative step h to estimate values to the left of the starting point.

What to learn next