The negative sign in equation 2.8 tells you that the force exerted by the spring acts in the opposite direction from the deformation. If you stretch the extension spring in the diagram above, the deformation, x, is positive. The force is negative indicating that it is to the left, opposite the deformation. If the deformation is negative, to the left, then the force is positive, to the right. Be careful when using Hooke's law to use the proper sign for the deformation, x.
|