When compressing an ideal spring, work is performed, and this work is stored in the spring in the form of what we call potential energy. Equation (B.6) above gives the quantitative formula for the potential energy stored in an ideal spring after it has been compressed meters from rest.