Is knowing the second derivative useful in numerical integration

numerical methodsordinary differential equations

Consider Euler's method:

$$
y(t + dt) \approxeq y(t) + \frac{dy}{dt} dt
$$

which is a simple but not terribly useful way to solve equations when $\frac{dy}{dt}$ is some known function $f(y, t)$ and we know some initial condition $y(t_0) = y_0$.

This method can be improved in two ways:

  1. If it so happens that $\frac{d^2y}{dt^2}$ is also some known function $g(y, t)$, then we can use Taylor series approximation:
    $$
    y(t + dt) \approxeq y(t) + \frac{dy}{dt}dt + \frac{1}{2}\frac{d^2y}{dt^2}dt^2
    $$
  2. Use a better numerical method such as RK4.

My two quesitons are, which of these options will be more accurate, and, is there a way to combine the best of both worlds and incorporate knowledge of the second derivative to improve on the accuracy of RK4?

The practical situation that gives rise to the question was my attempt to simulate orbiting bodies with Newtonian physics, where the second derivative of position (acceleration due to gravity) is a trivial function of position. Using the simple approach with Taylor approximation can write, for position $\vec{r}$, velocity $\vec{v}$, and acceleration $\vec{a}$,
$$
\vec{v}(t_{n+1}) \approxeq \vec{v}(t_n) + \vec{a}(t_n)(t_{n+1} – t)
$$

$$
\vec{r}(t_{n+1}) \approxeq \vec{r}(t_n) + \vec{v}(t_n)(t_{n+1} – t) + \frac{1}{2}\vec{a}(t_n)(t_{n+1} – t)^2
$$

The appearance of the second derivative as a "bonus term" in the second equation makes it tempting to ask if some similar "bonus term" can be applied in the RK4 method or if there are other numerical methods that use the second derivative.

Best Answer

Yes, you can use the Generalized Midpoint Rule Formula to approximate the integral even better than "ordinary methods". It asks for infinitely many derivatives, but providing first and second order derivatives $(N=2)$ is already much better than the usual $N=0$ or $N=1$ methods.