The spring potential energy U (written as Us if it needs to be distinguished from other forms of potential energy) is one-half the spring constant k times the square of the amount of spring stretch or compression x.

 

 

Pitfall Avoidance Notes: x is not the length of the spring. In the case of an object on the end of a spring, x is the distance of the object from its equilibrium position where the equilibrium position is the position when the spring is neither stretched nor compressed.