Second order differential equations are very common in science and engineering applications. Higher order initial value problems are easily solved using an extension of the first order methods described above. A simple substitution reduces them to a system of first order equations.
For example, in classical mechanics a particle of mass is
subjected to a force depending on its position, velocity,
and the time. Initial conditions specify the position and
velocity . Its acceleration is given by
The leapfrog method is a second-order method applicable when the
force term does not depend on velocity. It is based on a general
central difference representation of the derivative:
The leapfrog method starts by taking a half-step in :
With the central difference the local truncation error is . Since these steps are repeated times, the global error is . The initial and final half steps are simple Euler steps with an error also , but there are only two of them, regardless of . So the leapfrog method is second order.