Heun's Method — Definition, Formula & Example
Heun's method is a step-by-step way to approximate the solution of a differential equation. At each step it averages the slope at your current point with the slope at a predicted next point, then uses that average to move forward.
For the initial value problem , , Heun's method is the explicit two-stage Runge–Kutta scheme that uses an Euler predictor and a trapezoidal corrector. It is also called the improved Euler method or the explicit trapezoidal method. It is second-order accurate: for a smooth , the local truncation error is and the global error is . Euler's method, by contrast, has global error . A few textbooks attach Heun's name to other Runge–Kutta variants, so check which scheme your course means.
Key Formula
Where:
- = Current point on the approximate solution
- = Step size in x
- = Slope at the start of the step
- = Slope at the Euler-predicted end of the step
- = Approximate value of y at + h
How It Works
First compute the slope at your current point. Take a trial Euler step with that slope to predict the next -value. Next, evaluate the slope at that predicted point. Finally, step from the original point using the average . Euler's method stops after the first slope. Heun's method spends one extra evaluation of per step to correct for the curve bending away from its tangent line.
Worked Example
Problem: Use one step of Heun's method with to approximate , given and .
Step 1: Find the slope at the starting point .
Step 2: Predict the endpoint with an Euler step, then find the slope there at .
Step 3: Average the two slopes and take the corrected step from the original point.
Answer: Heun's method gives . The exact solution is , so . Euler's method with the same step gives only . Its error is about , while Heun's error is about .
Why It Matters
Heun's method is usually the first higher-order solver taught in a differential equations or numerical analysis course. It introduces the predictor-corrector idea and leads directly to the classical fourth-order Runge–Kutta method. Engineers and physics programmers use it for simple simulations, such as projectile motion with drag, when Euler's method drifts too far from the true solution.
Common Mistakes
Mistake: Forgetting to halve the sum of the slopes and writing .
Correction: The method uses the average slope, so the update is . In the example above, the incorrect version gives instead of the correct .
