Line Integrals and Green's Theorem with Worked Examples
Integrating Along a Curve
An ordinary integral adds up a quantity along a straight stretch of the x-axis. But how much work does a force do on a particle moving along a curved path? What is the total mass of a bent wire whose density varies along its length? These questions need line integrals, which add up a quantity along a curve. This tutorial explains line integrals of scalar and vector fields, how to evaluate them by parametrising the curve, when the answer depends on the path, and Green's theorem, which links a line integral around a closed curve to a double integral over the region inside. It is written for second-year engineering and mathematics students.
Parametrising a Curve
Every line integral starts by describing the curve C with a parameter t: x = x(t), y = y(t), for t from a to b. Common parametrisations:
- The straight line from (x₀, y₀) to (x₁, y₁): x = x₀ + t(x₁ − x₀), y = y₀ + t(y₁ − y₀), 0 ≤ t ≤ 1.
- The circle of radius r centred at the origin, anticlockwise: x = r cos t, y = r sin t, 0 ≤ t ≤ 2π.
- The graph y = f(x) from x = a to x = b: x = t, y = f(t), a ≤ t ≤ b.
Line Integrals of Scalar Fields
For a scalar function f(x, y), the line integral with respect to arc length is
∫ f ds = ∫ f(x(t), y(t)) √[(dx/dt)² + (dy/dt)²] dt, from t = a to t = b.
If f is the density of a wire (mass per unit length), this gives the wire's total mass. If f = 1, it gives the length of the curve.
Example 1. A straight wire runs from (0, 0) to (3, 4) and has density f = x + y. Find its mass.
Parametrise: x = 3t, y = 4t, 0 ≤ t ≤ 1. Then ds = √(9 + 16) dt = 5 dt, and f = 7t. Mass = integral from 0 to 1 of 7t × 5 dt = 35 × ½ = 35/2 = 17.5 units.
Line Integrals of Vector Fields (Work)
For a force field F = P i + Q j, the work done moving along C is
W = ∫ F · dr = ∫ (P dx + Q dy) = ∫ [P (dx/dt) + Q (dy/dt)] dt.
Only the component of the force along the direction of motion does work, which is why this is a dot product. Reversing the direction of the path changes the sign of the answer.
Example 2. Find the work done by F = y i + x² j along the parabola y = x² from (0, 0) to (1, 1).
Parametrise x = t, y = t², so dx = dt and dy = 2t dt. Then P = t² and Q = t².
W = integral from 0 to 1 of (t² × 1 + t² × 2t) dt = integral of (t² + 2t³) dt = 1/3 + 1/2 = 5/6.
Example 3. Repeat for the path that goes along the x-axis from (0, 0) to (1, 0), then straight up to (1, 1).
- Along the x-axis, y = 0 and dy = 0, so F · dr = y dx = 0. Work = 0.
- Up the line x = 1, dx = 0, so F · dr = x² dy = dy. Work = integral from 0 to 1 of dy = 1.
Total W = 1. The two paths join the same points but give different work (5/6 and 1), so this field is not conservative.
Path Independence and Conservative Fields
If F = ∇φ for some potential φ, then the line integral depends only on the end points:
∫ F · dr = φ(end) − φ(start).
This is the fundamental theorem for line integrals. In two dimensions, F = P i + Q j is conservative (on a region without holes) exactly when ∂Q/∂x = ∂P/∂y.
In Example 2, ∂Q/∂x = 2x but ∂P/∂y = 1, which are not equal, confirming that the field is not conservative.
Example 4. Find the work done by F = 2xy i + x² j from (0, 0) to (1, 1) along any path.
∂Q/∂x = 2x = ∂P/∂y, so the field is conservative. Its potential is φ = x²y (check: ∂φ/∂x = 2xy and ∂φ/∂y = x²). So W = φ(1, 1) − φ(0, 0) = 1, for every path. Around any closed path, the work done by a conservative field is zero.
Circulation Around a Closed Curve
For a closed curve, the line integral ∮ F · dr is called the circulation. By convention the curve is traversed anticlockwise (with the region on the left).
Example 5. Find the circulation of F = −y i + x j around the unit circle.
x = cos t, y = sin t, dx = −sin t dt, dy = cos t dt. Then F · dr = (−sin t)(−sin t) dt + (cos t)(cos t) dt = (sin² t + cos² t) dt = dt. Circulation = integral from 0 to 2π of dt = 2π. The field swirls around the origin, so a nonzero circulation makes sense.
Green's Theorem
Let C be a simple closed curve traversed anticlockwise, enclosing a region D, and let P and Q have continuous partial derivatives. Then
∮ (P dx + Q dy) = ∬ (∂Q/∂x − ∂P/∂y) dA, the double integral taken over D.
The quantity ∂Q/∂x − ∂P/∂y is the curl of F in two dimensions: the local rotation at each point. Green's theorem says that the total circulation around the boundary equals the sum of all the little rotations inside. The internal rotations cancel between neighbouring cells, leaving only the boundary.
Check with Example 5. For F = −y i + x j, ∂Q/∂x − ∂P/∂y = 1 − (−1) = 2. The double integral over the unit disc is 2 × (area π) = 2π, matching the direct calculation.
Example 6. Use Green's theorem to find ∮ (−y² dx + xy dy) anticlockwise around the square with corners (0, 0), (1, 0), (1, 1), (0, 1).
P = −y², Q = xy, so ∂Q/∂x − ∂P/∂y = y − (−2y) = 3y. The double integral over the square is the integral from 0 to 1 of the integral from 0 to 1 of 3y dx dy = 3 × ½ = 3/2.
Direct check, edge by edge: the bottom edge (y = 0) gives 0; the right edge (x = 1, y from 0 to 1) gives the integral of y dy = ½; the top edge (y = 1, x from 1 to 0) gives the integral of −1 dx from 1 to 0 = 1; the left edge (x = 0) gives 0. Total 0 + ½ + 1 + 0 = 3/2 ✓. Green's theorem replaced four line integrals with one double integral.
Finding Areas with Green's Theorem
Choose P and Q so that ∂Q/∂x − ∂P/∂y = 1. Then the double integral is just the area of D. A symmetric choice is P = −y/2, Q = x/2:
Area = ½ ∮ (x dy − y dx).
Example 7. Find the area of the ellipse x = a cos t, y = b sin t.
x dy − y dx = a cos t × b cos t dt − b sin t × (−a sin t) dt = ab dt. Area = ½ × integral from 0 to 2π of ab dt = πab. This principle is how a planimeter, a mechanical instrument used by surveyors, measures the area of a region by tracing its boundary.
Summary
- Parametrise the curve, express everything in terms of t, then integrate from start to finish.
- ∫ f ds uses ds = √[(dx/dt)² + (dy/dt)²] dt and gives mass or length; ∫ F · dr gives work.
- For conservative fields (∂Q/∂x = ∂P/∂y), the work depends only on the end points: φ(end) − φ(start).
- Green's theorem: the anticlockwise circulation around C equals the double integral of ∂Q/∂x − ∂P/∂y over the region inside.
- Area = ½ ∮ (x dy − y dx).