# How were weights chosen in Runge-Kutta (4) method?

Consider an ODE $$\dot y = f(t, y)$$. We will approximate the value of $$y$$ using the 4th-Order Runge-Kutta method. Let $$\Delta$$ be the step size, then in step $$i+1$$ we have $$~y_{i+1} = y_i + deriv\cdot\Delta~$$, where: $$\begin{eqnarray*} deriv &=& \frac{1}{6}(d_1 + 2d_2 +2d_3 + d_4) \\ d_1 &=& f(t_i, y_i) \\ d_2 &=& f(t_i + \frac{\Delta}{2}, y_i + d_1 \frac{\Delta}{2}) \\ d_3 &=& f(t_i + \frac{\Delta}{2}, y_i + d_2 \frac{\Delta}{2}) \\ d_4 &=& f(t_i + \Delta, y_i + d_3 \Delta) \end{eqnarray*}$$ Why those particular weights were chosen: 2 for $$d_2$$ and $$d_3$$, and 1 for $$d_1$$ and $$d_4$$? Why not $$deriv = \frac{1}{4}(d_1 + d_2 + d_3 + d_4)$$? (or any other weights)

• If it helps, consider that if $\frac{\partial f}{\partial y} = 0$, then $d_2 = d_3$, and so RK4 is Simpson's rule. – Pseudonym Mar 29 at 22:31