Solution (source code)

= Solution

Assume the <electrical conductor> is nonmagnetic, with <magnetic permeability> $\mu_0$, and neglect end effects. <Rotational symmetry> and <translational symmetry> make the <magnetic flux density> azimuthal and constant along a coaxial circle. The <magnetostatic Ampère law> therefore gives
$$
2\pi rB(r)=\mu_0 I_{\rm enc}(r).
$$
Uniform <current density> is $j=I/(\pi a^2)$, so $I_{\rm enc}(r)=j\pi r^2=Ir^2/a^2$. Thus
$$
\boxed{B(r)=\frac{\mu_0 I r}{2\pi a^2}\quad(0\leq r\leq a).}
$$
The direction follows the <right-hand rule> around the <electric current>. For a uniform linear magnetic material, replace $\mu_0$ by its <magnetic permeability>.