Midpoint, Heun and Runge–Kutta Methods
Improve slope estimates and understand what the advertised order assumes.
Builds on Euler’s Method and Local Slopes
The bigger question: How do we trust a numerical trajectory?
On this page
The idea
Higher-order methods sample more than one slope in a step. Midpoint predicts the middle state and uses its slope. Heun averages the initial slope with a predicted endpoint slope. Both are second order for smooth problems; they are distinct algorithms despite sometimes producing the same value.
Visual guide
- Exact e⁻ᵗ
- Euler
- Midpoint
Method and assumptions
Midpoint uses , and . Classical RK4 samples at the start, twice at the middle and at the end, then combines slopes with weights divided by . Its global error is order under suitable smoothness and stability assumptions.
Worked example: midpoint decay
For , , and the predicted midpoint state is . Thus and , closer to than Euler’s .
Try it yourself.
Choose an answer and explain your reasoning to yourself. Use a hint if you get stuck.
Hint 1 · Find a starting point
Global error behaves like C h² in that regime.
Hint 2 · Take the next step
Replace h by h/2 and square the factor.
Show the reasoning
Answer: A factor of 1/4
C(h/2)²=(1/4)Ch². Stability and regularity are still required.
Before moving on: what would make one of the other answers wrong? Saying why is part of understanding.
Worked example: RK4 on the same step
For the same decay equation, RK4’s amplification polynomial is . At this gives , close to the exact . The improvement costs four slope evaluations instead of one.
Interpreting the result
Higher order does not remove stability limits or repair discontinuous forcing automatically. Split a step at known discontinuities. Adaptive methods estimate local error and adjust steps, but the requested tolerance is not an unconditional bound on every global error.
Practice
- How does a second-order global error typically change when halves?
- How does a fourth-order error typically change?
- Why compare computational cost as well as step count?
Show worked solutions
- It falls by about a factor of in the asymptotic regime.
- By about a factor of under the same assumptions.
- Different methods evaluate the right side different numbers of times per step.
Further study
MIT OpenCourseWare: Differential Equations provides a full university course with additional lectures and exercises.
Pause before the next idea.
Can you explain how the visualization connects to this lesson’s goal? If a step still feels uncertain, put this lesson on your review list and try the check again another day.