Self inductance of a coil is equal to the magnitude of induced emf produced in the coil when rate of change of current through the coil is unity.
Φ=LI
e=−dΦdt
e=−LdIdt
For the current I at an instant in a circuit, the rate of work done is dWdt=|e|I =LIdIdt
Total work done in increasing the current from 0 to I is given by W=∫I0LIdIW=L[I22]I0W=12LI2
This work done is stored as magnetic potential energy. U=12LI2