90 Ordinary Differential Equations
The choice of constants which leads to the classical fourth order Runge-Kutta
recursion is
and b3 = l.
One usually finds the recursion for Yn+l written as
ki = f(xn, Yn)
hn hnk1)
k2 = f(xn + 2 ' Yn + - 2 -
hn hnk2)
k3 = f(xn + 2 ' Yn +- 2 -
k4 = f(Xn + hn, Yn + hnk3)
(23)
Hence, the fourth order Runge-Kutta method may be viewed as a weighted
average of four approximate values of the slope of the exact solution f(t, ¢(t))
at different points within the interval of integration [xn, Xn+il · The value ki
is an approximation of the slope of the exact solution at the left endpoint
of the interval of integration. The value k 2 is an approximation of the slope
of the exact solution at the midpoint of the interval of integration which is
obtained by using Euler's method to approximate ¢(xn + hn/2). The value
k 3 is another approximation of the slope at the midpoint of the interval of
integration. And k 4 is an approximation of the slope at the right endpoint
Xn+l· The local discretization error of the fourth order Runge-Kutta method
is proportional to h~ and if f is a function of x alone, then the fourth order
Runge-Kutta recursion (23) reduces to Simpson's rule. Because of its relative
high order of accuracy, the fourth order Runge-Kutta method is one of the
most commonly used single-step methods.
EXAMPLE 5 Fourth Order Runge-Kutta Approximation of
the Solution to the IVP: y' = y + x ; y(O) = 1
Find an approximate solution to the initial value problem
(7) y' = y + x = f(x, y); y(O) = 1
on the interval [O, 1] using the fourth order Runge-Kutta method and a con-