Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Big Idea

Forward Euler is the simplest time-stepping method: replace the derivative with a forward difference. It’s explicit: we compute un+1u_{n+1} directly from unu_n, making it cheap per step. But this simplicity comes at a cost: forward Euler is only conditionally stable, requiring step sizes small enough that 1+hλ1|1 + h\lambda| \leq 1. For stiff problems, this constraint becomes impractical.


The Initial Value Problem

We seek to approximate the solution of

dudt=f(t,u),u(t0)=u0\frac{du}{dt} = f(t, u), \quad u(t_0) = u_0

on a grid of times t0<t1<t2<<tN=Tt_0 < t_1 < t_2 < \cdots < t_N = T with step size h=tn+1tnh = t_{n+1} - t_n.

Let unu_n denote our approximation to u(tn)u(t_n).


Derivation

Replace du/dtdu/dt with a forward difference:

u(tn+1)u(tn)hf(tn,u(tn))\frac{u(t_{n+1}) - u(t_n)}{h} \approx f(t_n, u(t_n))

This gives the forward Euler (or explicit Euler) method:

Definition 1 (Forward Euler Method)

un+1=un+hf(tn,un)u_{n+1} = u_n + h f(t_n, u_n)

Starting from u0u_0, we can march forward in time: given unu_n, we compute un+1u_{n+1} directly.

Remark 1 (Derivation via Duhamel’s Principle)

An equivalent derivation starts from the integral form of the ODE. Integrate u=f(t,u)u' = f(t,u) over one step:

u(tn+1)=u(tn)+tntn+1f(s,u(s))dsu(t_{n+1}) = u(t_n) + \int_{t_n}^{t_{n+1}} f(s, u(s))\,ds

Approximate the integral by a left rectangle rule, freezing the integrand at s=tns = t_n:

tntn+1f(s,u(s))dshf(tn,u(tn))\int_{t_n}^{t_{n+1}} f(s, u(s))\,ds \approx h\,f(t_n, u(t_n))

This recovers forward Euler. Freezing at the right endpoint s=tn+1s = t_{n+1} instead gives backward Euler. Higher-order quadrature rules (midpoint, Simpson, etc.) lead to higher-order ODE methods.

Geometric Interpretation

Forward Euler follows the tangent line:

  1. At (tn,un)(t_n, u_n), the slope is f(tn,un)f(t_n, u_n)

  2. Follow this slope for time hh

  3. Arrive at un+1=un+hslopeu_{n+1} = u_n + h \cdot \text{slope}

Each step follows a tangent to a (possibly different) solution curve.

Top: Forward Euler solution of u' = 2u. Each step follows a tangent line to a different solution curve (colored), corresponding to the ODE solution with a different initial condition passing through (t_n, u_n). The numerical solution (black) underestimates the exact solution (blue) because the tangent line falls below the convex exponential. Bottom: Backward Euler for the same problem.

Top: Forward Euler solution of u=2uu' = 2u. Each step follows a tangent line to a different solution curve (colored), corresponding to the ODE solution with a different initial condition passing through (tn,un)(t_n, u_n). The numerical solution (black) underestimates the exact solution (blue) because the tangent line falls below the convex exponential. Bottom: Backward Euler for the same problem.

Implementation

See the Euler’s Method notebook for an interactive implementation with visualizations of convergence, stability, and stiffness.


Sensitivity of the Initial Value Problem

Before analyzing the algorithm’s accuracy, we should ask: how sensitive is the problem itself?

The colored curves in the figure above are exact solutions of the same ODE with different initial conditions. How quickly do nearby solutions diverge or converge?

Lipschitz Continuity

Definition 2 (Lipschitz Continuity)

A function ff is Lipschitz continuous on a domain DD if there exists a constant L0L \geq 0 such that

f(u)f(v)Luvfor all u,vD|f(u) - f(v)| \leq L|u - v| \quad \text{for all } u, v \in D

The smallest such LL is the Lipschitz constant.

Remark 2 (Connection to Existence and Uniqueness)

This is the same condition that the Picard-Lindelöf theorem requires to guarantee existence and uniqueness of ODE solutions. It is not a coincidence: the convergence proof essentially re-derives the Picard iteration in discrete form. The Lipschitz constant LL controls both how quickly nearby solution curves diverge and how quickly numerical errors can grow.

Example 1 (C1C^1 Functions are Lipschitz)

If f(u)f(u) is continuously differentiable on a bounded domain, then ff is Lipschitz with constant L=maxfL = \max |f'|. This follows from the mean value theorem:

f(u)f(v)=f(ξ)uvLuv|f(u) - f(v)| = |f'(\xi)| \, |u - v| \leq L|u - v|

for some ξ\xi between uu and vv.

For example, f(u)=λuf(u) = \lambda u has Lipschitz constant L=λL = |\lambda|.

Condition Number of the IVP

Suppose u(t)u(t) and v(t)v(t) both solve u=f(t,u)u' = f(t,u) but with different initial conditions u(0)=u0u(0) = u_0 and v(0)=v0v(0) = v_0. Their difference satisfies

ddt(uv)=f(t,u)f(t,v)\frac{d}{dt}(u - v) = f(t, u) - f(t, v)

If ff is Lipschitz continuous in uu with constant LL (Definition 2), then ddtuvLuv\frac{d}{dt}|u - v| \leq L\,|u - v|. By Grönwall’s inequality:

u(T)v(T)eLTu0v0|u(T) - v(T)| \leq e^{LT}\,|u_0 - v_0|

The factor eLTe^{LT} is the condition number of the IVP. It is a property of the problem, not the algorithm:

No numerical method can do better than the problem allows. We will see this same factor reappear in the convergence bound (Theorem 1).


Local Truncation Error

If we take a single step of forward Euler starting from the exact solution, how far off are we? The local truncation error measures this per-step accuracy: the error committed in one step, assuming we started with the exact answer.

Definition 3 (Local Truncation Error)

Substitute the exact solution\underline{\text{exact solution}} u(t)u(t) into the numerical scheme. The local truncation error τn\tau_n is the residual:

u(tn+1)u(tn)h=f(tn,u(tn))+τn\frac{u(t_{n+1}) - u(t_n)}{h} = f(t_n, u(t_n)) + \tau_n

Equivalently, rearranging: if we start at the exact value u(tn)u(t_n) and take one Euler step, the one-step error Ln=hτn\mathcal{L}_n = h\tau_n is:

u(tn+1)[u(tn)+hf(tn,u(tn))]one Euler stepone-step error Ln=hτn\underbrace{u(t_{n+1}) - \underbrace{\bigl[u(t_n) + h f(t_n, u(t_n))\bigr]}_{\text{one Euler step}}}_{\text{one-step error } \mathcal{L}_n} = h\tau_n

Warning: Notice that (10) divides by hh, so τn\tau_n is a rate (error per unit time), not the actual error committed in one step. The one-step error Ln=hτn\mathcal{L}_n = h\tau_n is the actual distance you miss by after one step. For forward Euler: τn=O(h)\tau_n = O(h) but Ln=O(h2)\mathcal{L}_n = O(h^2).

Proposition 1 (Local Truncation Error of Forward Euler)

For forward Euler applied to u=f(t,u)u' = f(t,u) with uC2u \in C^2, the local truncation error is

τn=h2u(tn)+O(h2)=O(h)\tau_n = \frac{h}{2}u''(t_n) + O(h^2) = O(h)

Proof 1

Taylor expand the exact solution about tnt_n:

u(tn+1)=u(tn)+hu(tn)+h22u(tn)+O(h3)u(t_{n+1}) = u(t_n) + h u'(t_n) + \frac{h^2}{2}u''(t_n) + O(h^3)

Since u(tn)=f(tn,u(tn))u'(t_n) = f(t_n, u(t_n)), substituting into (10) gives:

τn=u(tn+1)u(tn)hf(tn,u(tn))=h2u(tn)+O(h2)\tau_n = \frac{u(t_{n+1}) - u(t_n)}{h} - f(t_n, u(t_n)) = \frac{h}{2}u''(t_n) + O(h^2)

Consistency Order

Definition 4 (Consistency Order)

A single-step method has consistency order pp if for sufficiently smooth ff:

τnChpfor all h(0,h0] and all n\|\tau_n\| \leq Ch^{p} \quad \text{for all } h \in (0, h_0] \text{ and all } n

Forward Euler has consistency order p=1p = 1.

This is the same notion of “order of accuracy” we saw for finite differences: the forward difference f(x+h)f(x)h\frac{f(x+h) - f(x)}{h} approximates f(x)f'(x) with error O(h)O(h). Forward Euler is a forward difference applied to du/dtdu/dt, so it inherits that same first-order accuracy.


Global Error and Convergence

The local truncation error tells us how accurate a single step is. But we take many steps, so the real question is: do these per-step errors accumulate controllably, or do they blow up?

Definition 5 (Global Error)

The global error at step nn is

En=unu(tn)E_n = u_n - u(t_n)

the difference between the numerical solution and the exact solution.

The global error is the cumulative effect of all one-step errors. Two things determine its size:

  1. Error accumulation: Recall that the one-step error is Ln=hτn=O(hp+1)\mathcal{L}_n = h\tau_n = O(h^{p+1}). Over N=T/hN = T/h steps, these pile up: N×O(hp+1)=O(hp)N \times O(h^{p+1}) = O(h^p).

  2. Stability: Local errors don’t just add up; each one gets amplified by subsequent steps. If the amplification factor is bounded, errors accumulate gently (O(hp)O(h^p)). If it exceeds 1, errors grow exponentially and the method is useless.

Example 2 (Error Propagation for the Linear Test Problem)

Consider the linear test problem u=λu+g(t)u' = \lambda u + g(t). The exact solution satisfies:

u(tn+1)=(1+hλ)u(tn)+hg(tn)+hτnu(t_{n+1}) = (1 + h\lambda)u(t_n) + hg(t_n) + h\tau_n

The numerical solution satisfies:

un+1=(1+hλ)un+hg(tn)u_{n+1} = (1 + h\lambda)u_n + hg(t_n)

Subtracting the numerical solution from the exact solution gives the error recurrence:

En+1=(1+hλ)EnhτnE_{n+1} = (1 + h\lambda)E_n - h\tau_n

Unrolling this recurrence:

En=(1+hλ)nE0hj=0n1(1+hλ)n1jτjE_n = (1 + h\lambda)^n E_0 - h\sum_{j=0}^{n-1}(1 + h\lambda)^{n-1-j}\tau_j

This is the discrete Duhamel principle: the global error at step nn equals the initial error propagated forward, plus all local truncation errors propagated by the appropriate powers of the amplification factor R=1+hλR = 1 + h\lambda.

Both ingredients are visible here:

  • Accumulation: Each τj\tau_j contributes to EnE_n. The sum has nn terms.

  • Stability: Each τj\tau_j is amplified by Rn1jR^{n-1-j}. If R1|R| \leq 1, these powers are bounded and errors stay controlled. If R>1|R| > 1, the earliest errors get amplified the most and the sum explodes.

Convergence Theorem

Theorem 1 (Convergence of Forward Euler)

Consider forward Euler (Definition 1) applied to u=f(t,u)u' = f(t,u), where ff is Lipschitz continuous in uu with constant LL (Definition 2). If the one-step error satisfies

LnCh2for all h(0,h0] and all n|\mathcal{L}_n| \leq Ch^{2} \quad \text{for all } h \in (0, h_0] \text{ and all } n

then the global discretization error satisfies:

EnC(eL(tnt0)1)Lh=O(h)|E_n| \leq \frac{C\bigl(e^{L(t_n - t_0)} - 1\bigr)}{L}\,h = O(h)

Proof 2

Step 1: Error recurrence. The numerical method gives un+1=un+hf(tn,un)u_{n+1} = u_n + hf(t_n, u_n). The exact solution satisfies u(tn+1)=u(tn)+hf(tn,u(tn))+Lnu(t_{n+1}) = u(t_n) + hf(t_n, u(t_n)) + \mathcal{L}_n, where Ln\mathcal{L}_n is the one-step error.

Subtracting:

En+1=En+h[f(tn,u(tn))f(tn,un)]+LnE_{n+1} = E_n + h\bigl[f(t_n, u(t_n)) - f(t_n, u_n)\bigr] + \mathcal{L}_n

Step 2: Lipschitz bound. Since ff is Lipschitz with constant LL:

En+1(1+hL)En+Ln|E_{n+1}| \leq (1 + hL)|E_n| + |\mathcal{L}_n|

Step 3: Unroll the recurrence. Let Lmax=maxjLj\mathcal{L}_{\max} = \max_j |\mathcal{L}_j|. Then:

En(1+hL)nE0+Lmaxj=0n1(1+hL)j|E_n| \leq (1 + hL)^n|E_0| + \mathcal{L}_{\max}\sum_{j=0}^{n-1}(1 + hL)^j

Step 4: Bound the geometric sum. The inequality (1+hL)kekhL(1 + hL)^k \leq e^{khL} follows from 1+xex1 + x \leq e^x (valid for all xRx \in \mathbb{R}). The sum is a finite geometric series with ratio r=1+hLr = 1 + hL: j=0n1rj=rn1r1=(1+hL)n1hL\sum_{j=0}^{n-1} r^j = \frac{r^n - 1}{r - 1} = \frac{(1+hL)^n - 1}{hL}. Applying both estimates:

EnenhLE0+enhL1hLLmax|E_n| \leq e^{nhL}|E_0| + \frac{e^{nhL} - 1}{hL}\,\mathcal{L}_{\max}

Step 5: Substitute nh=tnt0nh = t_n - t_0 and LmaxCh2\mathcal{L}_{\max} \leq Ch^2. With E0=0E_0 = 0 (exact initial condition):

EneL(tnt0)1hLCh2=C(eL(tnt0)1)Lh=O(h)|E_n| \leq \frac{e^{L(t_n - t_0)} - 1}{hL} \cdot Ch^2 = \frac{C\bigl(e^{L(t_n - t_0)} - 1\bigr)}{L}\,h = O(h)

Corollary 1 (Consistency of Order pp Implies Convergence of Order pp)

The proof above extends to any one-step method. If the one-step error satisfies LnChp+1|\mathcal{L}_n| \leq Ch^{p+1}, the same argument gives

EnC(eLT1)Lhp=O(hp)|E_n| \leq \frac{C\bigl(e^{LT} - 1\bigr)}{L}\,h^p = O(h^p)

A consistent method of order pp is therefore convergent of order pp.

Remark 3 (Backward Error, Forward Error, and the Condition Number)

The convergence theorem is an instance of a pattern that runs through all of numerical analysis:

Global errorwhat we care about    eLTproblem sensitivity  ×  O(h)per-step accuracy\underbrace{\text{Global error}}_{\text{what we care about}} \;\leq\; \underbrace{e^{LT}}_{\text{problem sensitivity}} \;\times\; \underbrace{O(h)}_{\text{per-step accuracy}}

The three ingredients have names that we will formalize when we study linear systems:

  • Backward error = the one-step error Ln=O(h2)\mathcal{L}_n = O(h^2). The numerical solution does not satisfy the original ODE, but it does satisfy a nearby, perturbed ODE. A method with small Ln\mathcal{L}_n solves a problem close to the original.

  • Forward error = the global error En=unu(tn)E_n = u_n - u(t_n), the quantity we actually care about: how far is our answer from the truth?

  • Condition number = eLTe^{LT}, the amplification factor. The Lipschitz constant LL measures how sensitive the ODE is to perturbations. This is a property of the problem, not the algorithm.

Small backward error does not automatically guarantee small forward error. It depends on whether the problem amplifies or damps per-step perturbations.


Stability Analysis

The convergence theorem guarantees that errors vanish as h0h \to 0. But in practice we use a fixed step size. Can errors grow from step to step?

The error propagation example (Example 2) already answered this for the linear problem u=λu+g(t)u' = \lambda u + g(t): the error at each step is multiplied by the amplification factor R=1+hλR = 1 + h\lambda. If R>1|R| > 1, errors grow exponentially and the method is useless.

This is why the scalar test equation u=λuu' = \lambda u plays a central role. Any smooth ODE is locally linear (by Taylor expansion), so the behavior of a method on u=λuu' = \lambda u reveals its stability properties in general. Applying forward Euler gives

un+1=(1+hλ)unu_{n+1} = (1 + h\lambda)\,u_n

so the numerical solution is un=(1+hλ)nu0u_n = (1 + h\lambda)^n u_0. For the solution to remain bounded, we need 1+hλ1|1 + h\lambda| \leq 1. Writing z=hλz = h\lambda, this defines the stability region.

Definition 6 (Stability Region)

The stability region of forward Euler is:

S={zC:1+z1}\mathcal{S} = \{z \in \mathbb{C} : |1 + z| \leq 1\}

This is a disk of radius 1 centered at (1,0)(-1, 0) in the complex plane.

Stability region of forward Euler: the disk |1 + z| \leq 1. For stability, z = h\lambda must lie inside this region.

Stability region of forward Euler: the disk 1+z1|1 + z| \leq 1. For stability, z=hλz = h\lambda must lie inside this region.

For real λ<0\lambda < 0, stability requires 2hλ0-2 \leq h\lambda \leq 0, giving the step-size restriction

h2λh \leq \frac{2}{|\lambda|}

Forward Euler is conditionally stable: the step size is restricted by the problem’s eigenvalues.

Stiffness

When λ|\lambda| is large, the stability constraint h2/λh \leq 2/|\lambda| forces extremely small step sizes even when the solution itself varies slowly. Stiffness is not about the solution being complicated; it is about the equation pulling toward a slow manifold so aggressively that explicit methods cannot keep up.

Definition 7 (Stiff Problem)

A problem is stiff when an explicit method must use a step size far smaller than what accuracy alone would require. Two step sizes are in play:

  • haccuracyh_{\text{accuracy}}: the largest hh that resolves the solution to the desired tolerance. This is set by the truncation error and how rapidly the solution varies.

  • hstabilityh_{\text{stability}}: the largest hh for which the method does not blow up. This is set by the stability region and the eigenvalues of the problem.

The problem is stiff when

hstabilityhaccuracyh_{\text{stability}} \ll h_{\text{accuracy}}

so that stability, not accuracy, dictates the step size.

Example 3 (Stiffness in Action (Prothero-Robinson))

Consider u=λ(ucost)sintu' = \lambda(u - \cos t) - \sin t with u(0)=1u(0) = 1. The exact solution is u(t)=costu(t) = \cos t regardless of λ\lambda: the same smooth, slowly varying function whether λ=1\lambda = -1 or λ=106\lambda = -10^6.

Since u(t)=costu(t) = \cos t, we have u(t)=cost1|u''(t)| = |\cos t| \leq 1.

Accuracy step size. By Proposition 1, the one-step error is Ln=hτn=h22u(tn)+O(h3)\mathcal{L}_n = h\tau_n = \frac{h^2}{2}u''(t_n) + O(h^3). For the Prothero-Robinson problem u(t)=cost1|u''(t)| = |\cos t| \leq 1, so

Lnh22|\mathcal{L}_n| \leq \frac{h^2}{2}

To keep the per-step error below a tolerance δ\delta, we need h2δh \leq \sqrt{2\delta}. This depends only on the smoothness of the solution, not on λ\lambda.

Over N=T/hN = T/h steps, the one-step errors accumulate to a global error of roughly ENNL=Thh22=Th2|E_N| \approx N \cdot |\mathcal{L}| = \frac{T}{h} \cdot \frac{h^2}{2} = \frac{Th}{2}. For a global tolerance ε=102\varepsilon = 10^{-2} over T=2T = 2:

haccuracy2εT=2×1022=102h_{\text{accuracy}} \approx \frac{2\varepsilon}{T} = \frac{2 \times 10^{-2}}{2} = 10^{-2}

This does not involve λ\lambda at all.

Stability step size. From the stability analysis above, forward Euler requires h<2/λh < 2/|\lambda|:

λ\lambdahstabilityh_{\text{stability}}haccuracyh_{\text{accuracy}}RatioSteps needed
-100.20.010.05 (not stiff)200
-10000.0020.015 (stiff)1000
-1062×1062 \times 10^{-6}0.015000106

The solution is identical in every row; only the stability constraint changes. With λ=106\lambda = -10^6, forward Euler needs a million steps to integrate to T=2T = 2, all wasted on stability rather than accuracy. An implicit method (backward Euler) can take h=0.01h = 0.01 and finish in 200 steps.

Forward Euler applied to u' = \lambda(u - \cos t) - \sin t with fixed h
= 10^{-3}. The exact solution is u(t) = \cos t (dashed) for all \lambda.
Left/center: \lambda = 0 and \lambda = -10 satisfy the stability
condition h < 2/|\lambda| and track the solution accurately. Right:
\lambda = -2100 violates the stability condition (h|\lambda| = 2.1 > 2) and
the numerical solution oscillates with exponentially growing amplitude.

Forward Euler applied to u=λ(ucost)sintu' = \lambda(u - \cos t) - \sin t with fixed h=103h = 10^{-3}. The exact solution is u(t)=costu(t) = \cos t (dashed) for all λ\lambda. Left/center: λ=0\lambda = 0 and λ=10\lambda = -10 satisfy the stability condition h<2/λh < 2/|\lambda| and track the solution accurately. Right: λ=2100\lambda = -2100 violates the stability condition (hλ=2.1>2h|\lambda| = 2.1 > 2) and the numerical solution oscillates with exponentially growing amplitude.

Why the convergence theorem cannot see stiffness

The convergence theorem (Theorem 1) uses the Lipschitz constant L=λL = |\lambda| as its measure of problem sensitivity. For stiff problems this gives a catastrophically pessimistic bound.

Example 4 (The Convergence Bound for Prothero-Robinson)

Take λ=1000\lambda = -1000 and T=2T = 2 in the Prothero-Robinson problem. The Lipschitz constant is L=f/u=λ=1000L = |\partial f / \partial u| = |\lambda| = 1000 and the one-step error satisfies Ln12h2|\mathcal{L}_n| \leq \frac{1}{2}h^2. The convergence theorem (Theorem 1) bounds the global error by accumulating one-step errors with per-step amplification (1+hL)(1 + hL):

En(1+hL)n1hLmaxLjeLT1Lh2=e200012000h10866h|E_n| \leq \frac{(1+hL)^n - 1}{hL}\max|\mathcal{L}_j| \leq \frac{e^{LT} - 1}{L} \cdot \frac{h}{2} = \frac{e^{2000} - 1}{2000}\,h \approx 10^{866}\,h

With the stability-limited step size h=0.002h = 0.002, this “guarantees” the error is below 10863\approx 10^{863}. The actual error is 0.002\approx 0.002.

To guarantee En<ε|E_n| < \varepsilon using this bound, we would need hεeLTε10868h \lesssim \varepsilon \cdot e^{-LT} \approx \varepsilon \cdot 10^{-868}, a step size no computer can take. The theorem is mathematically correct (it proves En0E_n \to 0 as h0h \to 0), but for stiff problems the hh it demands is computationally meaningless.

See Also

The Stiffness Detection and Auto-Switching notebook explores this further: adaptive integrators on the Prothero-Robinson problem reveal the haccuracyh_{\text{accuracy}} vs hstabilityh_{\text{stability}} gap quantitatively, and demonstrate how BS3 stage differences can detect stiffness at zero extra cost.


What About Rounding Errors?

The convergence theorem (Theorem 1) assumes exact arithmetic. On a computer, each step incurs a rounding error μn\mu_n in addition to the truncation error.

Theorem 2 (Total Error with Rounding)

Let a single-step method have consistency order pp, and let the method function ϕ\phi be Lipschitz with constant LϕL_\phi. If each step incurs a rounding error μn\mu_n, the total error satisfies

u(tn)vneLϕ(tnt0)r0+eLϕ(tnt0)1Lϕ(Chp+max0ln1μlh)\|u(t_n) - v_n\| \leq e^{L_\phi(t_n - t_0)}\|r_0\| + \frac{e^{L_\phi(t_n - t_0)} - 1}{L_\phi}\left(Ch^p + \max_{0 \leq l \leq n-1}\frac{\|\mu_l\|}{h}\right)

where r0r_0 is the initial error and vnv_n is the computed solution.

The bound has two competing terms as h0h \to 0:

This creates three regimes:

  1. Large hh — the discretization is too coarse to resolve the solution; errors decrease as hh shrinks.

  2. Moderate hh — the “sweet spot” where truncation error dominates and convergence at rate O(hp)O(h^p) is observed.

  3. Very small hh — rounding errors dominate and the total error increases as hh shrinks further.

Left: The Arenstorf orbit, a periodic solution of the restricted three-body problem for a satellite travelling around the earth and moon (dots). Due to its sensitivity this system is a standard test case. Right: Error after integrating one full period with 2^k steps using a Runge-Kutta method. Three regimes are visible: (1) for small k the discretization is too coarse; (2) at moderate k the error decreases rapidly at the expected convergence rate; (3) at large k rounding errors accumulate and the error increases.

Figure 4:Left: The Arenstorf orbit, a periodic solution of the restricted three-body problem for a satellite travelling around the earth and moon (dots). Due to its sensitivity this system is a standard test case. Right: Error after integrating one full period with 2k2^k steps using a Runge-Kutta method. Three regimes are visible: (1) for small kk the discretization is too coarse; (2) at moderate kk the error decreases rapidly at the expected convergence rate; (3) at large kk rounding errors accumulate and the error increases.

There is an optimal step size hopth_{\text{opt}} that balances the two contributions. Below hopth_{\text{opt}}, making hh smaller makes things worse.

Remark 4 (Practical Consequences)

  • Too-small step sizes must be avoided: they waste computation and degrade accuracy.

  • This is another reason why stiffness (Definition 7) is so dangerous: a stiff problem forces an explicit method to use a step size hstabilityhaccuracyh_{\text{stability}} \ll h_{\text{accuracy}}, pushing us deep into the regime where rounding errors dominate. The method is not only wasting work — it is actively losing accuracy.

  • This motivates higher-order methods (Runge-Kutta): a method of order pp achieves a given accuracy with a larger hh, staying further from the rounding-error floor.

  • Rounding error accumulation is not just a hardware limitation — it also depends on the implementation. Each Euler step computes un+1=un+hϕ(tn,un,h)u_{n+1} = u_n + h\phi(t_n, u_n, h), which is a running sum: we repeatedly add a small increment to a large accumulator. This is exactly the setting where floating-point summation errors accumulate. A compensated variant tracks the rounding error explicitly, applying the same idea as Kahan summation (see exercises Q2.4):

{un+1=un+(hϕ(tn,un,h)+μn)μn+1=(un+1un)hϕ(tn,un,h)\left\{\begin{aligned} u_{n+1} &= u_n + \bigl(h\,\phi(t_n, u_n, h) + \mu_n\bigr) \\ \mu_{n+1} &= (u_{n+1} - u_n) - h\,\phi(t_n, u_n, h) \end{aligned}\right.

with μ0=0\mu_0 = 0. Just as Kahan summation recovers the low-order bits lost when adding a small number to a large running total, this scheme feeds the per-step rounding error back into the next step.


Limitations

Low order. Forward Euler is only O(h)O(h) accurate. Just as central differences improved on forward differences by averaging, we can build higher-order ODE methods by evaluating ff at cleverly chosen intermediate points and combining the results. This is the idea behind Runge-Kutta methods; see the optional section on Runge-Kutta and adaptive methods.

Fixed step size. For a nonlinear ODE, the effective λ\lambda changes along the solution. A step size that is stable in one region may be unstable in another, and a step size that is accurate during rapid transients may be wasteful during slow evolution. With a fixed hh, there is no way to adapt. This motivates adaptive time-stepping, where we estimate the local truncation error at each step and adjust hh automatically; see the optional section on Runge-Kutta and adaptive methods.