Runge-Kutta 4th order (RK4) — derivation
4.8.24· Maths › Numerical Methods
, ko solve karna, bina closed-form solution jaane.
The Big Picture
WHAT: hum kya karne ki koshish kar rahe hain?
HOW: general RK4 skeleton derive karna
Ek 4-stage explicit RK method ki form hoti hai jahan har stage pichle wale use karti hai:
Ye shape kyun? Har ek sample point pe ka estimate hai. Hum constants is tarah tune karte hain ki poori cheez true solution ki Taylor series se tak agree kare.
Step 1 — True solution ka Taylor expansion (target)
Kyunki hai, baar baar differentiate karo (chain rule, yaad rakho depend karta hai pe):
Ye step kyun? Ye exact quantities hain jo true solution carry karti hai. Hamara method inhe reproduce karna chahiye.
To exact step hai
Step 2 — Har ko Taylor expand karo aur match karo
ko 2-variable Taylor series ke roop mein expand karke aur weighted sum ko upar diye exact expansion ke barabar force karke order conditions ka ek system milta hai. Classic solution (infinitely many hain; ye elegant symmetric wala hai):
aur , , baaki sab zero.
Ye numbers kyun? Weights exactly Simpson's rule weights hain — kyunki jab sirf pe depend karta hai, RK4 reduce ho jaata hai Simpson's -style integration mein, jo accurate hai. RK4 Simpson's rule ka -dependence ke liye generalization hai!
Step 3 — Classical RK4 formulas

Worked Example 1
, solve karo, se nikalo.
- — Kyun? Start pe slope.
- — Kyun? ka aadha use karke midpoint.
- — Kyun? ka aadha use karke refined midpoint.
- — Kyun? Pura use karke endpoint.
Exact solution . Error ! Itna achha kyun? Fourth-order accuracy ki wajah se.
Worked Example 2 (Forecast-then-Verify)
, , ek step solve karo. Forecast: true value hai; Euler deta hai. Predict karo ki RK4 ke kaafi kareeb aayega.
Verify: vs , error even with huge step . Gaur karo = ki series ke pehle paanch terms — direct proof ki RK4 Taylor se tak match karta hai.
Common Mistakes
Recall Feynman: ek 12-saal ke bacche ko explain karo
Imagine karo tum fog mein ek pahaadi par chal ke sahi height pe utarna chahte ho. Euler sirf wahan slope check karta hai jahan se wo shuru hota hai aur seedha chalta hai — wo overshoot kar deta hai. RK4 zyada samajhdar hai: wo start pe slope dekhta hai, phir beech mein guess karta hai, check karta hai, beech ko dobara check karta hai, phir door wale end ko check karta hai — aur charon peeks ka cleverly weighted average leta hai (do beech wali peeks double count hoti hain). Wo average real curved path ko almost perfectly match karta hai. To bade steps mein bhi, wo almost exactly target pe land karta hai.
Active Recall
What IVP does RK4 solve?
Write the four RK4 slope formulas (with ).
What is the RK4 update formula?
What are the local and global error orders?
Why do get weight 2?
Where is each sampled?
What does RK4 reduce to when only?
How does RK4 avoid computing derivatives of ?
Why is global error one order lower than local?
Connections
- Euler's Method — 1st-order ancestor (single left-edge slope).
- Modified Euler / Heun's Method — 2nd-order sibling (edges ka average).
- Simpson's Rule — weights ka source.
- Taylor Series Methods — jo RK4 bina derivatives ke mimic karta hai.
- Local vs Global Truncation Error — globally 4th order kyun hai.
- Adaptive Step Size (RKF45) — error control ke saath RK4.