Solution (source code)

= Solution

The <Lorentz force> is $\mathbf F=q(\mathbf E+\mathbf v\times\mathbf B)$. With no <electric field>, the exact nonrelativistic component equations for the given quadrupole are
$$
m\ddot x=-qA\dot z\,x,\qquad m\ddot y=qA\dot z\,y,\qquad m\ddot z=qA(x\dot x-y\dot y).
$$
The magnetic <force> does no work, so the total speed stays constant. In the <paraxial approximation>, $\dot z\simeq v$ and its small change is second order in the transverse motion. For $q>0$, put $\kappa=\sqrt{qA/(mv)}$. Initial travel parallel to the $z$ axis means zero entrance slopes, yielding
$$
\boxed{x(z)=x_0\cos(\kappa z),\qquad y(z)=y_0\cosh(\kappa z).}
$$
Thus $x$ is focused while $y$ is defocused. The first focus in the focusing plane occurs at
$$
\boxed{z_f=\frac\pi{2\kappa}=\frac\pi2\sqrt{\frac{mv}{qA}}.}
$$
For negative $q$, interchange the focusing and defocusing planes and use $|q|$ in $\kappa$. A single <quadrupole magnet> gives a line focus of a general beam, not simultaneous focusing of both transverse coordinates onto one point. The magnet must extend at least to the computed focus, and the slopes must remain small. For a relativistic beam, the corresponding paraxial factor is $\kappa^2=|q|A/p$, with $p$ the longitudinal <relativistic momentum>.

\Image[/past-exam-of-the-physics-2-paper-of-the-university-of-oxford/2016-resit-quadrupole-ray-bundles.png]
{title=Parallel incident rays focus in one quadrupole plane and spread in the other; the first focus is at kappa z equal to pi over two}