---
title: Stokes' Theorem and the Divergence Theorem
module: Multiple Integrals and Vector Calculus
moduleNumber: 12
lessonNumber: 6
order: 1206
summary: >
  Stokes' Theorem lifts Green's Theorem into space: the line integral of a field
  around the boundary of a surface equals the flux of its curl through the
  surface. The Divergence Theorem relates the outward flux across a closed
  surface to the triple integral of divergence over the solid it encloses.
  Together with the Fundamental Theorem of Calculus and its line-integral and
  Green counterparts, they are one theorem: the integral of a derivative over a
  region equals the integral of the field over its oriented boundary.
topics: [Multiple Integrals and Vector Calculus]
draft: false
sources:
  - book: Stewart
    ref: "Ch. 16 — Vector Calculus; §16.8 Stokes' Theorem, §16.9 The Divergence Theorem"
  - book: Stewart
    ref: "§16.10 Summary"
---

[Green's Theorem](/calculus/multiple-integrals-and-vector-calculus/greens-theorem-curl-and-divergence)
had two vector forms in the plane: circulation around a boundary curve equals
integrated curl over the region, and flux across the boundary equals integrated
divergence. Each lifts into three dimensions. The circulation form becomes
**Stokes' Theorem**, with the flat region replaced by a surface in space and its
boundary a space curve. The flux form becomes the **Divergence Theorem**, with
the plane region replaced by a solid and its boundary a closed surface. All
four fundamental theorems are the same statement at different dimensions.

## Stokes' Theorem

A surface $S$ in space has a boundary curve $C$, the edge where the surface stops.
An orientation of $S$ (a choice of unit normal $\hat{n}$) induces a positive
orientation of $C$ by the right-hand rule: point the thumb along $\hat{n}$ and
the fingers curl in the direction $C$ is traced.

> **Theorem (Stokes).** Let $S$ be an oriented, piecewise-smooth surface bounded
> by a simple, closed, piecewise-smooth boundary curve $C$ with positive
> orientation. If $\vec{F}$ has continuous partial derivatives on an open region
> containing $S$, then
> $$
> \oint\limits_C \vec{F}\cdot \d\vec{r} = \iint\limits_S \operatorname{curl}\vec{F}\cdot \d\vec{S} .
> $$

The line integral around the boundary of the tangential component of $\vec{F}$
equals the surface integral over $S$ of the normal component of
$\operatorname{curl}\vec{F}$. When $S$ is a flat region in the $xy$-plane with
upward normal $\hat{k}$, the right side is
$\iint\limits_S (\operatorname{curl}\vec{F})\cdot\hat{k}\,\d A$ and the statement is
exactly Green's Theorem. Stokes' Theorem is Green's Theorem for a curved surface.

$$
% caption: Stokes' Theorem: circulation of $\mathbf{F}$ around the boundary curve
% $C$ equals the flux of $\operatorname{curl}\mathbf{F}$ through the surface $S$;
% the normal and the boundary orientation obey the right-hand rule.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% a curved cap surface with an elliptical boundary
\fill[acc!10] (0.6,1.0) .. controls (1.5,2.0) and (3.9,2.0) .. (4.8,1.0)
  .. controls (3.9,0.2) and (1.5,0.2) .. (0.6,1.0) -- cycle;
\draw[acc, very thick] (0.6,1.0) .. controls (1.5,2.0) and (3.9,2.0) .. (4.8,1.0)
  .. controls (3.9,0.2) and (1.5,0.2) .. (0.6,1.0) -- cycle;
% bulge the surface up (grid hint)
\draw[black] (1.3,1.05) .. controls (2.4,1.9) and (3.0,1.9) .. (4.1,1.05);
\draw[black] (2.0,0.55) .. controls (2.4,1.7) and (2.9,1.7) .. (2.7,1.5);
\node[font=\small] at (2.7,1.15) {$S$};
% normal
\draw[black, thick, ->] (2.7,1.35) -- (2.9,2.35);
\node[font=\small, anchor=west] at (2.9,2.25) {$\mathbf{n}$};
% boundary orientation arrows
\draw[acc, very thick, ->] (4.4,0.7) -- (4.0,0.42);
\draw[acc, very thick, ->] (1.0,1.3) -- (1.4,1.65);
\node[acc, font=\small, anchor=east] at (0.55,1.0) {boundary $C$};
\end{tikzpicture}
$$

A consequence: if two surfaces share the same boundary curve $C$, then the flux of
$\operatorname{curl}\vec{F}$ through them is equal, because both equal
$\oint\limits_C \vec{F}\cdot \d\vec{r}$. The flux of a curl depends only on the
boundary, not on the surface spanning it. In particular a closed surface has no
boundary, so the flux of any curl through a closed surface is zero.

> **Worked example.** Evaluate $\oint\limits_C \vec{F}\cdot \d\vec{r}$ for
> $\vec{F} = \langle -y^2,\ x,\ z^2\rangle$ where $C$ is the circle
> $x^2 + y^2 = 1$ in the plane $z = 1$, oriented counterclockwise from above. Rather
> than parametrize $C$, use Stokes' Theorem with $S$ the flat disk $x^2 + y^2 \le 1$
> at $z = 1$, upward normal $\hat{k}$. The curl is
>
> $$
> \operatorname{curl}\vec{F} = \begin{vmatrix} \hat\imath & \hat\jmath & \hat{k} \\ \partial_x & \partial_y & \partial_z \\ -y^2 & x & z^2 \end{vmatrix} = \langle 0,\ 0,\ 1 + 2y\rangle,
> $$
>
> so $\operatorname{curl}\vec{F}\cdot\hat{k} = 1 + 2y$, and
>
> $$
> \oint\limits_C \vec{F}\cdot \d\vec{r} = \iint\limits_{x^2+y^2\le 1}(1 + 2y)\,\d A = \iint 1\,\d A + 2\iint y\,\d A = \pi + 0 = \pi,
> $$
>
> using that $\iint y\,\d A = 0$ over a disk symmetric about the $x$-axis. The surface
> integral is easier than the line integral, which is the usual reason to apply the
> theorem in this direction.

## The Divergence Theorem

The flux form of Green's Theorem lifts differently: the plane region becomes a
solid $E$, and its boundary curve becomes the closed boundary **surface** $S$,
oriented outward.

> **Theorem (Divergence, or Gauss).** Let $E$ be a simple solid region whose
> boundary surface $S$ is oriented outward. If $\vec{F}$ has continuous partial
> derivatives on an open region containing $E$, then
> $$
> \iint\limits_S \vec{F}\cdot \d\vec{S} = \iiint\limits_E \operatorname{div}\vec{F}\,\d V .
> $$

The outward flux of $\vec{F}$ across the closed surface equals the triple
integral of $\operatorname{div}\vec{F}$ over the solid it bounds. It matches
the physical reading of divergence as outflow per unit volume: adding up the local
outflow over the whole solid gives the net flow across the surface, because
outflow from one interior cell is inflow to the next and cancels, leaving only the
boundary.

$$
% caption: The Divergence Theorem: outward flux across the closed boundary
% surface $S$ equals the integrated divergence over the enclosed solid $E$;
% interior outflows cancel, leaving only the boundary.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% a closed blobby solid
\fill[acc!10] (2.6,0.4) .. controls (4.4,0.4) and (4.6,2.2) .. (3.4,2.9)
  .. controls (2.2,3.5) and (0.4,2.6) .. (0.6,1.4)
  .. controls (0.8,0.6) and (1.6,0.4) .. (2.6,0.4) -- cycle;
\draw[acc, very thick] (2.6,0.4) .. controls (4.4,0.4) and (4.6,2.2) .. (3.4,2.9)
  .. controls (2.2,3.5) and (0.4,2.6) .. (0.6,1.4)
  .. controls (0.8,0.6) and (1.6,0.4) .. (2.6,0.4) -- cycle;
\node[font=\small] at (2.3,1.5) {$E$};
\node[acc, font=\small, anchor=north west] at (3.8,1.0) {boundary $S$};
% outward flux arrows around boundary
\foreach \a in {20,70,130,180,240,300} {
  \draw[black, thick, ->] ({2.4+1.7*cos(\a)},{1.6+1.2*sin(\a)}) -- ({2.4+2.1*cos(\a)},{1.6+1.5*sin(\a)});
}
\node[font=\small, anchor=north] at (2.4,-0.15) {outward f\/lux};
\end{tikzpicture}
$$

> **Worked example.** Find the outward flux of $\vec{F} = \langle x, y, z\rangle$
> across the unit sphere. Computing the surface integral directly required a full
> [parametrization of the sphere](/calculus/multiple-integrals-and-vector-calculus/surface-integrals);
> the Divergence Theorem does it in two lines. Since $\operatorname{div}\vec{F} = 1 + 1 + 1 = 3$,
>
> $$
> \iint\limits_S \vec{F}\cdot \d\vec{S} = \iiint\limits_E 3\,\d V = 3\cdot\text{vol}(E) = 3\cdot\tfrac{4}{3}\pi(1)^3 = 4\pi,
> $$
>
> matching the earlier flux computation and explaining its value. The theorem
> converts a hard surface integral into an easy volume integral whenever the
> divergence is simple.

> **Worked example.** Find the flux of
> $\vec{F} = \langle xy,\ y^2 + e^{xz^2},\ \sin(xy)\rangle$ outward across the
> boundary of the solid $E$ bounded by the parabolic cylinder $z = 1 - x^2$ and the
> planes $z = 0$, $y = 0$, $y + z = 2$. The surface has five faces; integrating over
> each would be tedious. But $\operatorname{div}\vec{F} = y + 2y + 0 = 3y$ is a
> polynomial, and $\iiint\limits_E 3y\,\d V$ over the described solid is a routine iterated
> integral. The Divergence Theorem replaces a five-face surface integral with a
> single triple integral. This asymmetry, one side far easier than the other, is
> the practical value of every theorem in the group.

## One theorem in every dimension

The four fundamental theorems of this subject share a form: the integral of a
derivative of $\vec{F}$ over an oriented region equals the integral of
$\vec{F}$ over the oriented boundary of that region.

$$
\int_{\text{region}} (\text{derivative of } \vec{F}) = \int_{\partial(\text{region})} \vec{F} .
$$

Each theorem instantiates it one dimension higher, with the derivative and the
boundary changing to match.

$$
% caption: The four fundamental theorems nest by dimension: each integrates a
% derivative of the field over a region and recovers the field on the oriented
% boundary of that region.
\begin{tikzpicture}[scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\node[draw, thick, align=center, minimum width=58mm, font=\small] (ftc) at (0,3.3)
  {FTC\\interval, two endpoints};
\node[draw, thick, align=center, minimum width=58mm, font=\small] (ftli) at (0,1.7)
  {Line integrals\\curve, two endpoints};
\node[draw, thick, align=center, minimum width=58mm, font=\small] (green) at (0,0.1)
  {Green / Stokes\\surface, boundary curve};
\node[draw, thick, align=center, minimum width=58mm, font=\small] (div) at (0,-1.5)
  {Divergence\\solid, boundary surface};
\draw[->, acc, thick] (ftc) -- (ftli);
\draw[->, acc, thick] (ftli) -- (green);
\draw[->, acc, thick] (green) -- (div);
\node[font=\small, anchor=west, text=acc] at (2.9,2.5) {add a dimension};
\end{tikzpicture}
$$

The correspondence is exact once the derivative and boundary are named for each
case.

| Theorem | Region | Boundary | Derivative of $\vec{F}$ | Statement |
| --- | --- | --- | --- | --- |
| FTC | interval $[a,b]$ | two endpoints | $F'$ | $\int_a^b F'\,\d x = F(b)-F(a)$ |
| Line integrals | curve $C$ | two endpoints | $\nabla f$ | $\int_C \nabla f\cdot \d\vec{r} = f(B)-f(A)$ |
| Green | plane region $D$ | closed curve $\partial D$ | $Q_x - P_y$ | $\oint\limits_{\partial D}\vec{F}\cdot \d\vec{r} = \iint\limits_D (Q_x-P_y)\,\d A$ |
| Stokes | surface $S$ | boundary curve $\partial S$ | $\operatorname{curl}\vec{F}$ | $\oint\limits_{\partial S}\vec{F}\cdot \d\vec{r} = \iint\limits_S \operatorname{curl}\vec{F}\cdot \d\vec{S}$ |
| Divergence | solid $E$ | closed surface $\partial E$ | $\operatorname{div}\vec{F}$ | $\iint\limits_{\partial E}\vec{F}\cdot \d\vec{S} = \iiint\limits_E \operatorname{div}\vec{F}\,\d V$ |

The three derivative operators — gradient, curl, divergence — are the successive
derivatives that appear as the dimension climbs, and the two identities
$\operatorname{curl}(\nabla f) = \vec{0}$ and
$\operatorname{div}(\operatorname{curl}\vec{F}) = 0$ from the
[curl-and-divergence lesson](/calculus/multiple-integrals-and-vector-calculus/greens-theorem-curl-and-divergence)
say that applying two consecutive operators annihilates the field. That is the
statement, in the language of vector calculus, that the boundary of a boundary is
empty: the edge of a surface is a closed loop with no endpoints, and the boundary
of a solid is a closed surface with no edge.

## Differential forms

The single form $\int_{\text{region}} \d\omega = \int_{\partial(\text{region})}\omega$
is made precise by the theory of differential forms, where FTC, Green's, Stokes',
and the Divergence Theorem are literally one equation, the **generalized Stokes'
Theorem**, applied to forms of degree $0$, $1$, and $2$. Vector calculus is the
three-dimensional case of that statement, and the operators gradient, curl, and
divergence are the exterior derivative acting on functions, vector fields, and
flux fields in turn.[^stewart168]

[^stewart168]: Stewart, §16.8 — Stokes' Theorem; §16.9 — The Divergence Theorem; §16.10 — Summary. The right-hand-rule orientation of a surface and its boundary, the surface-independence of the flux of a curl, and the unifying view of the fundamental theorems of vector calculus as one statement relating a region's interior derivative to its oriented boundary.
