Since the restoring spring force and displacement are linearly related as F = – kx, and are opposite in direction, the graph between F and x is a straight line with dwelling only in the second and fourth quadrant as shown in Figure. The elastic potential energy can be easily calculated by drawing a F – x graph. The shaded area (triangle) is the work done by the spring force.