A Complete Step-by-Step Guide on Euler’s Method

A Complete Step-by-Step Guide on Euler’s Method

Euler’s method approximates the solution of a differential equation dy/dx = f(x, y) one small step at a time. Starting from a known point (x₀, y₀), each new value is yₙ₊₁ = yₙ + h·f(xₙ, yₙ), where h is the step size, and xₙ₊₁ = xₙ + h. Smaller steps give a more accurate answer but take more work.

Euler’s method is the simplest way to approximate the solution of a differential equation when you cannot (or do not want to) solve it exactly. You start at a known point, follow the tangent line for a short step, and repeat. This page gives the formula, the steps, three fully worked examples with tables, how accurate the method is and when it over- or underestimates.

The Euler’s method formula

For a first-order differential equation dy/dx = f(x, y) with initial condition y(x0) = y0 and step size h:

xn+1 = xn + h   and   yn+1 = yn + h · f(xn, yn)

  • f(xn, yn) is the slope of the solution at the current point (the derivative).
  • h · f(xn, yn) is the rise along the tangent line over a run of h.
  • yn+1 is the new estimate, where the tangent line reaches xn+1.

Geometrically, each step replaces the curve with its tangent line for a distance h. That is the same idea as a linear approximation, used over and over.

How to use Euler’s method: 5 steps

  1. Write down f(x, y), the right side of dy/dx = f(x, y).
  2. Start at the initial point (x0, y0).
  3. Choose the step size h, or compute it as (target x − x0) ÷ number of steps.
  4. Repeat: find the slope f(xn, yn), then yn+1 = yn + h × slope and xn+1 = xn + h.
  5. Stop at the target x. The last y is your approximation. A table keeps the work organized.

Example 1: dy/dx = x + y, y(0) = 1, estimate y(1) with h = 0.25

We need (1 − 0) ÷ 0.25 = 4 steps.

nxnynslope = xn + ynyn+1 = yn + 0.25 × slope
00111.25
10.251.251.51.625
20.51.6252.1252.15625
30.752.156252.906252.8828

Euler estimate: y(1) ≈ 2.883. The exact solution is y = 2ex − x − 1, so y(1) = 2e − 2 ≈ 3.437. The estimate is too low because this solution curve is concave up, so every tangent line lies below it.

Example 2: dy/dx = y − x, y(0) = 1, estimate y(1) with h = 0.1

f(x, y) = y − x. The first two steps:

  • y1 = 1 + 0.1(1 − 0) = 1.1 at x = 0.1
  • y2 = 1.1 + 0.1(1.1 − 0.1) = 1.2 at x = 0.2

Every step adds exactly 0.1, so after 10 steps y(1) ≈ 2.0. Here Euler’s method is exact: the true solution is the straight line y = x + 1, and a tangent line to a straight line is the line itself. Euler’s method only has error when the solution curves.

Example 3 (AP Calculus BC style): dy/dx = 2x, y(1) = 3, two steps of size 0.5 to estimate y(2)

  • Step 1: slope at (1, 3) is 2(1) = 2, so y(1.5) ≈ 3 + 0.5 × 2 = 4.
  • Step 2: slope at (1.5, 4) is 2(1.5) = 3, so y(2) ≈ 4 + 0.5 × 3 = 5.5.

The exact solution is y = x2 + 2, so y(2) = 6. The estimate 5.5 is an underestimate, because y” = 2 > 0 (concave up).

How accurate is Euler’s method?

Smaller steps give better answers. For Example 1 (true value 3.437):

Step size hStepsEuler estimate of y(1)Error
0.522.5000.937
0.2542.8830.554
0.1103.1880.249
0.05203.3070.130

Halving h roughly halves the error. That is why Euler’s method is called a first-order method: the global error is proportional to h.

Overestimate or underestimate?

  • Concave up solution (y” > 0): tangent lines lie below the curve, so Euler underestimates.
  • Concave down solution (y” < 0): tangent lines lie above the curve, so Euler overestimates.

To decide, differentiate dy/dx again. In Example 3, y” = 2, which is positive, so the estimate is low.

Euler’s method vs. better methods

Heun’s method (improved Euler) averages the slope at the start and the predicted end of each step, and its error shrinks like h2. Fourth-order Runge-Kutta (RK4) combines four slopes per step and its error shrinks like h4, so it is the standard choice in software. Euler’s method is still worth learning: it is how slope fields turn into solution curves, and every better method is built on the same idea.

Common mistakes

  • Using the slope at the new point instead of the current point. Euler uses f(xn, yn).
  • Forgetting to update x as well as y.
  • Miscounting the steps: steps = (target x − x0) ÷ h.
  • Rounding too early. Keep at least four decimals until the last step.

Practice problems

  1. dy/dx = y, y(0) = 1. Use two steps of h = 0.5 to estimate y(1).
  2. dy/dx = x − y, y(0) = 2. Use one step of h = 0.2 to estimate y(0.2).
  3. dy/dx = 3x2, y(0) = 1. Use two steps of h = 0.5 to estimate y(1). Is it an over- or underestimate?

Answers

  1. y(0.5) ≈ 1 + 0.5(1) = 1.5; y(1) ≈ 1.5 + 0.5(1.5) = 2.25. (True value e ≈ 2.718.)
  2. y(0.2) ≈ 2 + 0.2(0 − 2) = 1.6.
  3. y(0.5) ≈ 1 + 0.5(0) = 1; y(1) ≈ 1 + 0.5(3 × 0.25) = 1.375. The true value is 2 (y = x3 + 1), so it is an underestimate; y” = 6x ≥ 0.

Frequently Asked Questions

What is the formula for Euler’s method?

yn+1 = yn + h · f(xn, yn) and xn+1 = xn + h, where dy/dx = f(x, y) is the differential equation, (x0, y0) is the starting point and h is the step size.

Is Euler’s method an overestimate or an underestimate?

It depends on the concavity of the solution. If the solution curve is concave up (y” > 0), each tangent-line step stays below the curve and Euler’s method underestimates. If it is concave down (y” < 0), it overestimates.

How do you make Euler’s method more accurate?

Use a smaller step size. The error at a fixed x is roughly proportional to h, so halving h roughly halves the error. For much better accuracy with the same h, use an improved method such as Heun’s method or fourth-order Runge-Kutta.

Is Euler’s method on the AP Calculus exam?

Euler’s method is part of AP Calculus BC, usually as a short question asking for one or two steps from a given point, sometimes with a question about whether the estimate is too high or too low. It is not part of AP Calculus AB.

Related to This Article

What people say about "Euler's Method: Formula, Steps and Worked Example"?

No one replied yet.

Leave a Reply