
Physics I course sequence · Interactive lesson
Work by a Variable Force
Hardly any force worth studying holds still while the object moves: a spring pulls harder the further it is stretched, gravity fades with altitude, trapped air pushes less as it expands. This is where force × distance gives way to an integral you can set up, evaluate, and read off a graph as signed area.
UPI-06.02 · Lesson 2 of 7 in this unit. Position is not a completion score.Build the model
When the force changes along the way, work is an area, not a product.
The key idea
The work done by a force whose component F(x) along a line changes with position is W = ∫ F(x) dx from the start position to the end position, which is the signed area under the force-position graph between them.
Example. Stretching a spring of k = 200 N m⁻¹ slowly from x = 0.10 m to 0.30 m, a hand's pull rises from 20 N to 60 N: W = ∫ 200x dx = 100(0.30² − 0.10²) = 8.0 J, the area of the trapezoid under the line.
The complete physical model and assumptions
W = F Δx holds only while the force holds still. When F changes with position, cut the displacement into slices thin enough that the force is nearly constant across each, give every slice its own F(xᵢ)Δx, and add. Thinner slices shrink the error, and the limit of the sum is the definite integral W = ∫ F(x) dx from x₁ to x₂: the signed area between the force-position curve and the x-axis. The signs look after themselves. A force component pointing toward −x is negative, and a trip toward −x runs the limits backwards, so no cos θ is added by hand. Two workhorse results follow at once: a spring does −½k(x₂² − x₁²), and inverse-square gravity does GMm(1/r₂ − 1/r₁), which collapses to −mgΔh only when the climb is small compared with r. Everything rests on one assumption: that the force is a function of position alone. Then the work depends only on where the motion starts and ends, and an out-and-back detour cancels exactly. Kinetic friction breaks that assumption, because it reverses whenever the motion does; so does a rubber band that pulls harder while stretching than while relaxing. Their force-position graphs are loops rather than curves, a round trip does work whose size is the area the loop encloses, and the work has to be added up leg by leg along what actually happened.
1Slice the displacement until the force holds still
Constant-force work is a multiplication, so make the force constant by force of numbers. A hand stretches a spring of k = 200 N m⁻¹ slowly from x = 0.10 m to 0.30 m, pulling with F(x) = 200x. Cut the 0.20 m into four slices of 0.05 m and freeze the force at the start of each: (20 + 30 + 40 + 50) N × 0.05 m = 7.0 J. Freeze it at the end of each instead: (30 + 40 + 50 + 60) N × 0.05 m = 9.0 J. The true work is trapped between the two. With 40 slices the sums are 7.9 J and 8.1 J: ten times as many slices, one tenth of the gap. The limit of the sum is the definite integral, and you never have to take it by brute force. Find any antiderivative of the force, a function A(x) with A′(x) = F(x); then W = A(x₂) − A(x₁). Here A(x) = 100x², so W = 100(0.090 − 0.010) = 8.0 J. For a constant force A(x) = Fx, and the integral hands back the familiar F(x₂ − x₁).
2Read the integral as signed area
Plot F against x and each slice F(xᵢ)Δx becomes a thin strip, so the integral is the area between the curve and the axis, measured on the axes' own scales in N × m = J rather than in squares of paper. For motion toward +x, strips above the axis add work and strips below subtract it. Let the spring itself act on a block moving from x = −0.10 m to +0.30 m, with F = −200x. The triangle above the axis, 0.10 m wide and 20 N tall, gives +1.0 J; the triangle below, 0.30 m wide and 60 N deep, gives −9.0 J; the net is −8.0 J, matching −½k(0.30² − 0.10²). The part from −0.10 m to +0.10 m cancels itself, which is why this equals the spring's work over 0.10 m to 0.30 m alone. Watch the running total too: W(x) = ∫ F dx from x₁ to x has slope dW/dx = F(x), so the accumulated work climbs while F is positive, reaches its peak of +1.0 J at x = 0 where the force changes sign, and falls from there.
3Let the limits carry the direction
On a line, F and dx are both signed numbers. Motion toward −x means every dx is negative, and the integral records that by running from a larger x₁ to a smaller x₂, with no cos θ required. Release a block from x = +0.30 m on the same spring. On the way to x = 0: W = −100(0² − 0.30²) = +9.0 J, positive because the force and the motion both point toward −x. Carrying on to x = −0.30 m: W = −100[(−0.30)² − 0²] = −9.0 J, negative because the force has turned round while the motion has not. One formula, fed the actual start and end positions, gets both legs right. The common slip is to write the force as its magnitude kx and pick a sign by eye: that works until the block crosses x = 0, where the force reverses and the eye usually does not. And because swapping the limits of an integral negates it, retracing a trip under a force that depends on x alone exactly undoes the work.
4Integrate the force laws you will actually meet
Three antiderivatives cover most first-year problems. For a spring, F = −kx, A(x) = −½kx², so W = −½k(x₂² − x₁²). For inverse-square gravity along a radius, Fᵣ = −GMm/r², A(r) = GMm/r, so W = GMm(1/r₂ − 1/r₁); with GM = gR², a climb h from Earth's surface gives W = −mgRh/(R + h). For h = 10 km that differs from −mgh by the factor R/(R + h) = 0.9984, a 0.16% correction that justifies constant g near the ground; by a 400 km orbit the gap has grown to about 6%. A power law F = cxⁿ integrates to c(x₂ⁿ⁺¹ − x₁ⁿ⁺¹)/(n + 1) for every n except −1, where the answer is a logarithm: air held at constant temperature in a cylinder pushes its piston with F = C/x, so W = C ln(x₂/x₁). In each case write the force as a signed component first, then integrate, and the sign of the result needs no further thought.
5When the force-position graph is a loop, the route matters
Everything so far assumed one force for each position. Then the work from x₁ to x₂ depends only on x₁ and x₂: an excursion out to x₃ and back adds an integral from x₂ to x₃ plus its exact negative, and any round trip does zero work. Kinetic friction breaks the assumption, because it points against the velocity rather than toward any place. Push a 20 kg crate (μₖ = 0.30) 3.0 m along a floor and back again: friction is −58.9 N on the way out and +58.9 N on the way back, so its force-position graph is a rectangle, not a curve, and the round trip does −58.9 N × 6.0 m = −353 J of work with zero displacement. That is minus the area of the loop, 117.7 N tall and 3.0 m wide. Rubber bands, tendons and shoe foams do the same more gently. They pull harder while being stretched than while relaxing, so the loading curve sits above the unloading one, and the area between them is the energy each cycle turns into heat.
6Check an integral before you trust it
Four quick tests catch most mistakes. Units: F in N times x in m must give J, and GMm/r has units N m² kg⁻² × kg² ÷ m = N m. Bounds: for motion toward +x the work lies between Fₘᵢₙ(x₂ − x₁) and Fₘₐₓ(x₂ − x₁), so the hand's 8.0 J on the spring must sit between 20 N × 0.20 m = 4.0 J and 60 N × 0.20 m = 12 J, and it does. Limits: shrink the displacement and W must approach F(x₁)Δx; shrink the climb and the exact gravity result must approach −mgh. Signs: ask whether the force points with or against the motion over most of the trip, and whether the result agrees. An answer that fails any one of these is wrong before you go hunting for the algebra slip. An answer that passes all four is not proven right, but whatever error remains is no longer a gross one.
Key equations
Read the units, assumptions and limits before substituting.
Work as the limit of thin slices
W = lim Σ F(xᵢ) Δx = ∫ F(x) dx, from x₁ to x₂
Each slice is a constant-force problem. The integral is what the sum becomes once the slices are thin enough that no slicing error is left.
F(x) is the force component along x, in N; x₁ and x₂ in m; W in J = N m; the limit takes every Δx → 0Signed area, and reversing the trip
W = (area above the axis) − (area below it) for motion toward +xW(x₂ → x₁) = −W(x₁ → x₂)
Motion toward −x is carried by the order of the limits. Inserting a cos 180° as well counts the reversal twice.
areas measured in N × m = J on the graph's own scales, and only between x₁ and x₂Spring force (Hooke's law)
F = −kx → Wspring = −½k(x₂² − x₁²)
Only the end positions enter. Moving away from x = 0 the spring does negative work; moving back toward it, the same amount of positive work.
k in N m⁻¹; x measured from the spring's natural length, in mInverse-square gravity along a radius
Fᵣ = −GMm/r² → Wgrav = GMm(1/r₂ − 1/r₁)
With GM = gR², a climb h from the surface gives W = −mgRh/(R + h): close to −mgh while h ≪ R, and smaller in size beyond that.
G = 6.674 × 10⁻¹¹ N m² kg⁻²; M and m in kg; r measured from the centre of M, in mAverage force over a displacement
Favg = [1/(x₂ − x₁)] ∫ F(x) dx, so W = Favg (x₂ − x₁)
For a linear F(x) it is the force at the midpoint: 40 N for the pull that rises from 20 N to 60 N. For a curved F(x), do the integral first.
Favg in N; defined only when x₂ ≠ x₁Round trips: zero, or the area of a loop
F depends on x alone: W(x₁ → x₂ → x₁) = 0otherwise the round-trip work = ± area inside the F–x loop
A position-only force returns on the way back exactly what it took on the way out. A force that depends on the direction of motion traces a loop instead.
area in N × m = J; kinetic friction traces a rectangle 2μₖN tallInteractive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. At the start the 4-strip sum is −4.00 J against an exact −8.00 J. Set N to 1, 2, 4 and 8 and the gap reads 16, 8, 4 and 2 J, halving each time N doubles. Then set x₁ = −0.30 m and x₂ = +0.30 m: the areas above and below the axis cancel, and the spring does no net work.
Live results
- EXACT WORK −½k(x₂² − x₁²)
- -8.00 J
- STRIP SUM Σ F Δx
- -4.00 J
- GAP k(x₂ − x₁)²/(2N)
- 4.00 J
- AVERAGE FORCE
- -20.0 N
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Start position x₁: −0.10 m; End position x₂: 0.30 m; Number of strips N: 4
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The tempting shortcut is W = F × d with the force read at a single point, usually the end: stretch a spring by x and the work is said to be kx × x = kx². That product is the area of a rectangle, and a rectangle is the graph of a force that held the value kx for the whole stretch. The spring's pull did not. It started at zero and grew in proportion to the stretch, so the area under its graph is a triangle with half the rectangle's area, and the work is ½kx². Reading the force at the start instead gives zero, just as wrong in the other direction. Whenever the force changes along the way, the only honest multiplication happens inside the integral, one thin slice at a time; a single product of force and distance is right only when the force-position graph is flat.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
A materials tester slowly compresses a foam block with a ram. As the compression x grows from 0 to 0.150 m, the foam pushes back with a force of magnitude cx², where c = 4.00 × 10³ N m⁻². Find the work done by the ram, its average force, and the share of the work done in the last third of the stroke.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 4 steps revealed.
- Slow compression means the ram's push just balances the foam, so Fᵣₐₘ(x) = cx², pointing along the motion. Units check: N m⁻² × m² = N.
- Integrate over the stroke: W = ∫ cx² dx from 0 to 0.150 m = c(0.150 m)³/3 = (4.00 × 10³)(3.375 × 10⁻³)/3 = 4.50 J.
- Average force: W/d = 4.50 J ÷ 0.150 m = 30.0 N. The force at full compression is c(0.150 m)² = 90.0 N, so the average is one third of the final value, not one half, because F ∝ x² is not linear.
- Last third of the stroke, from 0.100 m to 0.150 m: W = c(0.150³ − 0.100³)/3 = (4.00 × 10³)(3.375 − 1.000)(10⁻³)/3 = 3.17 J, which is 70% of the total. The area under the graph crowds into the end of the stroke, where the force is largest.
Answer. W = 4.50 J; the average force is 30.0 N, one third of the 90.0 N needed at full compression; the last 0.050 m of travel takes 3.17 J, 70% of the work.
MediumExample 2
An exercise band is stretched slowly by 0.400 m and then let back slowly. While it stretches, its pull is modelled as Fₒᵤₜ = kx with k = 150 N m⁻¹; while it relaxes, as Fback = kx²/d with d = 0.400 m, which agrees with Fₒᵤₜ at both ends of the stroke. Find the work done by the hand going out, the work done by the hand coming back, and the fraction of the input the band returns.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Moving slowly, the hand balances the band, so in both halves it pulls outward (+x) with a force equal to the band's pull. Going out, x runs from 0 to d: Wₒᵤₜ = ∫ kx dx = ½kd² = ½ × 150 × 0.400² = 12.0 J.
- Coming back, x runs from d to 0 under the smaller relaxing force: Wback = ∫ (kx²/d) dx from d to 0 = −kd²/3 = −150 × 0.160/3 = −8.00 J. The reversed limits supply the minus sign: the hand still pulls outward while it moves inward.
- The band starts and finishes at x = 0, yet the two legs do not cancel: over the cycle the hand does 12.0 J − 8.00 J = 4.00 J of net work.
- That 4.00 J is the area between the two curves, ∫ (kx − kx²/d) dx from 0 to d = kd²/6 = 150 × 0.160/6 = 4.00 J. The band's force depends on whether it is stretching or relaxing, not on x alone, so the round trip costs energy, which leaves as heat in the rubber.
- Fraction returned: 8.00 J ÷ 12.0 J = 0.667. The band gives back two thirds of the work put in and dissipates one third.
Answer. Out: +12.0 J; back: −8.00 J; the cycle costs the hand 4.00 J, the area of the loop, so the band returns 67% of the input.
HardExample 3
Air is trapped behind a piston of area 8.00 cm² in a cylinder closed at x = 0. With the piston at x = 4.00 cm the air is at 3.00 × 10⁵ Pa. The piston is eased outward so slowly that the air's temperature stays fixed and its push obeys F = C/x, while the atmosphere at 1.00 × 10⁵ Pa pushes inward on the other face. Find the work each does on the piston as it moves to x = 10.0 cm, and where their combined work would be largest.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Take +x outward. Boyle's law keeps pV fixed, so the air's force pA falls as 1/x with C = p₁Ax₁ = (3.00 × 10⁵ Pa)(8.00 × 10⁻⁴ m²)(0.0400 m) = 9.60 N m. The atmosphere gives a constant Fₐₜₘ = −p₀A = −(1.00 × 10⁵ Pa)(8.00 × 10⁻⁴ m²) = −80.0 N.
- Air: Wₐᵢᵣ = ∫ (C/x) dx from 0.0400 m to 0.100 m = C ln(0.100/0.0400) = 9.60 × ln 2.50 = 9.60 × 0.9163 = 8.80 J.
- Atmosphere: Wₐₜₘ = (−80.0 N)(0.100 m − 0.0400 m) = −4.80 J. Their combined work over the move is 8.80 J − 4.80 J = 4.00 J.
- Now let the end point X vary: W(X) = C ln(X/x₁) − p₀A(X − x₁). Its slope dW/dX = C/X − p₀A is the net force at X, so the combined work grows while that force points outward and peaks where it vanishes: X = C/(p₀A) = 9.60/80.0 = 0.120 m.
- At X = 0.120 m: W = 9.60 ln 3.00 − 80.0 × 0.0800 = 10.55 − 6.40 = 4.15 J. Beyond 12.0 cm the atmosphere pushes harder than the air, and every further centimetre takes work back.
Answer. Wₐᵢᵣ = +8.80 J and Wₐₜₘ = −4.80 J, combining to 4.00 J at 10.0 cm; the combined work peaks at x = 12.0 cm, where it is 4.15 J.
Quick check
Select an answer and explain it before checking.
Review & continue
The work done by a force whose component F(x) along a line changes with position is W = ∫ F(x) dx from the start position to the end position, which is the signed area under the force-position graph between them.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.
Optional supporting lessons
These chapter resources can help with earlier ideas; they are not additional required Physics I completion tasks.