Skip to content
The book

Numerical ODE: Euler, Runge–Kutta

Why this is asked: Know the local vs global order (Euler: local O(h²), global O(h)), the RK2 order conditions, and the stability interval for Euler applied to y′ = λy.

In one sentence

Euler is first order, Runge–Kutta 4 is fourth, and being higher order says nothing about being stable — an explicit method with too large a step produces growth where the true solution decays.

Why the exam asks it

Because order and stability are independent properties that both sound like "accuracy", and because the stability condition for Euler is a one-line computation that gives a definite number.

The idea

For y′=f(x,y)y' = f(x,y), y(x0)=y0y(x_0)=y_0, step hh:

Euler: yn+1=yn+hf(xn,yn)y_{n+1} = y_n + h f(x_n,y_n).

Local truncation error is the error of one step from exact data: O(h2)O(h^2) for Euler. Global error accumulates over O(1/h)O(1/h) steps, giving O(h)O(h) — so Euler is first order, and halving hh halves the error.

The general relation is that a method with local error O(hp+1)O(h^{p+1}) has global order pp. Options quote one for the other.

The standard methods

method stages order
Euler 1 1
Heun / improved Euler 2 2
midpoint 2 2
classical Runge–Kutta 4 4

RK4 is

yn+1=yn+h6(k1+2k2+2k3+k4)y_{n+1} = y_n + \frac{h}{6}(k_1+2k_2+2k_3+k_4)

with k1=f(xn,yn)k_1 = f(x_n,y_n), k2=f(xn+h2,yn+h2k1)k_2 = f(x_n+\frac h2, y_n+\frac h2k_1), k3=f(xn+h2,yn+h2k2)k_3 = f(x_n+\frac h2, y_n+\frac h2k_2), k4=f(xn+h,yn+hk3)k_4 = f(x_n+h, y_n+hk_3).

Four function evaluations per step for fourth-order accuracy — the reason it is the default.

Stability

Apply a method to y′=λyy' = \lambda y with Re⁡λ<0\operatorname{Re}\lambda<0, whose true solution decays. Euler gives

yn+1=(1+hλ)yn,y_{n+1} = (1+h\lambda)y_n,

so the numerical solution decays only when ∣1+hλ∣<1|1+h\lambda|<1. For real λ<0\lambda<0 that means

h<2∣λ∣.h < \frac{2}{|\lambda|}.

Exceed it and the computed solution grows while the true one decays — not inaccuracy but qualitative nonsense. With λ=−1\lambda=-1 the boundary is h=2h=2; at h=3h=3 the factor is −2-2 and the values oscillate with growing magnitude.

Every explicit method has a bounded stability region, RK4 included. Being fourth order does not help: a step outside the region diverges however accurate the method is on paper.

Backward Euler yn+1=yn+hf(xn+1,yn+1)y_{n+1}=y_n+hf(x_{n+1},y_{n+1}) gives factor 11−hλ\frac{1}{1-h\lambda}, which has modulus below 11 for every h>0h>0 when Re⁡λ<0\operatorname{Re}\lambda<0. It is A-stable, unconditionally stable, at the price of solving an equation at each step.

Stiff problems have widely separated timescales — a large ∣λ∣|\lambda| forcing a tiny hh for stability even after the fast component has died. That is exactly when implicit methods are worth their cost, and recognising stiffness is usually what the question is really about.

Convergence

Lax: consistency ++ stability == convergence. A consistent method that is unstable does not converge however small hh becomes, and this is the theorem behind the whole subject.

In practice, shrinking hh helps only until rounding error dominates: total error behaves like Chp+ε/hCh^p + \varepsilon/h, so there is an optimal hh below which accuracy gets worse.

Where intuition breaks

"Higher order means more stable." Independent. RK4 has a bounded stability region like every explicit method; with too large a step it diverges.

"Local error O(h2)O(h^2) makes Euler second order." Global order is one less. O(hp+1)O(h^{p+1}) locally is order pp globally.

"Smaller hh is always better." Until rounding dominates. The error curve turns back up, and the optimum is where ChpCh^p meets ε/h\varepsilon/h.

"Implicit methods are more accurate." More stable. Backward Euler is A-stable and still only first order.

"A stable method gives an accurate answer." Stability stops it exploding; accuracy is the order. A stable first-order method can be very wrong and still bounded.

"RK4 uses four steps." Four evaluations within one step. The step count is unchanged.

"Stiffness means the problem is hard." It means the timescales are separated, so an explicit method needs a step set by the fastest component even long after it has decayed.

The exam's angle

  1. Read order from the global error. Halving hh and dividing the error by 2p2^p identifies pp directly, which is how these questions are usually posed.
  2. For stability, apply the method to y′=λyy'=\lambda y and require the amplification factor to have modulus below 11. For Euler that is h<2/∣λ∣h<2/|\lambda|.
  3. Count function evaluations, not steps, when comparing cost.
  4. If the question mentions widely different rates, it is about stiffness and the answer is an implicit method.
  5. Distinguish stability from accuracy — options routinely offer one as evidence of the other.

The night before

  • Local error O(hp+1)O(h^{p+1}) ⇒\Rightarrow global order pp. Euler: local O(h2)O(h^2), global O(h)O(h).
  • Heun and midpoint order 22; RK4 order 44 with four evaluations per step.
  • Euler stability: ∣1+hλ∣<1|1+h\lambda|<1, so h<2/∣λ∣h<2/|\lambda| for real λ<0\lambda<0. Beyond it the numerical solution grows while the true one decays.
  • Every explicit method has a bounded stability region — order does not rescue it.
  • Backward Euler is A-stable, factor 1/(1−hλ)1/(1-h\lambda), and still first order.
  • Stiff: separated timescales; use implicit methods.
  • Lax: consistency ++ stability == convergence.
  • Total error ≈Chp+ε/h\approx Ch^p + \varepsilon/h: there is an optimal hh.

See it move

Order of a method, and the step size stability forces on youinteractive

This visual is part of Trap Analysis

Why explicit Euler needs h < 2/|λ| however accurate you wanted to be.

Unlock interactive visuals

Check yourself

Using Euler's method with step size 0.05, the approximate value of the solution of dy/dx =3x+2y+1,y(1)=1= \sqrt{3x + 2y + 1}, y(1) = 1, at x = 1.1 (rounded to two decimal places) is

More in Numerical Analysis

Take it further

Last revised . Found a mistake? Tell us — corrections are the fastest thing we act on.

Next: Euler–Lagrange equation and standard functionals

Create a free account to keep your place and have this feed your study plan.

ShareWhatsAppTelegram

Open this in the full syllabus view · Unit 3