Work is defined as force times distance. Work is a measure of the energy expended in applying a force to move an object.B.8
The work required to compress a spring through a displacement of meters, starting from rest, is then
Work can also be negative. For example, when uncompressing an ideal spring, the (positive) work done by the spring on its moving end support can be interpreted also as saying that the end support performs negative work on the spring as it allows the spring to uncompress. When negative work is performed, the driving system is always accepting energy from the driven system. This is all simply accounting. Physically, one normally considers the driver as the agent performing the positive work, i.e., the one expending energy to move the driven object. Thus, when allowing a spring to uncompress, we consider the spring as performing (positive) work on whatever is attached to its moving end.
During a sinusoidal mass-spring oscillation, as derived in §B.1.4, each period of the oscillation can be divided into equal sections during which either the mass performs work on the spring, or vice versa.
Gravity, spring forces, and electrostatic forces are examples of conservative forces. Conservative forces have the property that the work required to move an object from point to point , either with or against the force, depends only on the locations of points and in space, not on the path taken from to .