Solution (source code)

= Solution

Choose the <electric current> counterclockwise as viewed from $+z$; reversing it reverses the <magnetic field>. Parameterize the circular wire by
$$
\mathbf r'(\phi)=R(\cos\phi,\sin\phi,0),\quad d\mathbf l=R(-\sin\phi,\cos\phi,0)\,d\phi,\quad\mathbf s=(0,0,z)-\mathbf r'.
$$
The <cross product> in the <Biot-Savart law> is
$$
d\mathbf l\times\mathbf s=(Rz\cos\phi,Rz\sin\phi,R^2)\,d\phi,\qquad |\mathbf s|=\sqrt{R^2+z^2}.
$$
Consequently the transverse terms integrate to zero over $0\le\phi\le2\pi$, while the axial term is constant:
$$
\mathbf B(0,0,z)=\frac{\mu_0I}{4\pi(R^2+z^2)^{3/2}}\int_0^{2\pi}(Rz\cos\phi,Rz\sin\phi,R^2)\,d\phi.
$$
Thus
$$
\boxed{\mathbf B(0,0,z)=\frac{\mu_0IR^2}{2(R^2+z^2)^{3/2}}\widehat{\mathbf z}.}
$$
The direction is $+z$ on both halves of the axis for this <electric current> orientation, including $z<0$; it is not “away from the plane” on both sides. The <right-hand rule> gives the same direction.

\Image[/past-exam-of-the-physics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2022-q10-loop-axis.png]
{title=Direction of the axial <magnetic field> of a circular current loop, with counterclockwise <electric current> viewed from $+z$}