Draw the free-body diagram and write the corresponding elemental equation for a spring element with the following definitions:
Spring moves horizontally. Compression force in the spring is considered positive. Displacement of the left end of the spring, x1, is considered positive to the left, while that of the right end, x2, considered positive to the right. Confirm the correctness of your equation with two examples. The example should show that your elemental equation produces a positive (negative) force when the spring is in compression (elongation) with some x1 and x2 combinations. One example for stretch and one for compression.