4.8.24 · D5Numerical Methods
Question bank — Runge-Kutta 4th order (RK4) — derivation
Reminder of the machinery you are being tested on (in our convention , so each already carries one factor of the step size ):
True or false — justify
RK4 needs you to compute , (the partial derivatives of ) and higher derivatives of by hand.
False. The whole point is that RK4 replaces those partial derivatives with extra evaluations of itself at interior sample points, yet still matches the Taylor series up to .
RK4 is exact whenever depends only on (i.e. ).
False in general. It then reduces to Simpson's rule, which is exact only for polynomials up to degree 3; for higher-degree or non-polynomial there is still an per-step error.
The weights must add to .
True. They are a weighted average of slopes; if they didn't sum to the method wouldn't even reproduce the first Taylor term , so it couldn't be consistent.
Halving makes the global error about times smaller.
True. Global error is , and , so each halving of the step cuts total error by roughly a factor of 16.
Because each step's error is , the error after crossing a whole interval is also .
False. Crossing a fixed interval needs steps, so the per-step errors accumulate into globally — one power is lost.
RK4 is unconditionally accurate, so any step size gives a good answer.
False. "4th order" only describes how fast error shrinks as ; a large can still give a poor answer, and stiff problems can even blow up.
and are evaluated at the same -location.
True. Both sit at the midpoint ; they differ only in the -value used ( uses , uses the refined ).
If you use the "slope-only" convention where , the update formula is unchanged.
False. Then you must reintroduce : , because the no longer carry the factor .
RK4 always beats Euler for the same step size .
Only with qualifiers. For a smooth problem, per step RK4 is far more accurate (and still wins per unit work despite costing 4 evaluations to Euler's 1). But for non-smooth or stiff problems the order advantage can vanish or RK4 can even diverge — so "always" is wrong without "smooth, non-stiff".
Spot the error
A student writes . What's wrong?
The -argument is wrong: lives at the midpoint , not the endpoint . Only uses .
A student writes . What's wrong?
must use the refined midpoint value , not . Reusing just recomputes and throws away the refinement.
A student writes using . What's wrong?
A double factor of . Since already contains , the blend is with no extra ; the form only applies to the slope-only convention.
A student writes . What's wrong?
uses the full , i.e. , not half of it — because it steps a full from the midpoint to the right edge.
A student uses weights over instead of over . Why does accuracy collapse?
Equal weighting fails the order conditions; it no longer matches Simpson's integration, so it drops from 4th order to roughly 1st–2nd order accuracy.
A student computes but forgot the factor inside every (used only). What symptom appears?
Each is now times too large (an instead of an ), so the update overshoots — for the step is too big and races off far beyond the true curve.
Why questions
Why do the two midpoint samples receive double weight?
The midpoint slope best represents the interval's average behaviour (Simpson intuition), so weighting it more heavily makes the blended slope match the true curved path more accurately.
Why does RK4 sample the slope inside the step at all, instead of just at the left edge like Euler?
The slope changes across the step; a single left-edge slope misses that variation, whereas interior samples capture how the slope bends and give a far better average slope.
Why are the RK4 weights the same as Simpson's rule?
When only, the update literally becomes Simpson's rule for ; RK4 is Simpson's rule generalised to allow -dependence, so it inherits those weights.
Why is RK4 called "4th order" rather than "5th order", given the per-step error is ?
The name refers to the global order ; error accumulation over steps costs one power of .
Why does RK4 match the true Taylor expansion up to without ever differentiating ?
The interior function evaluations, when Taylor-expanded, reproduce exactly the partial-derivative combinations (, etc.) that appear in — so extra evaluations stand in for derivatives.
Why is the classical RK4 not the only 4th-order 4-stage method?
The order conditions form an underdetermined system with infinitely many solutions; the classical choice is just the elegant symmetric one, but other valid constant sets exist.
Why does taking more, smaller steps eventually give diminishing returns even for RK4?
As shrinks, truncation error keeps dropping as , but rounding error from finite-precision arithmetic grows; below some the roundoff dominates and accuracy worsens.
Edge cases
What happens to all four if (the solution is constant)?
Every , so exactly — RK4 correctly leaves a constant solution untouched.
For a linear autonomous problem , with one step , what does equal, term by term?
, i.e. the first five terms of 's series — a direct demonstration that RK4 reproduces the Taylor expansion through .
If is discontinuous somewhere inside a step, is RK4's local error still valid?
No. The order analysis assumes is smooth (enough continuous derivatives) across the step; a kink or jump breaks the Taylor matching and accuracy drops sharply.
What does RK4 do on the trivial case (constant slope 1)?
All , so — exactly the straight-line answer, as it must be.
For a stiff equation like , why can a moderate make RK4 diverge?
RK4 is explicit with a bounded stability region; if leaves that region the numerical solution amplifies instead of decaying, blowing up despite the equation's true solution shrinking. This motivates Adaptive Step Size (RKF45).
If the exact solution is a cubic polynomial in (with only), how large is RK4's error?
Zero (up to rounding): Simpson's rule integrates cubics exactly, and RK4 reduces to Simpson here, so it hits the true value.
Recall One-line summary of the traps
The three deadliest are: (1) putting at the endpoint instead of the midpoint, (2) double-counting by mixing conventions, and (3) confusing local with global .
Connections
- Parent derivation (Hinglish) — where all these facts are built.
- Euler's Method — the single-slope baseline the traps compare against.
- Modified Euler / Heun's Method — 2nd-order sibling; contrast midpoint logic.
- Simpson's Rule — source of the weights.
- Taylor Series Methods — the target RK4 matches without derivatives.
- Local vs Global Truncation Error — the order-lowering argument.
- Adaptive Step Size (RKF45) — fixes the stiffness/step-size edge cases.