In physics, mechanical work is done whenever a force moves through a distance. If the force is constant, then the work done is defined to be the product of the force times the distance through which the force moves. For example, a force of 5 lbs moving a box a distance of 3 ft does 15 ft-lbs of work.
If the force is not constant, the path through which it moves can be broken into small segments over which the force is essentially constant, and the sum of the products of force times displacement added via an integral. An example of this is the stretching of a spring that obeys Hooke's law, where the displacement is proportional to the applied force. If the force is and the displacement is , then , where , the constant of proportionality, is the spring constant that measures the stiffness of the spring. The work done by this force as it stretches the spring units beyond its natural length () is given by the integral . Example 5.8.1 and Example 5.8.2 are of this type.
In some cases where a varying force is considered constant over segments of the motion, the displacements for each such "constant" force itself varies. Again, the products of force times displacement are summed via an integral. Example 5.8.3 and Example 5.8.4 are of this type.