Runge-Kutta methods approximate IVP solutions using higher-order Taylor expansions, without evaluating derivatives of f.
The order-n Taylor expansion of y needs derivatives of f up to order n−1. These are costly to compute and may not exist everywhere. Runge-Kutta methods replace each derivative term with values of f at selected (t,y) points.
Mesh points are ti=a+ih with h=Nb−a, as in Euler’s method.
Midpoint Method
Second-order Taylor, with the derivative term replaced using
f(t,y)+2hf′(t,y)=f(t+2h, y+2hf(t,y))+O(h2)
w0wi+1=α=wi+hf(ti+2h, wi+2hf(ti,wi))
Local error O(h2).
Modified Euler Method
Third-order Taylor, with the derivative term replaced by an average of the endpoint slopes.
w0wi+1=α=wi+2h[f(ti,wi)+f(ti+1, wi+hf(ti,wi))]
Local error O(h3).
Order 4 Runge-Kutta
w0k1k2k3k4wi+1=α=hf(ti,wi)=hf(ti+2h, wi+21k1)=hf(ti+2h, wi+21k2)=hf(ti+1, wi+k3)=wi+61(k1+2k2+2k3+k4)
for i=0,1,…,N−1. Local error O(h4).
Error Orders
Higher order gives a better approximation for the same h.
Memorization
All four have the form wi+1=wi+h×(slope estimate). They differ only in how the slope is estimated.
- Euler
Slope at the left end, f(ti,wi). Nothing else.
- Midpoint
Half-step to the middle with Euler, then take the slope there. One evaluation at (ti+2h, wi+2hf(ti,wi)).
- Modified Euler
Average of the two end slopes. Left slope f(ti,wi), right slope at the full Euler-predicted point (ti+1, wi+hf(ti,wi)), weight 21 each.
- Order 4 Runge-Kutta
Weighted average of four slopes with weights 1,2,2,1 over 6 (Simpson’s rule). Sample points step through ti, ti+2h, ti+2h, ti+1, and each kj feeds the y-argument of the next: k1 into k2, k2 into k3, k3 into k4, all with factor 21 except k3→k4 which uses the full k3.
Worked Example
IVP y′(t)=y−t2+1, 0≤t≤2, y(0)=0.5, with N=4, so h=0.5 and f(t,y)=y−t2+1. Exact solution y(t)=(t+1)2−0.5et, giving y(2)≈5.3055.
Midpoint
w1w2=w0+0.5f(0.25, 0.5+0.25f(0,0.5))=0.5+0.5f(0.25, 0.875)=1.4063=2.5977,w3=3.9399,w4=5.2149
Modified Euler
w1w2=w0+0.25[f(0,0.5)+f(0.5, 0.5+0.5f(0,0.5))]=0.5+0.25[1.5+2.0]=1.375=2.5156,w3=3.7754,w4=4.9163
Order 4 Runge-Kutta
First step, t0=0, w0=0.5
k1k2k3k4w1=0.5f(0, 0.5)=0.75=0.5f(0.25, 0.5+0.375)=0.9063=0.5f(0.25, 0.5+0.4531)=0.9453=0.5f(0.5, 0.5+0.9453)=1.0977=0.5+61(k1+2k2+2k3+k4)=1.4251
Continuing, w2=2.6396, w3=4.0068, w4=5.3016.