When a spring is stretched, work is done on it. This energy is transferred to the elastic potential energy store of the spring. For a spring that obeys F = k × x, the energy transferred in stretching is given by
energy = 0.5 × spring constant × (extension)2, or E = ½ k x2.
Energy is in joules (J), the spring constant is in N/m and the extension is in metres. The extension is squared, so doubling the extension makes the energy four times bigger. Be careful to square the extension only, not the whole of k × x.
Worked example: a spring with a spring constant of 200 N/m is stretched by 0.05 m. The extension squared is 0.0025 m2, so E = 0.5 × 200 × 0.0025 = 0.25 J. For a spring with a spring constant of 50 N/m stretched by 0.08 m, E = 0.5 × 50 × 0.0064 = 0.16 J.