This applet shows an object on a spring. The vertical dashed gray line shows the natural state of the spring (where it is not moving and no forces are acting upon it). This can be adjusted with the slider on the top right (labeled "natural"). Drag the blue dot to move the object. You can show the force of the spring acting on the object (green), and the force required to hold the object in place (red). If these are in balance, then they both have magnitude [math]F=kx[/math]. To calculate the work done to move the object, we use [math]\int_{x=a}^{x=b} F(x) dx[/math].