Sub topic 13
Work done by a variable force
This chapter assumes you know the work done by a constant force, the dot product, and how to integrate simple functions such as powers of x. Here the force changes with position, so a single product F·d no longer works.
From constant to variable force
For a constant force along a straight line, W = F d. When F depends on position x, split the path into tiny steps dx. Over each step the force is almost constant, so the work is dW = F(x) dx. Adding all the steps gives
W = ∫ F(x) dx, from x₁ to x₂.
In three dimensions, W = ∫ F · dr. Only the component of force along the displacement contributes.
The work equals the area under the F–x graph. Area above the axis counts as positive work. Area below the axis counts as negative work.
Worked example: a spring
A spring with constant k pulls back with force F = −kx when stretched by x. You pull it from x = 0 to x = x₀. Your force is +kx, so
W = ∫ kx dx from 0 to x₀ = ½ k x₀².
The spring itself does −½ k x₀² of work on you. If you stretch the spring from x₁ to x₂, the work you do is ½ k (x₂² − x₁²).
Worked example: a force given by a formula
A force F = (3x² + 2) N acts on a body along the x-axis. Find the work from x = 1 m to x = 3 m.
The code below computes the same integral numerically with the trapezoid rule and checks it against the exact answer.
def force(x):
return 3 * x**2 + 2
def work_trapezoid(f, x1, x2, n=1000):
h = (x2 - x1) / n
total = 0.5 * (f(x1) + f(x2))
for i in range(1, n):
total += f(x1 + i * h)
return total * h
exact = (3**3 + 2 * 3) - (1**3 + 2 * 1) # antiderivative x^3 + 2x
print(work_trapezoid(force, 1, 3), exact)The exact value is [x³ + 2x] from 1 to 3 = 33 − 3 = 30 J. The numerical result is very close to 30.
Common errors
- Using W = F d with the final value of F. This is only valid if F is constant.
- Ignoring signs. When the force points opposite to the motion, the integral is negative.
- Forgetting that the area below the axis on an F–x graph subtracts from the total.
- Mixing limits. The limits are positions, not times.
Link to what comes next
The work done by a variable force is the quantity that the work-energy theorem equates to the change in kinetic energy. The theorem is the next chapter.
Exercise
A force F = (4x − 6) N acts on a body along the x-axis. Find the work done from x = 0 to x = 3 m. Explain the sign of your answer.
Show answer
W = ∫ (4x − 6) dx from 0 to 3 = [2x² − 6x] from 0 to 3 = 18 − 18 = 0 J. The force is negative (opposing motion) for x < 1.5 m and positive for x > 1.5 m. The negative work from 0 to 1.5 m is −4.5 J and the positive work from 1.5 m to 3 m is +4.5 J, so they cancel.
Exercise
An F–x graph shows a force rising linearly from 0 N at x = 0 to 10 N at x = 4 m, then staying constant at 10 N until x = 6 m. Find the total work.
Show answer
The first part is a triangle: ½ × 4 × 10 = 20 J. The second part is a rectangle: 10 × 2 = 20 J. The total work is 40 J.