# Proving the exactness of the Runge-Kutta algorithm to the second order in step-size

1. Feb 17, 2012

### mjordan2nd

1. The problem statement, all variables and given/known data

We're supposed to prove that

$$y_{n+1} = y_n + \frac{k_1 + 2k_2 + 2k_3 + k_4}{6}$$
$$k_1 = hf(t_n, y_n)$$
$$k_2 = hf(t_n + \frac{h}{2}, y_n + \frac{k_1}{2})$$
$$k_3 = hf(t_n + \frac{h}{2}, y_n + \frac{k_2}{2})$$
$$k_4 = hf(t_n + h, y_n + k_3)$$
$$f(t, y) = \frac{dy}{dt}$$

is equivalent to the Taylor expansion up to the second order in step size, h:

$$y_{n+1} = y_n + h \frac{dy}{dt} + \frac{1}{2} h^2 \frac{d^2 y}{dt^2}$$.

2. Relevant equations

We can expand a function as follows:

$$g(x + \Delta x, y + \Delta y) = g(x,y) + \frac{\partial g}{\partial x} \Delta x + \frac{\partial g}{\partial y} \Delta y.$$

Also, we can write the second time derivative of y as follows:

$$\frac{d^2 y}{dt^2} = \frac{df}{dt} = \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial t} = \frac{\partial f}{\partial y} f(t,y) + \frac{\partial f}{\partial t}$$.

3. The attempt at a solution

I will use these above equations to expand k2, k3, and k4. I will show all of my work for k2, and state my results for k3 and k4 since they are calculated similarly.

$$k_2 = h \left[ f(t_n, y_n) + \frac{df}{dt} \bigg|_n \frac{h}{2} + \frac{df}{dy} \bigg_n h \frac{f(t_n, y_n)}{2} \right]$$
$$= h \left[f(t_n, y_n) + \left( \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial t} \right)_n \frac{h}{2} + \frac{\partial f}{\partial y} \bigg|_n h \frac{f(t_n, y_n)}{2} \right]$$
$$= h \left[ f(t_n, y_n) + \frac{df}{dy} f(t_n, y_n) \bigg_n h + \frac{h}{2} \frac{\partial f}{\partial t}$$