Multivariable Calculus

Green's, Stokes' & Divergence Theorems

Three theorems. One idea: an integral over a region's interior equals an integral over its boundary. Together they unify all of vector calculus into a single profound principle.

Green's Theorem Stokes' Theorem Divergence Theorem 10 worked examples Physical interpretations
Share this page

§ 01The Unifying Idea

Every one of these three theorems says the same thing in a different dimension: an integral over a region can be converted into an integral over its boundary: or vice versa.

This principle is already familiar from single-variable calculus. The Fundamental Theorem of Calculus states that ∫ab f′(x) dx = f(b) − f(a): an integral over an interval equals the difference of values at the two endpoints (the boundary of the interval). Green's, Stokes', and the Divergence Theorem are multi-dimensional generalisations of exactly this idea.

The Generalised Stokes' Theorem All three theorems are special cases of the abstract statement: ∫Ω dω = ∫∂Ω ω, where ω is a differential form, dω is its exterior derivative, and ∂Ω is the boundary of the domain Ω with compatible orientation. You do not need to know differential forms to use these theorems — but appreciating this connection reveals why they all look structurally identical.

Before diving into each theorem, make sure you are comfortable with line integrals and surface integrals, these are the boundary integrals that appear on the right-hand side of every formula here. Also recall the partial derivatives that build the curl and divergence operators.

The Three Theorems at a Glance

Theorem Interior Integral Boundary Integral Dimension
Green's D (∂Q/∂x − ∂P/∂y) dA C P dx + Q dy 2D region → 1D curve
Stokes' S (∇×F)·dS ∂S F·dr 3D surface → 1D curve
Divergence V (∇·F) dV S F·dS 3D volume → 2D surface

§ 02Green's Theorem

Theorem
Green's Theorem
C P dx + Q dy = ∬D (∂Q/∂x − ∂P/∂y) dA

where C is a simple closed curve traversed counterclockwise (positive orientation) enclosing a simply-connected region D, and P, Q have continuous partial derivatives on an open set containing D.

The left-hand side is a line integral around the closed boundary. The right-hand side is a double integral over the enclosed region. The integrand ∂Q/∂x − ∂P/∂y is the scalar curl (also called the 2D curl) of the vector field F = ⟨P, Q⟩.

Physical Interpretation

Imagine a fluid flowing in the plane with velocity field F = ⟨P, Q⟩. The line integral ∮C F·dr measures the total circulation: how much the fluid rotates around the curve C. The scalar curl ∂Q/∂x − ∂P/∂y measures the local rotation density at each interior point. Green's theorem says that total circulation equals the sum of all local rotations across the region: a boundary measurement equals an interior measurement.

Two Ways to Use It

Line integral → double integral: When the line integral around a complicated closed curve is hard to compute directly, replace it with a (often simpler) double integral over the interior.

Double integral → line integral: When computing area or a double integral, rewrite it as a line integral. Notably, the area of D is: A = ½ ∮C (x dy − y dx).

Area via Green's Theorem
A = ∮C x dy = −∮C y dx = ½ ∮C (x dy − y dx)

Conservative Fields and Green's Theorem

If P and Q satisfy ∂Q/∂x = ∂P/∂y everywhere in D (the scalar curl is zero), then Green's theorem tells us the line integral around any closed curve in D is zero. This is exactly the condition for F = ⟨P, Q⟩ to be a conservative vector field with a potential function f where ∇f = F.

Orientation matters Green's theorem requires the curve C to be traversed so the region D is always on the left. For a simple closed curve, this means counterclockwise. If you traverse clockwise, the sign of the line integral reverses: ∮C,cw = −∮C,ccw.

§ 03Stokes' Theorem

Theorem
Stokes' Theorem
∂S F·dr = ∬S (∇×F)·dS

where S is an oriented surface with boundary curve ∂S (traversed with positive orientation consistent with the surface normal), and F has continuous partial derivatives on an open set containing S.

Stokes' theorem generalises Green's theorem from flat regions in the plane to curved surfaces in 3D space. The right-hand side involves the curl of F, the full 3D vector curl, dotted with the surface element dS.

The Curl of a Vector Field

For F = ⟨P, Q, R⟩, the curl is the vector:

Curl definition
∇×F = ⟨∂R/∂y − ∂Q/∂z, ∂P/∂z − ∂R/∂x, ∂Q/∂x − ∂P/∂y⟩

The curl measures the local rotation of the field at each point. If you imagine a tiny paddle wheel placed in the fluid, the curl tells you how fast it spins and around which axis. Stokes' theorem says the total circulation around the boundary curve equals the total "spinning" integrated over the surface.

Right-Hand Rule for Orientation

The orientation of ∂S must be consistent with the choice of normal on S. Use the right-hand rule: curl the fingers of your right hand in the direction of traversal along ∂S; your thumb points in the direction of the surface normal. Reversing either the orientation of S or the direction of ∂S changes the sign of the integral.

Green's Theorem as a Special Case

When S is a flat region D in the xy-plane with the upward-pointing normal k, the surface integral becomes ∬D (∇×F)·k dA = ∬D (∂Q/∂x − ∂P/∂y) dA, recovering exactly Green's theorem. Stokes' theorem is the 3D parent of Green's theorem.

Irrotational fields If ∇×F = 0 everywhere (the field is irrotational), Stokes' theorem tells us the line integral around any closed curve on a simply-connected surface is zero. This is the 3D analogue of a conservative field.

§ 04The Divergence Theorem

Theorem (Gauss's Theorem)
The Divergence Theorem
S F·dS = ∭V (∇·F) dV

where V is a solid region with closed boundary surface S (oriented with the outward-pointing normal), and F has continuous partial derivatives on an open set containing V.

This theorem links a surface integral over a closed surface to a triple integral over the enclosed volume. The integrand on the right is the divergence of F.

The Divergence of a Vector Field

For F = ⟨P, Q, R⟩, the divergence is the scalar:

Divergence definition
∇·F = ∂P/∂x + ∂Q/∂y + ∂R/∂z

The divergence measures how much the field is spreading out from each point. Positive divergence at a point means there is a local source of flux there (fluid is being created); negative divergence means a sink (fluid is being absorbed). A field with ∇·F = 0 everywhere is incompressible (or solenoidal), no sources or sinks.

Physical Interpretation

Think of F as the velocity field of a fluid. The surface integral ∬S F·dS measures the total flux, the net volume of fluid per unit time flowing out through the surface S. The Divergence Theorem says this net outward flux equals the sum of all local sources and sinks throughout the volume.

V S = ∂V S F·dS = ∭ V ∇·F dV

Outward normals on closed surface S bounding volume V: net outward flux = total divergence inside

Incompressible (solenoidal) fields If ∇·F = 0 throughout V (no sources or sinks), the Divergence Theorem immediately tells us that the net flux through any closed surface is zero. This is a key property in fluid mechanics and electromagnetism (Maxwell's ∇·B = 0 means no magnetic monopoles).

§ 05Worked Examples

Examples 1–4 use Green's theorem, 5–7 use Stokes', and 8–10 use the Divergence theorem. For each, identify which theorem applies before computing.

Example 01 Green's theorem — line integral over a triangle

Evaluate ∮C (y² dx + x dy) where C is the triangle with vertices (0,0), (1,0), (0,1) traversed counterclockwise.

Step 1 — Identify P and Q
P = y², Q = x ∂Q/∂x = 1, ∂P/∂y = 2y
Step 2 — Set up the double integral over triangle D
D (1 − 2y) dA, D: 0≤x≤1, 0≤y≤1−x
Step 3 — Integrate
∫₀¹ ∫₀1−x (1−2y) dy dx = ∫₀¹ [y − y²]₀1−x dx = ∫₀¹ [(1−x)−(1−x)²] dx = ∫₀¹ (1−x)(1−(1−x)) dx = ∫₀¹ x(1−x) dx = ∫₀¹ (x−x²) dx = [x²/2 − x³/3]₀¹ = 1/2 − 1/3 = 1/6
∮ = 1/6
Example 02 Green's theorem — area of an ellipse

Use Green's theorem to find the area enclosed by the ellipse x = a cos t, y = b sin t, 0 ≤ t ≤ 2π.

Step 1 — Use the area formula
A = ½ ∮C (x dy − y dx)
Step 2 — Compute dx and dy
dx = −a sin t dt, dy = b cos t dt
Step 3 — Substitute and integrate
A = ½ ∫₀ [(a cos t)(b cos t) − (b sin t)(−a sin t)] dt = ½ ∫₀ ab(cos²t + sin²t) dt = ½ ab · 2π
A = πab
Example 03 Green's theorem — checking a conservative field

Show that ∮C (2xy dx + x² dy) = 0 for any simple closed curve C using Green's theorem.

Step 1 — Identify P = 2xy, Q = x²
Step 2 — Compute the scalar curl
∂Q/∂x = 2x, ∂P/∂y = 2x ∂Q/∂x − ∂P/∂y = 2x − 2x = 0
Step 3 — Conclude by Green's theorem
C = ∬D 0 · dA = 0 ✓

Note: Q = x² has potential f = x²y, so this is a conservative field. The zero line integral is expected.

∮ = 0 for any closed C
Example 04 Green's theorem — unit circle line integral

Evaluate ∮C (−y³ dx + x³ dy) where C is the unit circle x²+y²=1, counterclockwise.

Step 1 — P = −y³, Q = x³; compute scalar curl
∂Q/∂x − ∂P/∂y = 3x² − (−3y²) = 3x² + 3y² = 3(x²+y²)
Step 2 — Switch to polar coordinates over unit disk
D 3(x²+y²) dA = ∫₀ ∫₀¹ 3r² · r dr dθ = 3 · 2π · ∫₀¹ r³ dr = 3 · 2π · [r⁴/4]₀¹ = 3 · 2π · 1/4 = 3π/2
∮ = 3π/2
Example 05 Stokes' theorem — curl over a paraboloid cap

Evaluate ∬S (∇×F)·dS for F = ⟨−y, x, 0⟩ where S is the paraboloid z = 1−x²−y², z ≥ 0, with upward normal. Use Stokes' theorem.

Step 1 — The boundary ∂S is the circle x²+y²=1, z=0, traversed counterclockwise (viewed from above)
Step 2 — Parametrise ∂S: r(t) = ⟨cos t, sin t, 0⟩, dr = ⟨−sin t, cos t, 0⟩ dt
Step 3 — Compute F·dr on ∂S
F = ⟨−sin t, cos t, 0⟩ F·dr = (−sin t)(−sin t) + (cos t)(cos t) = sin²t + cos²t = 1
Step 4 — Integrate
∂S F·dr = ∫₀ 1 dt = 2π
S (∇×F)·dS = 2π
Example 06 Stokes' theorem — computing the curl directly

Find ∮C F·dr where F = ⟨xz, xy, yz⟩ and C is the boundary of the triangle with vertices (1,0,0), (0,1,0), (0,0,1) traversed counterclockwise when viewed from above.

Step 1 — Compute ∇×F
∇×F = ⟨∂(yz)/∂y − ∂(xy)/∂z, ∂(xz)/∂z − ∂(yz)/∂x, ∂(xy)/∂x − ∂(xz)/∂y⟩ = ⟨z − 0, x − 0, y − 0⟩ = ⟨z, x, y⟩
Step 2 — Surface S is the triangle in the plane x+y+z=1; normal n̂ = (1/√3)⟨1,1,1⟩
Step 3 — (∇×F)·n̂ = (1/√3)(z+x+y) = (1/√3)(1) = 1/√3 on S, since x+y+z=1
Step 4 — Area of equilateral triangle = √3/2; dS = √3 dA (Jacobian factor for slanted plane)
S (∇×F)·dS = (1/√3) · √3 · (Area of projected triangle) Projected triangle area = ½ · base · height = ½ · 1 · 1 = 1/2 ∮ = (1/√3)(√3)(1/2) = 1/2
C F·dr = 1/2
Example 07 Stokes' theorem — choosing a simpler surface

Evaluate ∮C F·dr for F = ⟨y², z², x²⟩ where C is the intersection of the cylinder x²+y²=1 and the plane z = y+2, traversed counterclockwise from above. Use Stokes' with the flat disk inside C rather than the cylinder.

Step 1 — Key insight: any surface with boundary C gives the same answer by Stokes'. Take S to be the elliptical disk cut by z = y+2 inside x²+y²=1.
Step 2 — Compute ∇×F for F = ⟨y², z², x²⟩
∇×F = ⟨∂(x²)/∂y − ∂(z²)/∂z, ∂(y²)/∂z − ∂(x²)/∂x, ∂(z²)/∂x − ∂(y²)/∂y⟩ = ⟨0−2z, 0−2x, 0−2y⟩ = ⟨−2z, −2x, −2y⟩
Step 3 — On z = y+2: normal from surface z−y−2=0 is n ∝ ⟨0,−1,1⟩, so n̂ = (1/√2)⟨0,−1,1⟩
(∇×F)·n̂ = (1/√2)[0 + 2x − 2y] = (√2)(x−y)
Step 4 — dS = √2 dA; integrate over unit disk
∬ (x−y)·√2 · (1/√2)·√2 dA... = √2 ∬disk (x−y) dA = 0 (both ∬x dA and ∬y dA vanish by symmetry over unit disk)
C F·dr = 0
Example 08 Divergence theorem — flux through a sphere

Find the flux of F = ⟨x³, y³, z³⟩ outward through the sphere x²+y²+z²=a².

Step 1 — Compute divergence
∇·F = 3x² + 3y² + 3z² = 3(x²+y²+z²) = 3ρ²
Step 2 — Apply Divergence Theorem; convert to spherical coordinates
V 3ρ² dV = ∫₀ ∫₀π ∫₀a 3ρ² · ρ² sin φ dρ dφ dθ
Step 3 — Evaluate
= 3 · 2π · 2 · ∫₀a ρ⁴ dρ = 12π · [ρ⁵/5]₀a = 12πa⁵/5
Flux = 12πa⁵/5
Example 09 Divergence theorem — flux through a cube

Compute ∬S F·dS for F = ⟨x+sin y, y+sin z, z+sin x⟩ over the surface of the cube [0,1]³.

Step 1 — Compute divergence
∇·F = ∂(x+sin y)/∂x + ∂(y+sin z)/∂y + ∂(z+sin x)/∂z = 1 + 0 + 1 + 0 + 1 + 0 = 3
Step 2 — Apply Divergence Theorem
[0,1]³ 3 dV = 3 · Vol([0,1]³) = 3 · 1 = 3
Flux = 3

Note how the sin terms all vanish in the divergence, the Divergence Theorem saves considerable work compared to computing all six face integrals separately.

Example 10 Divergence theorem — closed surface with a hole

Evaluate ∬S F·dS outward for F = ⟨x, y, z⟩ over the closed surface between the sphere x²+y²+z²=4 (outer) and the sphere x²+y²+z²=1 (inner), with outward pointing normal on each.

Step 1 — ∇·F = 1+1+1 = 3; V is the spherical shell 1≤ρ≤2
Step 2 — Apply Divergence Theorem
S F·dS = ∭V 3 dV = 3 · Vol(shell) Vol = (4π/3)(2³) − (4π/3)(1³) = (4π/3)(7) = 28π/3
Step 3 — Total flux
3 · 28π/3 = 28π
Flux = 28π

§ 06Common Mistakes

Mistake 1: Wrong orientation on Green's theorem Green's theorem requires the boundary C to be traversed counterclockwise (so D is on the left). Computing the line integral clockwise introduces a sign error: the result should be negated. Always establish orientation before computing.
Mistake 2: Applying Stokes' to a non-orientable surface Stokes' theorem requires the surface S to be orientable (you can consistently assign a normal at every point). A Möbius strip is not orientable and Stokes' theorem does not apply. In practice, all surfaces you encounter will be orientable, but check that you have not accidentally chosen a self-intersecting or one-sided surface.
Mistake 3: Forgetting the outward normal in the Divergence Theorem The Divergence Theorem as stated requires the outward-pointing normal. If you compute a surface integral with the inward normal, negate your answer. For a surface with a hole (like Example 10), the inner sphere's normal also points outward from the enclosed volume — which is inward toward the origin.
Mistake 4: Using Green's theorem on a non-simply-connected region without care If D has holes, Green's theorem still works, but each hole contributes a boundary curve that must be traversed clockwise (so the region is always on the left). Missing the inner boundary curves gives the wrong answer.

§ 07Practice Quiz

Test your grasp of all three theorems. Answer each question and use the hints and worked solutions if you get stuck.

Score: 0 / 0
Question 1 — Multiple Choice

Green's theorem converts ∮C P dx + Q dy into which expression?

Question 2 — Numeric

Use Green's theorem to evaluate ∮C (x² dx + xy dy) where C is the unit square [0,1]×[0,1] traversed counterclockwise.

Answer:

P = x², Q = xy. ∂Q/∂x = y, ∂P/∂y = 0. So the double integral is ∬ y dA over the unit square.
  1. P = x², Q = xy → ∂Q/∂x − ∂P/∂y = y − 0 = y
  2. [0,1]² y dA = ∫₀¹ ∫₀¹ y dy dx = ∫₀¹ ½ dx = 1/2
Question 3 — Multiple Choice

What does the Divergence Theorem convert ∬S F·dS into?

Question 4 — Numeric

Compute ∬S F·dS for F = ⟨2x, 3y, z⟩ outward through the unit sphere x²+y²+z²=1.

Answer:

∇·F = 2+3+1 = 6. Volume of unit sphere = 4π/3. Answer = 6·(4π/3) = 8π ≈ 25.13.
  1. ∇·F = ∂(2x)/∂x + ∂(3y)/∂y + ∂(z)/∂z = 2+3+1 = 6
  2. V 6 dV = 6 · (4π/3)(1)³ = 8π ≈ 25.133
Question 5 — Multiple Choice

Stokes' theorem relates a line integral around ∂S to a surface integral involving which quantity?

Question 6 — Numeric

Use Green's area formula to find the area enclosed by the ellipse x = 3cos t, y = 2sin t. Give your answer as a multiple of π (enter the coefficient).

Area = × π

Area = ½∮(x dy − y dx) = ½ · ab · 2π = πab. Here a = 3, b = 2.
  1. A = πab = π·3·2 = so coefficient = 6
Question 7 — Multiple Choice

If ∇·F = 0 throughout a volume V, then the net flux of F through the closed boundary S of V is:

Question 8 — Numeric

Evaluate ∮C(−y² dx + x² dy) where C is the circle x²+y²=4 (radius 2), counterclockwise. Give exact answer in terms of π (enter the coefficient).

Answer = × π

P = −y², Q = x². Find ∂Q/∂x − ∂P/∂y, then integrate over the disk of radius 2. Watch for cancellation by symmetry.
  1. P = −y², Q = x². ∂Q/∂x = 2x, ∂P/∂y = −2y
  2. Scalar curl = 2x − (−2y) = 2x + 2y
  3. D (2x+2y) dA over disk radius 2. By symmetry, ∬2x dA = 0 and ∬2y dA = 0.
  4. Answer = 0.
Question 9 — Multiple Choice

Which of these is the correct formula for the divergence of F = ⟨P, Q, R⟩?

Question 10 — Multiple Choice

Green's theorem is a special case of which more general theorem?

§ 08Related Pages

These theorems sit at the pinnacle of vector calculus. Each one depends on concepts covered elsewhere on this site, explore them to fill any gaps and deepen your understanding.

Cookie Settings