18. Work, force, and hydrostatic pressure
Physics defines work as force times distance — but that formula assumes the force stays constant while the object moves. The moment force varies along the path, "force times distance" stops making sense as a single multiplication and becomes, once again, a job for the integral: chop the path into pieces short enough that force is nearly constant on each one, sum the tiny contributions, take the limit.
Work with a variable force
If a force F(x) acts along the x-axis, moving an object from x=a to x=b, then over a tiny displacement dx the force is approximately constant, contributing dW=F(x)\,dx. Summing:
W=\int_a^bF(x)\,dx
Hooke's law gives the canonical variable force: a spring stretched (or compressed) x from its natural length pulls back with force F(x)=kx, k the spring constant. Work to stretch it from 0 to d:
W=\int_0^dkx\,dx=\frac12kd^2
The \frac12 is the same \frac12 that appears in every "area of a triangle" or "\frac12mv^2" formula — it's what happens whenever you integrate something that grows linearly from zero.
Pumping liquid out of a tank
A less obvious variable-force problem: pump all the water out of a tank, over the top. Different layers of water travel different distances — a layer near the top has only a short way to go, a layer near the bottom has to travel the whole height — so the "distance" itself varies, not just the force.
Slice the tank into thin horizontal layers at height y, thickness dy. A layer of cross-sectional area A(y) has volume A(y)\,dy, weight w\cdot A(y)\,dy (where w is the liquid's weight density — weight per unit volume, e.g. 9800\text{ N/m}^3 for water), and must travel a distance d(y) up to the rim. Its contribution to the total work:
dW=w\cdot A(y)\cdot d(y)\,dy\qquad\Longrightarrow\qquad W=\int w\,A(y)\,d(y)\,dy
Every pumping problem is this same setup with different A(y) and d(y) — identify the layer's area and how far that particular layer must travel, and the integral writes itself.
Hydrostatic force on a submerged surface
Pressure — force per unit area — grows with depth: P(x)=w\cdot x, where x is depth below the surface. A flat plate submerged vertically experiences different pressure at every depth, so summing (pressure) \times (area of a horizontal strip) over the plate is another integral, exactly like the pumping setup:
F=\int_0^Hw\cdot x\cdot\ell(x)\,dx
where \ell(x) is the width of the plate at depth x, and H is the total submerged depth. This is the same "slice, multiply, integrate" pattern as everything else in this module — here the varying quantity is pressure instead of force or radius, but the integral doesn't care what the varying quantity means physically.
Doing it in Python
Spring work, Hooke's law:
import sympy as sp
x = sp.Symbol('x')
k, d = 200, sp.Rational(1, 10) # N/m, meters
W = sp.integrate(k * x, (x, 0, d))
print(f"work to stretch a k={k} N/m spring by {float(d)} m = {W} J")
Hydrostatic force on a rectangular plate, submerged vertically, top at the surface:
import sympy as sp
x = sp.Symbol('x')
w_density = 9800 # N/m^3, water
width, depth = 4, 3 # meters
F = sp.integrate(w_density * width * x, (x, 0, depth))
print(f"hydrostatic force on a {width}m-wide plate, {depth}m deep = {F} N")
Pumping water out of a cylindrical tank — radius 2 m, height 4 m, full, water pumped over the rim:
import sympy as sp
y = sp.Symbol('y')
r, h, rho = 2, 4, 9800
# layer at height y has area pi*r^2 and must travel (h - y) to reach the rim
W = sp.integrate(rho * sp.pi * r**2 * (h - y), (y, 0, h))
print(f"work to pump the tank empty = {W} J ~= {float(W):.0f} J")
Worked example
A rectangular dam gate is 4 m wide and submerged vertically with its top at the water's surface and its bottom 3 m down. Find the hydrostatic force on it. (Weight density of water: 9800\text{ N/m}^3.)
The plate's width is constant (\ell(x)=4 for every depth x), so:
F=\int_0^3(9800)(4)x\,dx=39200\int_0^3x\,dx=39200\left[\frac{x^2}2\right]_0^3=39200\cdot\frac92
=\boxed{176{,}400\text{ N}}
Sanity check. The average pressure over the plate (pressure at the mid-depth, x=1.5: 9800\times1.5=14{,}700\text{ Pa}) times the plate's area (4\times3=12\text{ m}^2) gives 14{,}700\times12=176{,}400\text{ N} — matching exactly. That's not a coincidence: for a plate of constant width, pressure grows linearly with depth, and the integral of a linear function equals its value at the midpoint times the interval length — the same "average = midpoint, for linear functions" fact that made the trapezoid and midpoint rules exact for straight lines in §4.11.
Your turn
1. Find the work to stretch a spring with k=150\text{ N/m} from its natural length to 0.2 m beyond it.
2. A cubical tank, 2 m on each side, is full of water and must be pumped out over the top. Set up the work integral (weight density $9800\text{ N/m}^3$) and evaluate it.
3. A triangular plate, submerged vertically with its point down, has width \ell(x)=2x at depth x (widening as it gets deeper), down to a maximum depth of 3 m. Set up (don't evaluate) the hydrostatic force integral.
Solutions
1.
W=\int_0^{0.2}150x\,dx=75\big[x^2\big]_0^{0.2}=75(0.04)=\boxed{3\text{ J}}
2. Every horizontal layer is a 2\times2 square, area 4\text{ m}^2 regardless of y; a layer at height y (measuring from the bottom, tank height 2) must travel 2-y to reach the rim:
W=\int_0^2(9800)(4)(2-y)\,dy=39200\int_0^2(2-y)\,dy=39200\left[2y-\frac{y^2}2\right]_0^2
=39200(4-2)=\boxed{78{,}400\text{ J}}
3. Width increases with depth here, the opposite of the constant-width dam gate — pressure and width both grow with x, so the integrand is quadratic rather than linear:
F=\int_0^3(9800)(2x)(x)\,dx=\int_0^3 19600\,x^2\,dx
Check yourself in code
Compute three quantities with SymPy: the work to stretch a $k=200\text{ N/m}$ spring by 0.1 m, the hydrostatic force on a 4 m wide plate submerged 3 m deep, and the work to pump a radius-2, height-4 cylindrical tank empty (weight density 9800\text{ N/m}^3 throughout).
Print exactly this:
spring work, k=200, d=0.1 = 1
hydrostatic force, 4m wide, 3m deep = 176400
pumping work, r=2, h=4 cylinder = 313600*pi
import sympy as sp
x, y = sp.symbols('x y')
W_spring = sp.integrate(200 * x, (x, 0, sp.Rational(1, 10)))
print("spring work, k=200, d=0.1 = ...")
F = sp.integrate(9800 * 4 * x, (x, 0, 3))
print("hydrostatic force, 4m wide, 3m deep = ...")
W_pump = sp.integrate(9800 * sp.pi * 2**2 * (4 - y), (y, 0, 4))
print("pumping work, r=2, h=4 cylinder = ...")
import sympy as sp
x, y = sp.symbols('x y')
W_spring = sp.integrate(200 * x, (x, 0, sp.Rational(1, 10)))
print(f"spring work, k=200, d=0.1 = {W_spring}")
F = sp.integrate(9800 * 4 * x, (x, 0, 3))
print(f"hydrostatic force, 4m wide, 3m deep = {F}")
W_pump = sp.integrate(9800 * sp.pi * 2**2 * (4 - y), (y, 0, 4))
print(f"pumping work, r=2, h=4 cylinder = {W_pump}")
All three problems in this lesson are the same move: something that would be a single multiplication if the force, distance, or pressure were constant gets sliced into pieces where it's approximately constant, multiplied there, and integrated. Springs, pumping, and hydrostatic force just supply three different physical meanings for the varying quantity — the integral itself doesn't change shape.
Next: locating a single point — the center of mass — that summarizes where a whole distributed region's "weight" effectively sits.