Solution (source code)

= Solution

Parameterize the loop by $\mathbf r'=(a\cos\phi,a\sin\phi,0)$ and choose positive <electric current> counterclockwise as seen from $+z$. At the observation point $\mathbf r=(0,0,z)$,
$$
d\boldsymbol\ell'=(-a\sin\phi,a\cos\phi,0)\,d\phi,\qquad
\mathbf r-\mathbf r'=(-a\cos\phi,-a\sin\phi,z).
$$
The numerator of the <Biot-Savart law> is
$$
d\boldsymbol\ell'\times(\mathbf r-\mathbf r')
=(az\cos\phi,az\sin\phi,a^2)\,d\phi.
$$
The distance $\sqrt{a^2+z^2}$ is constant round the loop. The transverse terms integrate to zero, while the axial term integrates to $2\pi a^2$. Hence
$$
\boxed{\mathbf B(0,0,z)=\frac{\mu_0a^2I}{2(a^2+z^2)^{3/2}}\widehat{\mathbf z}.}
$$
For use below, define the undisturbed <magnetic field intensity> $H_0(z)=B_0(z)/\mu_0=a^2I/[2(a^2+z^2)^{3/2}]$. This distinguishes the applied field from the internal field after adding the magnetic sample.