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.


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:

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

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.

Consistency Order

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?

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

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.

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.

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.


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.

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.


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.