Now what if the force is variable, that is it depends on
position? For example, for a spring , so the
value of the force is not constant but depends
on position. Can we figure out what the work was in this
case? Of course, I wouldn't have mentioned otherwise.
So look at the diagram below. We're applying a force to the
spring in order to move it from position to
.
The red curve is the force as a function
of position .
Let's calculate the total work in going from
to
.
Well we know how to get the answer if the force is
constant, but here its clearly varying. So we'll try
to get an approximate answer by replacing the smooth
curve in red by a the staircase shown in blue. We're
replacing it with this because we know how to calculate
the work in going along one of the steps. In the diagram
we see the work done in going along between
and
can be calculated because the force is constant in that interval.
It's just
. So to get the total work we have
to sum up over all these intervals:
![]() |
(1.5) |
Now we'll do the old calculus trick of taking the limit as
. In this limit we get an integral
so the work becomes
This can be interpreted, as usual, as the area under the curve
.
In the case of the spring, the force so the work
done by the spring in moving an object from
to
is