Work Done by a Variable Force
When the force changes as the object moves, you can't just multiply force by distance. Instead, slice the motion into pieces of width \(dx\) where the force is nearly constant, do \(F(x)\,dx\) on each, and integrate: \(W=\int_a^b F(x)\,dx\) — force-times-distance, summed one slice at a time.
By the end you'll be able to compute the work to stretch a spring using Hooke's law and to pump liquid out of a tank, by setting up the right slice-by-slice integral for each.
Predict: stretching a spring twice as far — from 0.10 m to 0.20 m — does the work double or quadruple? Drag the sweep slider all the way right and watch the shaded area to check.
The chart plots the force curve — how hard each meter of motion is. The sweep point marks the current slice, and the shaded area behind it is the work accumulated so far. Toggle to the tank to see the exact same picture with a different force: each slab's weight times how far it must be lifted.
W(0 → 0.100 m) = ½ · 100 · 0.100² = 0.500 J · force at the sweep point: F = 10.0 N
Work done by a variable force is \(\int F(x)\,dx\); problems such as stretching a spring or pumping liquid from a tank are set up by integrating force-times-distance over infinitesimal slices.
Read work as area under the force curve. A thin strip of the F–x graph at position \(x\) has width \(dx\) and height \(F(x)\), so its area \(F(x)\,dx\) is exactly the work done over that sliver of motion. Sweeping from \(a\) to \(b\) tiles the region under the curve with these strips — the total work is the total area, \(W=\int_a^b F(x)\,dx\). That's precisely the area-under-a-curve picture you already know, wearing a physics costume: for Hooke's law the region is a triangle, which is why \(\int_0^b kx\,dx = \tfrac{k}{2}b^2\) — half base times height, \(\tfrac12 \cdot b \cdot kb\).
Two setups cover most exam problems. Springs: Hooke's law says \(F(x)=kx\) N/m-style, where \(x\) is the stretch past natural length, so \(W=\int_a^b kx\,dx=\tfrac{k}{2}(b^2-a^2)\) J. Tanks: slice the liquid into horizontal slabs. A slab at depth \(x\) with cross-sectional area \(A(x)\) and thickness \(dx\) has weight \((\text{weight-density})\,A(x)\,dx\) — where weight-density is \(\rho g\), about \(9800\) N/m³ for water — and must be lifted a distance \(h(x)\) to the discharge point. So \(W=\int_a^b (\text{weight-density})\,A(x)\,h(x)\,dx\). Different force, same slice recipe.
A cylindrical tank of radius \(2\) m and height \(5\) m is full of water (weight-density \(9800\) N/m³) and pumped out over the top. Measure \(x\) as depth below the top, \(0\le x\le 5\). Every slab has area \(A(x)=\pi(2)^2=4\pi\) (constant — it's a cylinder) and must rise a distance \(h(x)=x\) to reach the rim. So \[W=\int_0^5 9800\cdot 4\pi\cdot x\,dx = 39200\pi\left[\frac{x^2}{2}\right]_0^5 = 39200\pi\cdot 12.5 = \mathbf{490000\pi\ \text{J}} \approx 1.539\times 10^6\ \text{J}.\] Notice the bottom slab travels 5 m but the top slab barely moves — that's why the lift distance \(x\) must live inside the integral.
A spring has stiffness \(k = 200\) N/m. Set up the work to stretch it from natural length to \(0.05\) m beyond: \(W=\int_0^{0.05} 200x\,dx = 100x^2\Big|_0^{0.05} = 100\cdot(0.05)^2 = \) ____
Reveal the answer
\(W = 100\cdot 0.0025 = \) 0.25 J — matching the shortcut \(\tfrac{k}{2}b^2 = \tfrac{200}{2}(0.05)^2 = 0.25\) J. Set k = 200 on the stiffness slider above and sweep to 0.05 m to watch the shaded triangle reach this value.
More info — one slice recipe, and the classic traps
Every work problem is the same three-step recipe you used for areas and volumes: pick a slicing variable, write what happens on ONE thin slice (here: force × distance for that slice), then integrate. The traps are all in step two. First, the lifting distance \(h(x)\) depends on where you measure \(x\) from — depth below the top gives \(h(x)=x\) for an over-the-top discharge, but height above the bottom gives \(h(x)=5-x\) for the same tank; both integrate to the same answer only if each is paired with its own datum. Second, \(A(x)\) is constant only for cylinders — for cones or spheres you must re-derive the slab's area from geometry at each depth. Third, weight-density \(\rho g\) already includes gravity, so don't multiply by \(g\) a second time. For more practice on both setups, work through the Paul's Online Math Notes page linked in Dive deeper below.
Check your understanding
A spring has stiffness \(k = 100\) N/m. How much work does it take to stretch it \(0.1\) m beyond its natural length?
A full cylindrical tank of radius 2 m and height 5 m is pumped out over the top. The liquid's weight-density is \(9800\) N/m³. What is the total work?
You stretch a spring from its natural length to \(b\), then (starting over) to \(2b\). Compared with the first stretch, the work for the second is —
Two springs are stretched from \(x=0\) to \(x=0.2\) m: a stiff one with \(F_1(x)=300x\) and a soft one with \(F_2(x)=100x\) (newtons). On the F–x graph, the EXTRA work for the stiff spring is the area between the two force lines. What is it?
Recap
- Work by a variable force: \(W=\int_a^b F(x)\,dx\) — approximate force-times-distance on a thin slice, then integrate. Graphically, work is the area under the F–x curve.
- Springs (Hooke's law): \(F(x)=kx\) for stretch \(x\) past natural length, so \(W=\int_a^b kx\,dx=\tfrac{k}{2}(b^2-a^2)\). Doubling the stretch quadruples the work.
- Tank pumping: \(W=\int_a^b (\text{weight-density})\,A(x)\,h(x)\,dx\) — each slab's weight times its own lift distance \(h(x)\).
- Pitfalls: \(h(x)\) depends on where \(x=0\) sits and where the liquid discharges; \(A(x)\) varies with depth for non-cylindrical tanks; weight-density already includes \(g\) — don't multiply by it twice.
Dive deeper
- Paul's Online Math Notes — Work Practice additional spring and tank-pumping work problems.
Sources
- Work Done by a Variable Force