← Back to Differential Equations

Euler's method and error

Most differential equations in science cannot be solved exactly. Numerical methods approximate solutions step by step, and understanding their errors is essential.

Why numerical methods?

Real models, from orbital mechanics to epidemics, rarely have formula solutions. Numerical methods compute approximate values at discrete times. Every weather forecast, spacecraft trajectory, and engineering simulation relies on them. The questions are: how accurate, how fast, and how stable?

Euler's method

For \(y' = f(t, y)\), \(y(t_0) = y_0\), step forward along the tangent: \(y_{n+1} = y_n + hf(t_n, y_n)\), \(t_{n+1} = t_n + h\). It is the simplest method and the basis for understanding all others.

y_{n+1} = y_n + h\,f(t_n, y_n)

Worked example

For \(y' = y\), \(y(0) = 1\), with \(h = 0.25\): \(y_1 = 1.25\), \(y_2 = 1.5625\), \(y_3 \approx 1.953\), \(y_4 \approx 2.441\). The true value \(e \approx 2.718\) is underestimated because the solution curves upward, away from each tangent line.

Local and global error

The local truncation error is the error made in one step, about \(\frac{h^2}{2}y''\) for Euler. Over \(\frac{T}{h}\) steps these accumulate into a global error proportional to \(h\). Euler's method is first order: halving \(h\) roughly halves the error, which is slow improvement.

Checking convergence

Run the method with step \(h\) and again with \(\frac{h}{2}\). If the answers agree to the digits you need, trust them. If they differ significantly, keep reducing \(h\). For a first-order method, the difference between runs estimates the error of the finer run.

Stability

For \(y' = -50y\), the true solution decays rapidly, but Euler's method with \(h = 0.1\) gives \(y_{n+1} = (1 - 5)y_n = -4y_n\), oscillating and exploding. Euler is stable here only if \(h < \frac{2}{50} = 0.04\). Stability limits can force tiny steps even when accuracy would allow larger ones.

|1 + h\lambda| < 1

Implicit Euler

Backward Euler uses the slope at the new point: \(y_{n+1} = y_n + hf(t_{n+1}, y_{n+1})\). Each step requires solving an equation, but the method is stable for decaying problems at any step size. This makes it valuable for stiff equations.

Rounding error

Computers store numbers with limited precision, about 16 digits in double precision. Very tiny steps mean very many steps, and rounding errors can accumulate. In practice, truncation error usually dominates, but extreme step sizes can make rounding matter.

Key takeaways

Euler's method steps along tangent lines and is first-order accurate. Global error scales with \(h\), so check results by halving the step. Explicit methods have stability limits; backward Euler is unconditionally stable for decaying problems. Rounding error limits how small steps can usefully be.

Flashcard

Euler's method

y_{n+1} = y_n + hf(t_n, y_n)

Steps along tangent lines.

Check your understanding

Euler's method on y' = y, y(0) = 1 with h = 0.5 gives y(1) approximately:

← Previous lesson Next lesson →