You are not calculating what you think you are. You would normally use definite integrals to see the work done over a time period. An indefinite integral doesn't really make much physical sense.
The original equation of the energy in a capacitoran inductor can be derived as the integral of the power needed to go from a 0 current to the final current I in some time T:
\$ Energy Stored = \int^T_0{P\cdot dt} = \int^I_0{L i'di'} = \frac{1}{2}LI^2\$
There is an important lesson here. This is solvable with general variables. This is possible because it doesn't matter how you get to a current of I, the same energy must be invested to get there.
If you go from 0A to 3A to 2A to 5A in some crazy complicated fashion, the expended energy will be the same as if you went linearly from 0A to 5A in 1 second.
If this weren't true, then it wouldn't make sense to talk about the energy stored in an inductor "at a particular current." You would have to know how you got there to know the answer.