Solution (source code)

= Solution

Dividing the two <velocities> gives
$$
\frac{dx}{dz}=\pm\frac{\sqrt{P^2-a^2x^4}}{ax^2},\qquad
\boxed{-X\le x\le X,\quad X=\sqrt{P/a}.}
$$
Here $\dot z=ax^2/m\ge0$: the orbit always advances toward increasing $z$, except for instantaneous zeros at each midplane crossing $x=0$. The transverse motion oscillates between $-X$ and $X$. At these outer turning points $\dot x=0$ and the <trajectory> is tangent to the $z$ direction; at the midplane $\dot x\ne0$ while $\dot z=0$, so the tangent is along $x$. The sign of the initial $\dot x$ only chooses the <phase> or reflected <trace>.

\Image[/past-exam-of-the-short-options-paper-shared-by-prelims-and-parts-a-and-b-of-the-physics-course-of-the-university-of-oxford/2018-magnetic-tail-trajectories.png]
{title=Crossing and separatrix orbits in a reversing magnetic field}
{description=The left panel shows the orbit with zero conserved axial canonical momentum, advancing monotonically in z. The right panel shows a positive-x separatrix with the negative extreme canonical momentum; its arrows and marked axial-velocity zeros distinguish it from an ordinary periodic orbit. Both panels use dimensionless coordinates.}