WhatsApp us
University Maths2 Nov 2026

Green's, Stokes' and the Divergence Theorem: Which One to Use, With Worked Examples

How Green's theorem, Stokes' theorem and the divergence theorem connect, a decision table for choosing one, six graded worked examples with every step, orientation rules, common mistakes and practice questions with answers.

Green's, Stokes' and the Divergence Theorem: Which One to Use, With Worked Examples

Use Green's theorem for a line integral around a closed curve in the plane, Stokes' theorem for a line integral around a closed curve in space (or the flux of a curl through a surface), and the divergence theorem for the flux through a closed surface. All three trade an integral over a boundary for an integral of a derivative over the inside, so the real skill is spotting which side is easier to compute and getting the orientation right.

This guide shows the decision rule, then six worked examples that rise in difficulty, including the two cases exams like most: closing an open surface, and a field that is undefined at a point inside.

One idea in three dimensions

Each theorem is a version of the fundamental theorem of calculus: the total of a derivative over a region equals the total of the original field over the region's boundary.

TheoremStatementRegionBoundary orientation
Green's∮_C P dx + Q dy = ∬_D (Q_x − P_y) dAFlat region D in the planeAnticlockwise, region on your left
Stokes'∮_C F · dr = ∬_S (∇ × F) · n dSSurface S in spaceRight-hand rule with the normal n
Divergence∯_S F · n dS = ∭_E (∇ · F) dVSolid EOutward normal on the closed surface

Green's theorem is Stokes' theorem for a flat surface with n = k, because the k-component of the curl of (P, Q, 0) is Q_x − P_y. Curl and divergence are built from partial derivatives, so if those still feel slow, our guide to partial derivatives and the gradient is the right warm-up. For help working through your own course, our multivariable and vector calculus tutoring page explains how online sessions with Ajay Vatsyayan work.

How to decide in thirty seconds

You are givenClosed?UseUsually compute
Line integral in the xy-planeClosed curveGreen'sThe double integral of Q_x − P_y
Line integral in spaceClosed curveStokes'Flux of the curl through the simplest surface with that boundary
Flux of a curl through a surfaceSurface has a boundary curveStokes'The line integral round the boundary, or a flatter surface
Flux through a surfaceClosed surfaceDivergenceThe triple integral of ∇ · F
Flux through a surfaceOpen surfaceDivergence after closing itVolume integral minus the flux through the lid
Any of the above, field undefined insideEitherCut out the bad pointA small circle or sphere around it

Two quick checks before you start: is the curve or surface closed, and is the field smooth everywhere inside? If either answer is no, the theorem needs an extra step.

Worked examples

Example 1: Green's theorem on a triangle

Evaluate ∮_C y² dx + 3xy dy, where C is the triangle with vertices (0, 0), (2, 0), (2, 4), traversed anticlockwise.

Here P = y² and Q = 3xy, so Q_x − P_y = 3y − 2y = y.

The region is 0 ≤ x ≤ 2 with 0 ≤ y ≤ 2x (the hypotenuse runs along y = 2x).

∬_D y dA = ∫₀² ∫₀^(2x) y dy dx = ∫₀² ½(2x)² dx = ∫₀² 2x² dx = 16/3

Doing the three line segments directly also gives 16/3, but takes three parametrisations instead of one double integral.

Example 2: area from a line integral

Green's theorem with P = −y/2, Q = x/2 gives Q_x − P_y = 1, so

Area of D = ½ ∮_C (x dy − y dx)

For the ellipse x²/9 + y²/4 = 1, take x = 3 cos t, y = 2 sin t, 0 ≤ t ≤ 2π. Then x dy − y dx = (6 cos²t + 6 sin²t) dt = 6 dt, so the area is ½ × 6 × 2π = 6π, matching πab with a = 3, b = 2.

Example 3: Stokes' theorem on a tilted ellipse

Let F = (z − y, x − z, x + y). Find ∮_C F · dr, where C is the curve where the plane z = 3 − x meets the cylinder x² + y² = 4, oriented anticlockwise when viewed from above.

Curl first:

∇ × F = (∂R/∂y − ∂Q/∂z, ∂P/∂z − ∂R/∂x, ∂Q/∂x − ∂P/∂y) = (1 + 1, 1 − 1, 1 + 1) = (2, 0, 2)

Choose S as the piece of the plane inside the cylinder. Anticlockwise from above means the normal points upward. For a surface z = g(x, y) with upward normal,

n dS = (−g_x, −g_y, 1) dA = (1, 0, 1) dA

So (∇ × F) · n dS = (2 + 0 + 2) dA = 4 dA, and the shadow of S in the xy-plane is the disc of radius 2:

∮_C F · dr = 4 × (area of disc) = 4 × 4π = 16π

Parametrising C directly as (2 cos t, 2 sin t, 3 − 2 cos t) also gives 16π, after a longer trigonometric integral.

Example 4: divergence theorem with spherical coordinates

Find the outward flux of F = (xy², yz², zx²) through the sphere x² + y² + z² = 4.

∇ · F = y² + z² + x² = ρ² in spherical coordinates.

∭_E ρ² dV = ∫₀^(2π) ∫₀^π ∫₀² ρ² · ρ² sin φ dρ dφ dθ

The inner integral is 32/5, the φ integral of sin φ is 2, the θ integral is 2π:

Flux = (32/5)(2)(2π) = 128π/5

Without the Jacobian ρ² sin φ the "answer" becomes 16π²/3, which is a common wrong result. The direct surface integral also gives 128π/5.

Example 5: an open surface, closed with a lid

Find the upward flux of F = (xz, yz, 1) through the paraboloid z = 4 − x² − y², z ≥ 0.

The paraboloid is open at the bottom, so close it with the disc D: x² + y² ≤ 4, z = 0. Together they bound the solid E.

∇ · F = z + z + 0 = 2z. In cylindrical coordinates:

∭_E 2z dV = ∫₀^(2π) ∫₀² ∫₀^(4 − r²) 2z · r dz dr dθ = 2π ∫₀² r(4 − r²)² dr = 2π × 32/3 = 64π/3

The outward normal on the lid points down, n = (0, 0, −1), so F · n = −1 and the lid flux is −1 × 4π = −4π.

Flux through paraboloid = 64π/3 − (−4π) = 76π/3

The sign of the lid flux is where most marks go. Write "total = paraboloid + lid" and solve for the paraboloid, rather than subtracting in your head.

Example 6: a field undefined at the origin

Find the outward flux of F = r / |r|³ = (x, y, z)/(x² + y² + z²)^(3/2) through the ellipsoid x²/4 + y² + z²/9 = 1.

A quick calculation shows ∇ · F = 0 wherever F is defined. The tempting answer is 0, but F is undefined at the origin, which lies inside the ellipsoid, so the divergence theorem does not apply to the whole solid.

Cut out a small sphere of radius a around the origin. On the region between the sphere and the ellipsoid, F is smooth and ∇ · F = 0, so

flux out of ellipsoid − flux out of small sphere = 0

On the sphere, n = r/a and F · n = (1/a²), so the flux is (1/a²)(4πa²) = 4π. Therefore the flux through the ellipsoid is also 4π. A numerical surface integral over the ellipsoid confirms 4π ≈ 12.566. The same argument shows the answer is 4π for any closed surface enclosing the origin and 0 for one that does not.

Orientation, stated once

  • Green's: walk along C with the region on your left. For a region with a hole, the outer curve goes anticlockwise and the inner one clockwise.
  • Stokes': curl the fingers of your right hand along C; your thumb gives the direction of n. "Anticlockwise viewed from above" means an upward normal.
  • Divergence: the normal points out of the solid on every face, including a lid or base you added yourself.

Where students lose marks

  • Applying the divergence theorem to an open surface. A hemisphere or paraboloid without its base is not closed. Add the lid, then remove its flux with the correct sign.
  • Missing the Jacobian. Cylindrical volume needs r dz dr dθ and spherical needs ρ² sin φ dρ dφ dθ. Dropping either is the single most common error in Example 4 and 5 type questions.
  • Wrong normal for z = g(x, y). The upward normal is (−g_x, −g_y, 1), not (g_x, g_y, 1). In Example 3, using (−1, 0, 1) would give 0 instead of 16π.
  • Ignoring a singularity. If the field blows up inside the region, the theorem needs a small circle or sphere cut out, as in Example 6.
  • Curl component order. Write the determinant with i, j, k on the top row and expand carefully; the middle component carries a minus sign.
  • Choosing a hard surface in Stokes'. Any surface with the same boundary gives the same answer, so pick the flattest one, usually a disc in a plane.

Practice questions

  1. Evaluate ∮_C xy² dx + (x²y + 2x) dy around the rectangle 0 ≤ x ≤ 3, 0 ≤ y ≤ 2, anticlockwise.
  2. Let F = (y, −x, z). Find the flux of ∇ × F through the upper hemisphere x² + y² + z² = 9, z ≥ 0, with upward normal.
  3. Find the outward flux of F = (2x, −y, z²) through the surface of the unit cube 0 ≤ x, y, z ≤ 1.
  4. Find the outward flux of F = (x, y, z) through the closed cylinder x² + y² ≤ 4, 0 ≤ z ≤ 5, including the top and bottom.
  5. Use a line integral to find the area inside the ellipse x²/9 + y²/4 = 1 (try it before reading Example 2).

Answers:

  1. Q_x − P_y = 2, so the answer is 2 × 6 = 12.
  2. ∇ × F = (0, 0, −2). Use the disc of radius 3 instead of the hemisphere: −2 × 9π = −18π.
  3. ∇ · F = 1 + 2z, and its integral over the cube is 1 + 1 = 2.
  4. ∇ · F = 3, volume 20π, flux 60π.
  5. 6π.

Where this leads next

These theorems are the end point of a Calculus III / Multivariable Calculus course and the starting point for physics and engineering. The divergence theorem turns conservation laws into the heat and continuity equations, the kind of partial differential equations covered in our differential equations tutoring. Stokes' theorem underpins Maxwell's equations in electromagnetism and circulation in fluid mechanics. B.Tech students meet all three in first- or second-year vector calculus, and our engineering mathematics help and IIT first-year maths support cover that version. Students in the US can see where the course sits in our overview of the US college maths sequence.

How Maths Bodhi helps

Students we teach usually understand the theorems but lose marks on set-up: the region, the boundary, the orientation and which side to compute. Sessions use your own problem sets and past papers, and we review your attempts line by line. We explain and practise; we don't complete graded assignments or exams. For US Calculus III students, our college maths tutoring for the USA page explains the format.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

What is the difference between Green's theorem and Stokes' theorem?
Green's theorem is the flat, two-dimensional case of Stokes' theorem; Stokes' works for any oriented surface in space.
When should I use the divergence theorem?
When you need the flux through a closed surface and the divergence is simpler to integrate over the solid inside.
Can I use the divergence theorem on an open surface?
Not directly: close it with a lid, apply the theorem, then subtract the lid's flux with its outward normal.
Why do I keep getting the sign wrong in Stokes' theorem?
Usually the orientation: check the right-hand rule links the direction of the curve to the normal you used.
Does Stokes' theorem depend on which surface I choose?
No, any smooth surface with the same oriented boundary gives the same answer, so choose the simplest one.
What if the vector field is undefined inside the region?
Cut out a small circle or sphere around the bad point and apply the theorem to the region that is left.
vector calculusGreen's theoremStokes' theoremdivergence theoremmultivariable calculus