Solution (source code)

= Solution

Let the step be $h$. Forward <Euler method> gives $x_1=x_0+hv_0$, $v_1=v_0+hF(x_0)$. Applying the same map with $-h$ gives $x_2=x_1-hv_1=x_0-h^2F(x_0)$, which generally differs from $x_0$. It is therefore not its own inverse under time reversal.

A kick–drift–kick <leapfrog integrator> instead has
$$
v_{1/2}=v_0+\frac h2F(x_0),\quad x_1=x_0+hv_{1/2},\quad v_1=v_{1/2}+\frac h2F(x_1).
$$
The step $-h$ first recovers $v_{1/2}$, then $x_0$, then $v_0$, so $\boxed{\Phi_{-h}=\Phi_h^{-1}}$. This assumes a position-dependent <force> and the same fixed step. <Newtonian mechanics> is reversible; respecting that structure helps avoid artificial directional bias and often improves long-term qualitative behaviour. The usual leapfrog also has a structure preserving <symplectic geometry>, which supports bounded oscillatory <energy error>, but reversibility by itself does not imply exact <conservation of energy>. Adaptive stepping requires special care to preserve these properties.