Stretching a spring needs a force to act over a distance, so work is done on the spring. If the spring is deformed elastically, this energy is stored as elastic potential energy and is released when the spring goes back to its original length. The energy transferred is found with the equation energy = ½ × spring constant × extension2, or E = ½ × k × e2. Energy is in joules, J, spring constant in N/m and extension in metres.
Because the extension is squared, doubling the extension multiplies the energy by four. Worked example: a spring with k = 80 N/m is stretched by 0.05 m. The extension squared is 0.0025, so E = ½ × 80 × 0.0025 = 0.1 J.
You can also find the work done from a graph. The work done is the area under the force-extension graph. For a linear spring the area is a triangle, so the work done is half × force × extension. For a non-linear system, such as an elastic band, you can find the work done by counting squares under the curve.