(a) For a solenoid of length l, area A and n turns per metre, L=μ0n2Al and B=μ0nI. So I=μ0nB and
U=21LI2=21(μ0n2Al)μ02n2B2=2μ0B2Al
The field fills the volume Al uniformly, so the energy per unit volume is
uB=AlU=2μ0B2
This form contains nothing about the solenoid, and it holds for any magnetic field.

(b)
uB=2×4π×10−7(1.5)2=9.0×105 J m−3
U=uBV=9.0×105×0.80≈7.2×105 J
That is 0.72 MJ, as much energy as a small car carries at motorway speed.
(c)
uE=21ε0E2=21(8.85×10−12)(3×106)2≈40 J m−3
uEuB≈409×105≈2×104
A magnetic field can store about twenty thousand times more energy per cubic metre than the strongest electric field air allows. This is why large amounts of energy are handled magnetically, in generators and in the iron cores of transformers.