We use a standard right handed coordinate system $$\left( {r,\phi ,z} \right)$$
Since the current is entirely axial, the Boit-savart law implies that $${B_z} = 0$$ every where
Symmetry consideration require that the $$r$$ and $$\phi $$ components of $$B$$ depends upon
$$r:B={ B_{ r } }\left( r \right) \hat { r } +{ B_{ \phi } }\left( r \right) \hat { \phi } $$
Now apply Gauss's law for magnetic field to the coaxial cylindrical surface $$S$$, which has length $$l$$ and radius $$r$$
$$0 = \int_S {B.da = {B_r}\left( r \right)2\pi rl} $$
Therefore, $${B_r}\left( r \right) = 0$$
Amper's law to coaxial circular path $$C$$
$$\oint_c {B.dI = 2\pi r{B_\phi }\left( r \right) = {\mu _0}i\left( r \right)} $$ $$........(1)$$
Here $$i(r)$$ is the current passing through the surface enclosed by $$C$$
Since, the current density is uniform we have,
$$\begin{array}{l} \frac { { i\left( r \right) } }{ i } =\frac { { \pi { r^{ 2 } } } }{ { \pi { a^{ 2 } } } } \\ i\left( r \right) =\frac { { { r^{ 2 } }i } }{ { { a^{ 2 } } } } \end{array}$$ $$...(2)$$
Equation $$1$$ and $$2nd$$ implies that
$${B_\phi }\left( r \right) = \frac{{{\mu _0}ir}}{{\left( {2\pi {a^2}} \right)}}$$
Now integrate the magnetic energy density over the volume of the wire. The magnetic energy $$d{U_m}$$ contained in the cylindrical shell of length $$1$$, inner radius $$r$$ and outer radius $$r+dr$$ is
$$\begin{array}{l} d{ U_{ m } }={ \in _{ m } }UV=\frac { { { B_{ \phi } }^{ 2 }\left( r \right) } }{ { 2{ \mu _{ 0 } } } } 2\pi r1dr \\ =\frac { { { \mu _{ 0 } }{ i^{ 2 } }1 } }{ { 4\pi { a^{ 4 } } } } { r^{ 3 } }dr \end{array}$$
Hence, the magnetic energy per unit length contained in the wire is
$$\frac{{{U_m}}}{1} = \frac{1}{1}\int {d{U_m} = \frac{{{\mu _0}{i^2}}}{{4\pi {a^4}}}\int_0^a {{r^3}dr = \frac{{{\mu _0}{r^2}}}{{4\pi {a^4}}}\left( {\frac{{{r^4}}}{4}|_0^a} \right)} } $$
$$ = \frac{{{\mu _0}{i^2}}}{{16\pi }}$$
Hence, Option B is the correct answer.