Calculus
Line Integrals
Integrating along a curve — work, mass, circulation
A line integral integrates a function along a curve. For scalar fields it sums values weighted by arc length; for vector fields it sums F·dr — the work done by F along the path. Conservative fields make line integrals depend only on endpoints, by the fundamental theorem for line integrals — and Green's and Stokes' theorems lift the same idea to surfaces.
- Scalar form∫_C f ds
- Vector form∫_C F·dr
- Arc lengthds = |r′(t)| dt
- Direction-sensitive?Vector: yes (sign flips); scalar: no
- Path-independent ifF = ∇φ (conservative)
- Used inWork, circulation, centre of mass, Green's, Stokes'
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Setup — what's a line integral?
Take a smooth curve C in the plane or in space, parametrised by r(t) = ⟨x(t), y(t), z(t)⟩ for a ≤ t ≤ b. Then a line integral is one of two things, depending on whether the integrand is a scalar or a vector field.
Scalar form. For a scalar function f(x, y, z),
∫_C f ds = ∫_a^b f(r(t)) |r′(t)| dt.
Read it as: walk along C with infinitesimal step ds = |r′(t)| dt; multiply by the local value of f; sum. The arc-length weighting |r′(t)| is what turns the parameter t back into geometric distance.
Vector form. For a vector field F,
∫_C F · dr = ∫_a^b F(r(t)) · r′(t) dt.
Read it as: walk along C; at each step take the dot product of F with the tangent vector r′(t); sum. Only the component of F along the direction of motion contributes — the perpendicular component is wasted.
Quick sketch: on a hillside, walking along a contour does zero work against gravity — gravity points down, you move horizontal, dot product zero. Walk straight up, work is maximal. The dot product F·dr is exactly that selectivity.
Scalar line integral vs vector line integral
| Scalar line integral | Vector line integral | |
|---|---|---|
| Notation | ∫_C f ds | ∫_C F·dr |
| Integrand | Scalar function f(x,y,z) | Vector field F(x,y,z) |
| Weight | Arc length ds = |r′(t)| dt | Tangent vector dr = r′(t) dt |
| Direction-sensitive? | No | Yes (sign flips on reversal) |
| Geometric reading | Mass of a wire of density f | Work done by F, or circulation |
| Sample identity | ∫_C 1 ds = arc length of C | ∮_C ∇φ · dr = 0 (closed loop) |
| Generalises to | Surface area, mass of a sheet | Flux integrals, Stokes' theorem |
Worked example — arc length and mass
Let C be the helix r(t) = ⟨cos t, sin t, t⟩, 0 ≤ t ≤ 2π. Compute its arc length, then its mass if its linear density is f(x,y,z) = z.
Tangent: r′(t) = ⟨−sin t, cos t, 1⟩, with |r′(t)| = √(sin²t + cos²t + 1) = √2. So
Arc length = ∫_C 1 ds = ∫_0^{2π} √2 dt = 2π√2.
Mass (with f = z = t):
∫_C z ds = ∫_0^{2π} t · √2 dt = √2 · (2π²) = 2π²√2.
Centre-of-mass calculations follow the same pattern: ∫_C x ds / ∫_C 1 ds gives the average x-coordinate along the wire, weighted by length.
Worked example — work depends on path
Take F = ⟨−y, x⟩ (the rigid-rotation field) and compute the work done from A = (1, 0) to B = (0, 1) along two paths.
Path 1: straight line. Parametrise r(t) = ⟨1 − t, t⟩, 0 ≤ t ≤ 1. Then dr = ⟨−1, 1⟩ dt and F(r(t)) = ⟨−t, 1 − t⟩. So
∫ F·dr = ∫_0^1 [(−t)(−1) + (1 − t)(1)] dt = ∫_0^1 1 dt = 1.
Path 2: quarter circle. Parametrise r(t) = ⟨cos t, sin t⟩, 0 ≤ t ≤ π/2. Then dr = ⟨−sin t, cos t⟩ dt and F(r(t)) = ⟨−sin t, cos t⟩. So
∫ F·dr = ∫_0^{π/2} [(−sin t)(−sin t) + (cos t)(cos t)] dt
= ∫_0^{π/2} 1 dt = π/2 ≈ 1.571.
Same endpoints, different paths, different answers — 1 vs π/2. F is path-dependent (its 2D curl ∂(x)/∂x − ∂(−y)/∂y = 1 − (−1) = 2 is nonzero, so by Green's theorem the loop integral around any closed curve is nonzero). Work cannot be computed just from "where you started and ended" for non-conservative forces.
Worked example — conservative path independence
Take F = ⟨2xy, x² + 1⟩. Check ∂Q/∂x − ∂P/∂y = 2x − 2x = 0 — F is curl-free on the whole plane, hence conservative. Find a potential by integration:
∂φ/∂x = 2xy ⟹ φ = x²y + g(y),
∂φ/∂y = x² + 1 ⟹ g′(y) = 1 ⟹ g(y) = y.
φ(x, y) = x²y + y.
So along any path from A = (1, 0) to B = (0, 1):
∫_C F·dr = φ(0, 1) − φ(1, 0) = 1 − 0 = 1.
Without parametrising anything. This is the fundamental theorem for line integrals: ∫_C ∇φ·dr = φ(end) − φ(start). Once you know F is a gradient, line integrals collapse to subtraction.
Conservative vs path-dependent fields
| Conservative field (F = ∇φ) | Path-dependent field | |
|---|---|---|
| Curl | ∇×F = 0 everywhere | ∇×F ≠ 0 somewhere |
| Closed-loop integral | ∮ F·dr = 0 always | Can be nonzero |
| Path A→B | Depends only on endpoints | Depends on path |
| Has potential? | Yes (locally always; globally on simply connected domains) | No |
| Computation | φ(end) − φ(start) | Must parametrise the path |
| Physical example | Gravity, electrostatic force | Magnetic force on moving charge |
| Energy interpretation | Conservative force ↔ potential energy | Loop work pumps energy in/out |
The mnemonic: conservative means "no free lunch around a loop." Push a particle around in a closed circuit through a conservative field and your net work is zero. Push it through a non-conservative field and you can extract or pay energy on each lap — the principle of every electric generator and every dynamo.
The fundamental theorem for line integrals
If F = ∇φ on a region containing the smooth curve C from A to B, then
∫_C F · dr = φ(B) − φ(A).
The path is irrelevant. This is the cleanest generalisation of the 1D fundamental theorem of calculus, ∫_a^b f′(x) dx = f(b) − f(a) — exactly the same statement, but the variable of integration is a curve in higher-dimensional space.
Equivalent statements (on a simply-connected domain):
- F is conservative.
- F = ∇φ for some scalar potential φ.
- ∫_C F·dr depends only on the endpoints of C.
- ∮_C F·dr = 0 for every simple closed curve C.
- ∇×F = 0.
Any one of these implies all the others. Outside simply-connected domains — annuli, tori, the punctured plane — the last condition (zero curl) no longer implies the first four.
Circulation in fluid flow
If F = v is the velocity field of a fluid, then ∮_C v·dr along a closed loop is the circulation Γ around C. It quantifies how much the fluid is "swirling around" the loop. Stokes' theorem rewrites circulation as ∬_S (∇×v)·dS — total vorticity flux through any spanning surface.
Kelvin's circulation theorem says Γ is conserved as the loop is carried along by an inviscid incompressible flow. The Kutta–Joukowski theorem links circulation to lift on a 2D airfoil: lift per unit span = ρ v_∞ Γ. The seemingly abstract concept of a closed-loop line integral is therefore directly responsible for keeping aircraft in the air.
Where line integrals appear
- Mechanical work. ∫_C F·dr — only the component of force along the path does work; the perpendicular component is wasted.
- Voltage and EMF. ∫_C E·dr is the voltage between endpoints; ∮ E·dr around a closed loop is the EMF, equal to −dΦ_B/dt by Faraday's law.
- Mass and centre of mass of a wire. ∫_C ρ ds gives total mass; ∫_C xρ ds / ∫_C ρ ds gives the average x-coordinate.
- Complex contour integrals. ∫_C f(z) dz — basis of the residue theorem and tricks like ∫_0^∞ sin(x)/x dx = π/2.
- Maxwell's equations (integral form). ∮ E·dr and ∮ B·dr appear directly in Faraday's and Ampère's laws.
- Action principles. S = ∫ L dt is a line integral; stationary-action paths are the trajectories of classical mechanics.
Closed vs open curves and orientation
Reversing the parametrisation of C swaps r′(t) → −r′(t), so ∫_{−C} F·dr = −∫_C F·dr. The scalar line integral ∫_C f ds is invariant under reversal — only the vector form is sign-sensitive. This is the bookkeeping rule behind every orientation gotcha downstream: Green's needs CCW, Stokes' ties n̂ to the boundary by the right-hand rule, and ∮_C F·dr is independent of where you start but not of which direction you go.
Common mistakes
- Path direction matters for line integrals. Reversing the parametrisation flips the sign of ∫ F·dr. Always check that you traversed C in the direction the problem (or theorem) requires. Particularly easy to slip up when computing ∮ around a closed curve — pick CCW and stay there.
- Forgetting |r′(t)| in the scalar form. ∫_C f ds requires the Jacobian factor |r′(t)| to convert parameter steps back to geometric distance. Drop it and you compute the wrong integral by exactly the parametrisation's local stretch.
- Confusing ds and dr. ds is a scalar (arc-length element); dr is a vector (tangent times dt). They're not interchangeable. Scalar fields use ds; vector fields use dr (in F·dr).
- Treating curl-free as conservative on any domain. Holes break the implication. F = ⟨−y, x⟩/(x²+y²) is curl-free wherever it's defined, but ∮ F·dr around a loop encircling the origin is 2π. Always check the topology.
- Wrong endpoints in the FTLI. ∫_C F·dr = φ(end) − φ(start), in that order. Swap them and your answer is the negative of the right one. The sign convention matches the way C is parametrised.
- Missing the simply-connected hypothesis when picking a potential. Locally, every curl-free field has a potential; globally, only on simply-connected domains. On annuli or punctured regions you can have a "potential" that is multivalued (e.g. arctan(y/x)) — and using it without care gives the wrong loop integral.
Frequently asked questions
What's the difference between a scalar and a vector line integral?
A scalar line integral ∫_C f ds integrates a scalar function along a curve, weighted by arc length ds. The answer is independent of direction. A vector line integral ∫_C F·dr integrates a vector field, picking up only the tangential component of F. Reverse the direction and the vector integral flips sign; the scalar integral does not.
Why is a line integral different from a regular integral?
A regular integral runs along a straight axis. A line integral runs along a curve in space, which can twist and double back. The variable of integration is arc length, not a coordinate, so you must parametrise the curve and account for how fast you traverse it. The bookkeeping is heavier, but the underlying idea — sum values along a path — is the same.
What does ∫ F·dr mean physically?
The work done by force F as a particle moves along the curve C. Each tiny step dr is a displacement; F·dr is the component of force along that step times the step length. Add them all up and you get total work — exactly the textbook definition. If F is a fluid velocity instead of a force, the same integral is the circulation.
When is a line integral path-independent?
When F is conservative — equivalently, when F = ∇φ for some scalar potential φ. Then ∫_C F·dr = φ(end) − φ(start), the fundamental theorem for line integrals. On a simply-connected domain, conservative is the same as curl-free (∇×F = 0). On domains with holes, curl-free is necessary but not sufficient.
Does the choice of parametrisation matter?
No, provided the parametrisation is one-to-one and traverses the curve in the chosen direction. Both forms of line integral are invariant under orientation-preserving reparametrisation — change variable from t to u(t) with u'(t) > 0, and the integrand transforms exactly so the answer stays the same. Reverse the orientation, however, and the vector integral flips sign.
How do line integrals connect to Green's and Stokes' theorems?
Both theorems express a line integral around a closed curve as a higher-dimensional integral over a region the curve bounds. Green's: ∮ P dx + Q dy = ∬ (∂Q/∂x − ∂P/∂y) dA. Stokes': ∮ F·dr = ∬ (∇×F)·dS. Line integrals are the boundary side of these identities, so understanding line integrals is the entry point to the entire fundamental-theorem-of-calculus generalisation programme.