Applied and computational mathematics
Numerical solution of differential equations
Step-by-step methods like Euler's and Runge–Kutta that approximate solutions when exact formulas are unavailable.
IntuitionApproximating a curve one small step at a time
Most differential equations that appear in physics, engineering, and finance have no closed form written with elementary functions. Numerical methods replace the exact curve by a sequence of approximations , computed step by step using only the slope that the equation provides at each point. The smaller the step size , the closer the broken line of approximations hugs the true curve — but smaller steps also mean more arithmetic, so every method balances accuracy against cost.
SchoolEuler's method
Definition: Euler's method (explicit)
Given the initial value problem with , choose a step size and set . Euler's method advances the approximation using the update rule , repeating for .
Here is the given slope function, is the fixed step size, and is the approximation to the true value produced after steps. Each step simply follows the tangent line predicted by at the current point for a horizontal distance , then re-evaluates the slope at the new point — geometrically the picture is a chain of straight segments approximating the curve.
| Method | Evaluations of per step | Global error order | Suitable for stiff equations? |
|---|---|---|---|
| Explicit Euler | 1 | No (needs a very small ) | |
| Classical RK4 | 4 | No (still needs small for stiff problems) | |
| Implicit Euler | 1 (plus solving one equation) | Yes (A-stable for any ) |
UndergraduateConvergence: how accurate is each method?
Suppose is Lipschitz continuous in with constant , and the exact solution satisfies on . Then the global error after steps of size obeys .
Why is it true?
Each individual Euler step commits a small local error of size from truncating the Taylor series after the linear term, but these local errors can compound over the roughly steps needed to reach a fixed time . The theorem shows the compounding is mild: the Lipschitz condition prevents small local mistakes from being amplified faster than exponentially, so the global error drops to first order, , in the step size — one order worse than the local error, which is the typical pattern for one-step methods.
Proof
Write the local error committed in one step as the difference between the exact solution advanced by Taylor expansion and the Euler update. Taylor's theorem gives for some between and , so the local truncation error is , bounded by using the assumption .
Subtract the Euler update from this exact Taylor expansion. Writing , the difference of the two right-hand sides gives . The Lipschitz condition bounds the bracketed term by , so .
Since (the starting value is exact), unrolling this recursion by induction gives , using the geometric-series identity. Finally, because for all real , which turns the bound into — exactly the claimed inequality, and manifestly for fixed .
The classical fourth-order Runge–Kutta method, defined by the stages , , , and update , has local truncation error per step and, under the same Lipschitz assumption as before, global error after steps.
Why is it true?
RK4 evaluates the slope four times per step at cleverly chosen intermediate points instead of once, and averages them with weights (out of ). This extra work buys three more orders of accuracy compared to Euler's method: matching the Taylor expansion of the true solution through the term, instead of stopping after the linear term.
Proof
Expand each stage in a Taylor series around . Since , and evaluate at the midpoint using shifted by half a step in the direction of an earlier stage, substituting the chain rule for , , and into each produces four polynomials in agreeing with up to the orders that each stage can see.
Forming the weighted combination and multiplying by , the coefficients of and in this sum are exactly the coefficients of the Taylor expansion through the term — this is precisely the classical set of order conditions that the coefficients and of the RK4 tableau were chosen to satisfy.
Because the two series agree through , the first term where they can differ is the term, so the local truncation error is per step. As in the Euler case, telescoping these local errors over the steps needed to reach a fixed time using the Lipschitz condition on loses exactly one power of , giving a global error of .
AdvancedStiff equations and implicit methods
A differential equation is called stiff when it mixes very different time scales: some components of the solution decay extremely fast while others change slowly, forcing explicit methods to take tiny steps just to stay numerically stable, even though accuracy alone would allow much larger ones. For the simple test equation with , Euler's method is stable only when holds, i.e. when , so a strongly negative (a fast-decaying mode) forces to be tiny.
Implicit methods such as backward (implicit) Euler, , require solving an equation for at every step (often by Newton's method when is nonlinear), but in exchange they remain stable for any step size on this test equation — a property called A-stability — which is exactly what is needed for stiff systems arising in chemical kinetics, circuit simulation, and control theory.
UndergraduateReal-World Applications and Worked Examples
Numerical integrators for differential equations are the computational backbone of simulation software: they advance the state of a physical or financial system forward in time using nothing but the governing equation and a starting condition. Circuit simulators use them to predict voltages and currents, orbital mechanics software uses them to propagate satellite trajectories, chemical engineers use stiff solvers to model fast reaction networks, and quantitative finance uses them to simulate interest-rate and option-pricing models.
Example: Discharging an RC circuit with Euler's method
A capacitor in an RC circuit discharges according to (time measured in units of ) with initial voltage . Use Euler's method with step to estimate .
Solution
Here , so the update rule is simply with .
First step: .
Second step: , so the Euler estimate is .
The exact solution is , giving , so the two-step Euler estimate is off by about — consistent with a first-order, , global error that shrinks proportionally to .
Example: Why a fast reaction forces a tiny step size
A simplified chemical kinetics model has a fast-decaying transient governed by with . Determine the largest step size for which explicit Euler's method stays numerically stable, and explain what changes if implicit Euler is used instead.
Solution
Near the fast transient the equation behaves like the linear test equation , so the relevant value is . Explicit Euler is stable exactly when , which for becomes , i.e. — a very small ceiling even though the slow part of the solution barely changes over that interval.
If is chosen larger than , the numerical values start oscillating with growing amplitude even though the true solution is smooth and bounded: this is a stability failure, not an accuracy failure, because the local truncation error would actually be acceptable at a much larger .
Switching to implicit Euler, , the stability requirement for the same test equation becomes , which holds for every when : the method is A-stable, so the step size can instead be chosen based purely on how accurately the slow part of the solution needs to be tracked, not on the fast transient.
Using Euler's method with , , and step size , what is the approximation after one step?
What is the global order of accuracy of the classical fourth-order Runge–Kutta (RK4) method?
When explicit Euler is applied to a stiff differential equation, what typically happens if the step size is only slightly larger than the stability threshold?
Which of the following is a typical real-world use of numerical differential-equation solvers?
References
- J. C. Butcher (2016). Numerical Methods for Ordinary Differential Equations
- E. Hairer, S. P. Norsett, G. Wanner (1993). Solving Ordinary Differential Equations I: Nonstiff Problems