Energy behaviour of the Boris method for charged-particle dynamics

The Boris algorithm is a widely used numerical integrator for the motion of particles in a magnetic field. This article proves near-conservation of energy over very long times in the special cases where the magnetic field is constant or the electric potential is quadratic. When none of these assumptions is satisfied, it is illustrated by numerical examples that the numerical energy can have a linear drift or its error can behave like a random walk. If the system has a rotational symmetry and the magnetic field is constant, then also the momentum is approximately preserved over very long times, but in a spatially varying magnetic field this is generally not satisfied.