Starting from the expression for the energy W = (1/2)LI2, 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 I of the solenoid having n number of turns per unit length. Hence show that the energy density is given by B2/2μ0.