A better estimate of the slope
For the initial-value problem , , explicit Euler advances by . It uses the slope at the beginning of the interval for the entire step. If the slope changes, the discrepancy accumulates. We can estimate a slope inside the step without knowing the exact solution there: first predict a state using Euler, then evaluate the slope at the predicted state.
Definition 1.10.1
(Explicit midpoint method)
For a step size , the explicit midpoint method advances from by
The intermediate state is only an approximation to the true midpoint. The method is still explicit: is available before , and no equation for must be solved.
A second two-stage rule predicts the state at the end of the step instead.
Definition 1.10.2
(Heun's method)
Heun's method, also called the explicit trapezoidal method, advances from by
Heun averages the initial slope and a predicted end slope. It is not the implicit trapezoidal rule, which evaluates the end slope at the unknown . Both explicit formulas also work for vector-valued states, with scalar multiplication and addition understood componentwise.
Why the extra evaluation raises the order
Write for the partial derivative with respect to time and for the derivative with respect to the state. For a scalar problem, differentiation along a smooth exact solution gives
Starting a midpoint step from the exact value , Taylor expansion of at gives
where the unlabeled terms are evaluated at . Consequently the numerical step is , matching the exact Taylor expansion through . For Heun, the predicted end slope is ; averaging it with gives the same first three terms. Thus each method has an absolute one-step defect of order , provided the needed derivatives are bounded. This defect is calculated with exact starting data, and is not the same as the error after many steps.
Theorem 1.10.3
(Second-order convergence on a fixed interval)
Let . Suppose is Lipschitz in with constant on a region containing the exact solution, the numerical stages, and the intermediate stages obtained by starting each step at , and suppose the absolute one-step defects of one of the two methods are bounded by uniformly for . Starting from the exact initial value, its global error satisfies for . In particular, with the constants uniform under refinement, the method is second order.
Proof
(A one-step Lipschitz bound, then the Euler recursion)
Let be either update. For explicit midpoint, changing the starting value from to changes by at most , and changes by at most . For Heun, the second slope changes by at most , and averaging the two slopes produces the same bound. In both cases
The exact step differs from by at most . Therefore the error obeys , where . Since , summing the resulting geometric terms and bounding each by gives . The region assumption matters: a local Lipschitz constant cannot be applied to stages that leave its region.
Proof X-ray
What the order statement needs
The proof isolates one property of each scheme: its Lipschitz constant as a map of the starting value. The key computation is that this constant is rather than the of Euler. The extra term appears because the second stage evaluates at a point that itself depends on the starting value through , so a perturbation passes through twice. That is why the region hypothesis must cover the intermediate stages, and not only the exact solution and the numerical values.
The defect bound is used only for the fresh error made in each step from exact starting data; the Taylor calculation above is where the particular coefficients of the two schemes matter. The argument then closes as for Euler: unroll , bound by , and use , which costs one power of . Nothing in it controls the error for a fixed large step; it is a statement about refinement on a fixed interval.
Worked example 1.10.4
(Two steps for exponential growth)
For , and , midpoint gives , and . At , two steps give ; the exact answer is . Heun has the same multiplier on this linear equation. Agreement here does not make the methods identical on nonlinear problems.
With , four steps give , an error of about instead of . Halving divides the error by about , close to the factor that second order predicts as ; explicit Euler's errors on the same test, about and , fall only by a factor of about .
Worked example 1.10.5
(The stages are different on a nonlinear equation)
For , , , midpoint has , , hence . Heun has and gives . The exact solution is for , so . Both approximations are below the exact value in this example; there is no general ordering between the methods.
Worked example 1.10.6
(When the slope does not depend on the state)
If , the stages no longer involve the state, and one step of each method is a quadrature rule for : midpoint becomes the midpoint rule and Heun the trapezoidal rule . For , and a single step , midpoint gives and Heun gives , while . The errors and have opposite signs, and the midpoint error is half as large. Both rules integrate linear exactly, which is why Heun is exact for in the practice below.
Stability is separate from order
For the test equation put . Both methods have the same amplification factor
Repeated perturbations decay on this scalar problem when . If is real and negative, then is positive and is less than one exactly when . Thus, like explicit Euler, these methods need to damp a negative real mode. Higher order does not remove this stiffness restriction.
Counterexample mode
An accurate-order method can amplify a decaying mode
For and , and . The exact solution decays, yet numerical perturbations grow by each step. Reducing below yields decay for this test mode; it does not by itself establish that the resulting error meets a chosen tolerance.
For comparison, the implicit trapezoidal rule satisfies . On the test equation its factor is , when the denominator is nonzero. If , the denominator has larger modulus than the numerator, so it damps that mode for any . It requires solving an equation at each step. Moreover its factor tends to as tends to negative infinity: a very fast mode may oscillate with little damping, despite absolute stability. Stability, damping and accuracy are distinct questions.
Concept lensAlgebraic
The stability function as a polynomial approximation of the exponential
On the test equation the exact solution is multiplied by per step, and is the Taylor polynomial of of degree two; the two differ by , matching the second-order defect. Every explicit Runge–Kutta method gives a polynomial , of degree at most the number of stages. A nonconstant polynomial is unbounded as , so no explicit method damps every decaying mode. The implicit trapezoidal factor is a rational function, which can stay bounded by one on the left half-plane.
Common mistake
(Heun's method is not the implicit trapezoidal rule)
The two rules share the weights , but Heun evaluates the end slope at the Euler prediction, while the implicit rule evaluates it at the unknown . Their stability properties are completely different. For and , so , Heun multiplies the state by per step, while the implicit trapezoidal rule multiplies it by .
Practice
Quick check
(Use explicit midpoint with for , , to find .)
Compute , then the predicted midpoint state.
Solution · Answer
, so the predicted midpoint state is at time , and . Thus . The exact solution gives .
Quick check
(Apply Heun with to , , for two steps. Compare with the exact answer at .)
The slopes depend only on .
Solution · Answer
The slopes on the first step are and , giving . On the second they are and , giving . The exact solution also gives , because the trapezoidal rule integrates the linear slope exactly. Exactness for this example does not imply exactness for general .
Quick check
(For , find the positive step sizes for which midpoint damps perturbations. What happens at the nonzero endpoint?)
Use with .
Solution · Answer
Here , and exactly when , so . At , : the perturbation remains unchanged rather than decaying.
Quick check
(On with , does explicit midpoint damp, preserve, or amplify the magnitude of a perturbation?)
Compute .
Solution · Answer
Put . Then and . The numerical magnitude grows, even though the exact magnitude is constant.