Electromagnetic waves

starting from the expression for the energy W=1/2(LI^(2)) stored in a solenoid of self induction L to build up the current I obtainthe expression for magnetic energy in terms of B