Skip to main content

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.
Starting model: Work by a Variable ForceForce-position graph of a spring, F = −kx with k = 200 N m⁻¹. The arrow under the graph runs from x₁ = -0.10 m to x₂ = 0.30 m. Each of the 4 shaded strips is the force where its slice begins times the slice width, counted positive when that force points along the motion. Strip sum -4.00 J; exact work -8.00 J.spring F = −kx, k = 200 N m⁻¹: exact W = −8.00 J4-strip sum Σ F Δx = −4.00 JF (N)x = −0.30 mmotion x₁ → x₂x = +0.30 m
Start with a picture. Change the model in the lab below.
1

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.

2

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 → 0

Signed 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 m

Inverse-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 m

Average 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 tall
3

Interactive lab

Predict first. Explore the model. Compare the result.

Explore the model

−0.10 m
−0.3 to 0.3 m; steps of 0.05.
0.30 m
−0.3 to 0.3 m; steps of 0.05.
4
1 to 8; steps of 1.

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.

Interactive Physics I modelForce-position graph of a spring, F = −kx with k = 200 N m⁻¹. The arrow under the graph runs from x₁ = -0.10 m to x₂ = 0.30 m. Each of the 4 shaded strips is the force where its slice begins times the slice width, counted positive when that force points along the motion. Strip sum -4.00 J; exact work -8.00 J.spring F = −kx, k = 200 N m⁻¹: exact W = −8.00 J4-strip sum Σ F Δx = −4.00 JF (N)x = −0.30 mmotion x₁ → x₂x = +0.30 m
Force-position graph of a spring, F = −kx with k = 200 N m⁻¹. The arrow under the graph runs from x₁ = −0.10 m to x₂ = 0.30 m. Each of the 4 shaded strips is the force where its slice begins times the slice width, counted positive when that force points along the motion. Strip sum −4.00 J; exact work −8.00 J.

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

Baseline −0.10; choose −0.3 to 0.3, in steps of 0.05.
4. Compared with the saved baseline, this result will…

This experiment is kept only while this page is open. It does not change saved course progress.

4

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.

5

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.

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.

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.

6

Quick check

Select an answer and explain it before checking.

A payload of mass m climbs straight up from Earth's surface (radius R) to an altitude equal to R. Taking g as its surface value, how much work does Earth's gravity do on the payload during the climb?
7

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.

Extra challenging questions

Connect several ideas, explore supplied data, and compare your reasoning with a worked solution.