# What happens to the $O(\cdot)$ terms when we implement the Leapfrog Integration algorithm in a programming language?

The Verlet leapfrog algorithm is an economical version of the basic algorithm, in that it needs to store only one set of positions and one set of velocities for the atoms, and is even simpler to program.

The equations defining this algorithm are as follows:

• $${{v_{{n}+{\frac{1}{2}}}}} = v_{{n}-{\frac{1}{2}}} + \frac{f_n}{m} \triangle t + \mathcal{O} (\triangle t^3)$$
• $$r_{{n}+{1}} = r_{{n}} + v_{n + \frac{1}{2}} \triangle t + \mathcal{O} (\triangle t^4)$$
• $$v_n = \frac{1}{2} \left[ v_{n + \frac{1}{2}} + v_{n=\frac{1}{2}} \right] + \mathcal{O} (\triangle t^2)$$

What happens to the $$O(\cdot)$$ terms when we implement the Leapfrog Integration algorithm in a programming language?

It is not really wrong, but it is bad notation. It tries to combine the description of the numerical method, which is indeed implemented without the error terms, with the truncation error of the steps. For the truncation error formulas one would interpret $$r_i=r(t_i)$$, $$v_i=v(t_i)$$ for some exact solution $$r,v=r'$$ with $$mv'=f(r)$$.
Whether the order in the second equation is correct depends on what $$v$$ is for the exact solution. If $$v=r'$$, then the order has to be 3. I can not imagine an interpretation of $$v$$ (that is also independent of $$\Delta t$$) that would let that formula inherit the error order 4 of the divided difference formula.