energy stored in an inductor
Your derivation gives the change of stored energy between t0 and t. But the "final" value of stored energy is still \$W = L \cdot i_{pk}^2/2\$ since the inductor has no energy stored in its magnetic field (because the initial current is zero since no voltage is applied) when before the voltage is applied. Once the voltage has been applied the current starts to ramp up from zero to its peak value according to \$V = L\cdot di/dt\$.