24. Line integrals of vector fields: work and circulation
§12.1 integrated a scalar function along a curve, weighted by speed alone, with no regard for direction. This lesson integrates a vector field along a curve instead — and direction now matters enormously, because what gets measured at each instant is how much of the field points along the direction of travel, using exactly §9.1's projection idea.
Work as a motivating example
Recall §5.4: work done by a force is force times distance, when the force is constant and points in the same direction as the motion. If the force is a vector field \vec F(x,y) that varies from point to point, and motion follows a curve C parametrized by \vec r(t), only the component of \vec F along the direction of travel contributes to work at each instant — exactly §9.1's scalar projection, applied continuously along the path.
Definition
W=\int_C\vec F\cdot d\vec r=\int_a^b\vec F\big(\vec r(t)\big)\cdot\vec r'(t)\,dt
At each instant, \vec F(\vec r(t))\cdot\vec r'(t) is the dot product of the field at that point with the curve's own velocity vector — §9.1's dot product measuring exactly how aligned the two are, weighted by both magnitudes. Integrating that product over the parameter range sums up the work contributed at every instant.
In component form, with \vec F=\langle P,Q\rangle and \vec r(t)=\langle x(t),y(t)\rangle:
\int_C\vec F\cdot d\vec r=\int_a^b\left[P\big(x(t),y(t)\big)x'(t)+Q\big(x(t),y(t)\big)y'(t)\right]dt=\int_CP\,dx+Q\,dy
— a common alternate notation, useful for recognizing this integral type when it's written without vector notation at all.
Direction matters — a genuine contrast with §12.1
Reversing the direction of travel along C (tracing the same path backward) flips the sign of \vec r'(t) at every point, which flips the sign of the dot product \vec F\cdot\vec r'(t) at every point, and therefore flips the sign of the whole integral:
\int_{-C}\vec F\cdot d\vec r=-\int_C\vec F\cdot d\vec r
(where -C denotes C traversed in the opposite direction). This is the opposite of §12.1's scalar line integral, which was direction- independent — makes sense physically, since work done moving with a force is positive, and work done moving against the same force along the identical path is negative, even though the path traveled is geometrically identical either way.
Circulation: line integrals around closed curves
When C is a closed curve (starts and ends at the same point), the line integral of a vector field around it is called the circulation, often written with a small circle on the integral sign:
\oint_C\vec F\cdot d\vec r
Circulation measures the net tendency of the field to rotate something moving around that loop — a positive value means the field, on net, pushes in the direction of travel around the loop (like a whirlpool sweeping a leaf along with it), a value of zero means no net rotational push. This quantity becomes central starting in §12.4's Green's theorem, which converts a circulation integral around a boundary into a double integral over the enclosed region.
Doing it in Python
Computing work done by \vec F(x,y)=\langle y,x\rangle along the curve \vec r(t)=\langle t,t^2\rangle from t=0 to t=1:
import sympy as sp
t = sp.Symbol('t')
x, y = t, t**2
r_prime = sp.Matrix([sp.diff(x, t), sp.diff(y, t)])
F = sp.Matrix([y, x]) # F(x,y) = <y, x>, evaluated along the curve
work = sp.integrate(F.dot(r_prime), (t, 0, 1))
print(f"work = {work}")
Confirming that reversing direction flips the sign:
import sympy as sp
t = sp.Symbol('t')
x, y = t, t**2
r_prime = sp.Matrix([sp.diff(x, t), sp.diff(y, t)])
F = sp.Matrix([y, x])
work_forward = sp.integrate(F.dot(r_prime), (t, 0, 1))
work_backward = sp.integrate(F.dot(r_prime), (t, 1, 0)) # same path, integrated backward
print(f"forward: {work_forward}")
print(f"backward: {work_backward}")
print(f"negatives of each other: {work_forward == -work_backward}")
Computing the circulation of a rotational field around a full circle — confirming a nonzero net rotational push:
import sympy as sp
t = sp.Symbol('t')
x, y = sp.cos(t), sp.sin(t)
r_prime = sp.Matrix([sp.diff(x, t), sp.diff(y, t)])
F = sp.Matrix([-y, x]) # the rotational field from section 12.0
circulation = sp.integrate(F.dot(r_prime), (t, 0, 2*sp.pi))
print(f"circulation of <-y,x> around the unit circle = {circulation}")
Worked example
Find the work done by \vec F(x,y)=\langle y,x\rangle moving along \vec r(t)=\langle t,t^2\rangle for t\in[0,1].
\vec r'(t)=\langle1,2t\rangle
Along the curve, x=t and y=t^2, so:
\vec F\big(\vec r(t)\big)=\langle t^2,t\rangle
\vec F\cdot\vec r'(t)=(t^2)(1)+(t)(2t)=t^2+2t^2=3t^2
W=\int_0^13t^2\,dt=\Big[t^3\Big]_0^1=\boxed1
Sanity check. Notice \vec F(x,y)=\langle y,x\rangle is actually a gradient field: \nabla(xy)=\langle y,x\rangle exactly. §12.3 will show that for a gradient field, work depends only on the endpoints — here, start (0,0) and end (1,1) — and equals the potential's change, xy\big|_{(1,1)}-xy\big|_{(0,0)}=1-0=1, matching this computed value exactly, even though the actual path (a parabola) never entered that alternate calculation at all. That match is a strong preview of exactly what makes conservative fields special, next lesson. ✓
Your turn
1. Find the work done by \vec F(x,y)=\langle1,0\rangle (a constant rightward force) along \vec r(t)=\langle t,t^2\rangle for t\in[0,1].
2. Find the circulation of \vec F(x,y)=\langle-y,x\rangle around the unit circle \vec r(t)=\langle\cos t,\sin t\rangle, t\in[0,2\pi].
3. True or false: for any vector field \vec F and any closed curve C, the circulation \oint_C\vec F\cdot d\vec r is always zero.
Solutions
1. \vec r'(t)=\langle1,2t\rangle, and \vec F=\langle1,0\rangle is constant.
\vec F\cdot\vec r'(t)=(1)(1)+(0)(2t)=1
W=\int_0^11\,dt=\boxed1
(Sensible: the curve's net horizontal displacement is 1-0=1, and a purely horizontal constant force of magnitude 1 acting over exactly that horizontal displacement gives work 1, regardless of how the path curved vertically along the way — the vertical component of motion never aligns with a purely horizontal force, so it contributes nothing.)
2. \vec r'(t)=\langle-\sin t,\cos t\rangle. \vec F(\vec r(t))=\langle-\sin t,\cos t\rangle (substituting x=\cos t,y=\sin t into \langle-y,x\rangle).
\vec F\cdot\vec r'(t)=(-\sin t)(-\sin t)+(\cos t)(\cos t)=\sin^2t+\cos^2t=1
\oint_C\vec F\cdot d\vec r=\int_0^{2\pi}1\,dt=\boxed{2\pi}
A clearly nonzero circulation, consistent with \langle-y,x\rangle being exactly the rotational field from §12.0 — it pushes steadily in the counterclockwise direction of travel around this loop, at every point.
3. False. Problem 2 is a direct counterexample: the rotational field \langle-y,x\rangle has circulation 2\pi\ne0 around the unit circle. Circulation is zero specifically for conservative (gradient) fields — exactly the property §12.3 investigates next — not for vector fields in general.
Check yourself in code
Find the work done by \vec F(x,y)=\langle y,x\rangle along \vec r(t)=\langle t,t^2\rangle for t\in[0,1].
Print exactly this:
work = 1
import sympy as sp
t = sp.Symbol('t')
x, y = t, t**2
r_prime = sp.Matrix([sp.diff(x, t), sp.diff(y, t)])
F = sp.Matrix([y, x])
work = sp.integrate(F.dot(r_prime), (t, 0, 1))
print("work = ...")
import sympy as sp
t = sp.Symbol('t')
x, y = t, t**2
r_prime = sp.Matrix([sp.diff(x, t), sp.diff(y, t)])
F = sp.Matrix([y, x])
work = sp.integrate(F.dot(r_prime), (t, 0, 1))
print(f"work = {work}")
A vector field's line integral, $\int_C\vec F\cdot d\vec r=\int_a^b\vec F(\vec r(t))\cdot\vec r'(t)\,dt$, sums the component of \vec F aligned with the direction of travel at every instant — §9.1's projection, applied continuously along a curve — computing work when \vec F is a force field. Unlike §12.1's scalar line integral, direction genuinely matters here: reversing a path flips the sign of the result, and the special case of a closed curve gives the circulation, a measure of net rotational push that will be exactly zero for the conservative fields §12.3 studies next, and generally nonzero otherwise.
Next: which vector fields are gradient fields, why work along them is path-independent, and how to find the potential function that makes it so.