The elastic potential energy stored in a spring of spring constant k when compressed by a distance x is:
1/2kx²
When a spring of spring constant \(k\) is compressed (or stretched) by a distance \(x\) from its natural length, the elastic potential energy stored in it is:
\(U = \dfrac{1}{2}kx^{2}\)
This follows from the work done against the spring force, which increases linearly with displacement, so the stored energy is proportional to the square of the compression with a factor of one-half.