Work done by a variable force
In this paragraph we calculate the work in a situation when the force causing displacement changes with the position of the object moved by this force. We restrict our considerations to changes of magnitude of the acting force, while its direction is constant. To make the calculations as clear as possible we assume that force and displacement are along the x axis of the coordinate system – Fig. 1

The force causing the displacement is different at each point along the x axis. Therefore we cannot calculate the work done from the formula
![]()
(1)
because the force is not constant along the displacement distance x. In Fig.1 we see that force has different magnitude at different positions. Generally the force can be a continuous function of position
(2)
We omitted vector notation because force and displacement have the same direction. The angle between them α=0, so cos(α) =1 and work is a simple product of magnitudes of force and displacement. The problem is that force has different magnitudes at different positions. The solution to this problem is as follows.
We divide displacement into very short segments Δx. We choose Δx small enough to assume that magnitude of force F(x) is constant over that interval. We denote by F(xi) the value of the force within the i-th interval. Then the work done by the force in the i-th interval can be then calculated from the formula
ΔWi = F(xi) Δx (3)
The total work done by the force as the object moves from position x1 to xn can be approximated by the formula
(4)
The exact value of the work done during the displacement form x1 to xn can be calculated as
(5)
and this is a definition of integral of the function F(x) between the limits x1 and xn. Therefore the total work done can be written as
(6)
A clear interpretation of the formula (6) can be presented with a graph of the force as a function of position. Graphs are often used as a very good help in understanding physics.

As an example for the graph we use force with magnitude proportional to the position x,
F = k x (7)
with k=1.0 N/m. For each interval of displacement one can calculate the average force acting in this interval
<F(xi)>=(F(xib)+F(xie))/2(8)
where F(xib) and F(xie) are magnitudes of force at the beginning ant at the end of the interval. Then the product
<F(xi)>Δx(9)
is approximately equal to, on the one hand - the work done within this interval, on the other hand – the area defined by x axis, the curve representing the function describing the force and two vertical lines at the beginning and end of displacement interval Δx. This area is depicted in Fig.2 by the rectangle filled with green lines.
The total work done define by formula (6) is simply the total area between the x axis from x1 to x7 and the line representing the force. From geometry point of view it is the area of a triangle defined by the above description.
Now we apply Eq.(6) to calculate the total work in the case depicted in Fig.2.
(10)
As k=1.0 N/m the units of our results are Newton times meter = Joul.
If you are not familiar with calculus, just believe me that the total work is equal 18.0 Jouls.
If you look at the graph on Fig.2 as a triangle, the area of this triangle is exactly 18 units used in the graph. And these units in our case are units of work – Jouls. In problems involving calculation of work done by variable force we will consider more examples of applying integrals and their geometrical interpretation.
