Energy Stored by an Inductor

The ideal inductor, like the ideal capacitor, does not dissipate the electrical energy supplied to it. It stores the energy in the form of a magnetic field. A plot of the voltage, current, and power to an inductor is shown in Fig. 1 during the buildup of the magnetic field surrounding the inductor.
Fig. 1: The power curve for an inductive element under transient conditions.
The energy stored is represented by the shaded area under the power curve. Using calculus, we can show that the evaluation of the area under the curve yields $$ \bbox[10px,border:1px solid grey]{W_{stored} = {1 \over 2} L I_m^2} \, \text{(joules)} \tag{1}$$ Let us go through step by step process to calculate eq. (1): $$ \begin{split} p(t) &= v(t)i(t)\\ p(t) &=(L{di(t) \over dt})(i(t))\\ \int_{-\infty}^t p(t) \,dt &= \int_{-\infty}^t (L{di(t) \over dt})(i(t)) \,dt\\ W_{stored} &= L \int_{-\infty}^t (i(t)) di \\ &= L {1 \over 2} i(t)^2 |_{-\infty}^t = {1 \over 2} L i(t)^2 |_{-\infty}^t \\ &= {1 \over 2} L (i(t)^2 - i(-\infty)^2) \\ &= {1 \over 2} L (i(t)^2 - 0)= {1 \over 2} L i(t)^2 \\ \end{split}$$ At the steady state condition, inductor is acting as short circuit therefore current i(t) can be replaced by current $I_m$.
Example 1: Find the energy stored by the inductor in the circuit of Fig. 2 when the current through it has reached its final value.
Fig. 2: For Example 1.
Solution: $$ \begin{split} I_m &= {E \over R_1 + R_2} \\ &= {15 \over 3Ω+2Ω}=3A\\ W_{stored} &= {1 \over 2} L I_m^2\\ &= {1 \over 2} (6 \times 10^{-3} H)(3 A)^2 = 27mJ\\ \end{split}$$