<p>(a) Obtain the expression for the magnetic energy stored in a solenoid in terms of magnetic field B, area A and length l of the solenoid. (b) How does this magnetic energy compare with the electrostatic energy stored in a capacitor ?</p>

<p>&nbsp;(b)&nbsp;Starting from the&nbsp;expression for the energy W =&nbsp;<span class="equation">\(\frac{1 }{2}LI^{2}\)</span>, stored in a solenoid of self-inductance L to build up the current I, obtain the expression for the magnetic energy in terms of the magnetic field B, area A and length l of the solenoid having n number of turms per unit length. Hence show that the energy density is given by&nbsp;<span class="equation">\(B^2l2\mu_{0}\)</span>​​​​​​​</p>