Solution (source code)

= Solution

Use the <geometric cross-section> shown in the source: the outer <cylinder> has radius $2a$ and centre $O$, and the circular cavity has radius $a$ and centre $C=a\hat{\mathbf x}$. Let the <electric current> be in the $+z$ direction. The conducting <cross-sectional area> is $3\pi a^2$, so the uniform <electric current density> is $\mathbf J=I\hat{\mathbf z}/(3\pi a^2)$.

To obtain the <exterior magnetic field of a wire with an eccentric cylindrical cavity>, apply the <superposition principle> to a full <cylinder> of <electric current density> $\mathbf J$ centred at $O$ and a second <cylinder> of <electric current density> $-\mathbf J$ centred at $C$. Their <electric currents> are $4I/3$ and $-I/3$. This reproduces the actual <electric current density> everywhere, including zero in the cavity. Outside a long circular <cylinder>, <Ampère's law> gives $\mathbf B=\mu_0 I_{\rm cyl}\hat{\mathbf z}\times\mathbf r/(2\pi r^2)$. Every point outside the outer boundary is outside both component <cylinders>. Consequently, writing $\mathbf r=x\hat{\mathbf x}+y\hat{\mathbf y}$,
$$
\boxed{\mathbf B(x,y)=\frac{\mu_0I}{6\pi}\hat{\mathbf z}\times\left(\frac{4\mathbf r}{r^2}-\frac{\mathbf r-a\hat{\mathbf x}}{|\mathbf r-a\hat{\mathbf x}|^2}\right),\qquad r\geq2a.}
$$
In <Cartesian coordinates>, the same <magnetic flux density> is
$$
B_x=\frac{\mu_0I}{6\pi}\left(-\frac{4y}{x^2+y^2}+\frac{y}{(x-a)^2+y^2}\right),\qquad B_y=\frac{\mu_0I}{6\pi}\left(\frac{4x}{x^2+y^2}-\frac{x-a}{(x-a)^2+y^2}\right),\qquad B_z=0.
$$
The cavity breaks <rotational symmetry>. Thus the <magnetic flux density> is generally neither constant in magnitude nor tangential on a circle centred at $O$; replacing its <line integral> by $2\pi rB$ would be unjustified. Its <line integral> is nevertheless $\mu_0I$, as <Ampère's law> requires. At <distances> $r\gg a$, the leading term becomes $\mu_0I\hat{\boldsymbol\phi}/(2\pi r)$, with corrections of order $\mu_0Ia/r^2$.

\Image[/past-exam-of-the-physics-2-paper-of-the-university-of-oxford/2015-eccentric-current-field.png]
{title=Exterior magnetic flux density from the two-cylinder superposition}