BREAKING NEWS
Divergence theorem

## Summary

In vector calculus, the divergence theorem, also known as Gauss's theorem or Ostrogradsky's theorem,[1] is a theorem which relates the flux of a vector field through a closed surface to the divergence of the field in the volume enclosed.

More precisely, the divergence theorem states that the surface integral of a vector field over a closed surface, which is called the "flux" through the surface, is equal to the volume integral of the divergence over the region inside the surface. Intuitively, it states that "the sum of all sources of the field in a region (with sinks regarded as negative sources) gives the net flux out of the region".

The divergence theorem is an important result for the mathematics of physics and engineering, particularly in electrostatics and fluid dynamics. In these fields, it is usually applied in three dimensions. However, it generalizes to any number of dimensions. In one dimension, it is equivalent to integration by parts. In two dimensions, it is equivalent to Green's theorem.

## Explanation using liquid flow

Vector fields are often illustrated using the example of the velocity field of a fluid, such as a gas or liquid. A moving liquid has a velocity—a speed and a direction—at each point, which can be represented by a vector, so that the velocity of the liquid at any moment forms a vector field. Consider an imaginary closed surface S inside a body of liquid, enclosing a volume of liquid. The flux of liquid out of the volume is equal to the volume rate of fluid crossing this surface, i.e., the surface integral of the velocity over the surface.

Since liquids are incompressible, the amount of liquid inside a closed volume is constant; if there are no sources or sinks inside the volume then the flux of liquid out of S is zero. If the liquid is moving, it may flow into the volume at some points on the surface S and out of the volume at other points, but the amounts flowing in and out at any moment are equal, so the net flux of liquid out of the volume is zero.

However if a source of liquid is inside the closed surface, such as a pipe through which liquid is introduced, the additional liquid will exert pressure on the surrounding liquid, causing an outward flow in all directions. This will cause a net outward flow through the surface S. The flux outward through S equals the volume rate of flow of fluid into S from the pipe. Similarly if there is a sink or drain inside S, such as a pipe which drains the liquid off, the external pressure of the liquid will cause a velocity throughout the liquid directed inward toward the location of the drain. The volume rate of flow of liquid inward through the surface S equals the rate of liquid removed by the sink.

If there are multiple sources and sinks of liquid inside S, the flux through the surface can be calculated by adding up the volume rate of liquid added by the sources and subtracting the rate of liquid drained off by the sinks. The volume rate of flow of liquid through a source or sink (with the flow through a sink given a negative sign) is equal to the divergence of the velocity field at the pipe mouth, so adding up (integrating) the divergence of the liquid throughout the volume enclosed by S equals the volume rate of flux through S. This is the divergence theorem.[2]

The divergence theorem is employed in any conservation law which states that the total volume of all sinks and sources, that is the volume integral of the divergence, is equal to the net flow across the volume's boundary.[3]

## Mathematical statement

A region V bounded by the surface ${\displaystyle S=\partial V}$  with the surface normal n

Suppose V is a subset of ${\displaystyle \mathbb {R} ^{n}}$  (in the case of n = 3, V represents a volume in three-dimensional space) which is compact and has a piecewise smooth boundary S (also indicated with ${\displaystyle \partial V=S}$ ). If F is a continuously differentiable vector field defined on a neighborhood of V, then:[4][5]

${\displaystyle \iiint _{V}\left(\mathbf {\nabla } \cdot \mathbf {F} \right)\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {F} \cdot \mathbf {\hat {n}} )\,\mathrm {d} S.}$

The left side is a volume integral over the volume V, the right side is the surface integral over the boundary of the volume V. The closed manifold ${\displaystyle \partial V}$  is oriented by outward-pointing normals, and ${\displaystyle \mathbf {\hat {n}} }$  is the outward pointing unit normal at each point on the boundary ${\displaystyle \partial V}$ . (${\displaystyle \mathrm {d} \mathbf {S} }$  may be used as a shorthand for ${\displaystyle \mathbf {n} \mathrm {d} S}$ .) In terms of the intuitive description above, the left-hand side of the equation represents the total of the sources in the volume V, and the right-hand side represents the total flow across the boundary S.

## Proofs

### For bounded open subsets of Euclidean space

We are going to prove the following:

Theorem — Let ${\displaystyle \Omega \subset \mathbb {R} ^{n}}$  be open and bounded with ${\displaystyle C^{1}}$  boundary. If ${\displaystyle u}$  is ${\displaystyle C^{1}}$  on an open neighborhood ${\displaystyle O}$  of ${\displaystyle {\overline {\Omega }}}$ , that is, ${\displaystyle u\in C^{1}(O)}$ , then for each ${\displaystyle i\in \{1,\dots ,n\}}$ ,

${\displaystyle \int _{\Omega }u_{x_{i}}\,dV=\int _{\partial \Omega }u\nu _{i}\,dS,}$

where ${\displaystyle \nu :\partial \Omega \to \mathbb {R} ^{n}}$  is the outward pointing unit normal vector to ${\displaystyle \partial \Omega }$ . Equivalently,
${\displaystyle \int _{\Omega }\nabla u\,dV=\int _{\partial \Omega }u\nu \,dS.}$

Proof of Theorem. [6] (1) The first step is to reduce to the case where ${\displaystyle u\in C_{c}^{1}(\mathbb {R} ^{n})}$ . Pick ${\displaystyle \phi \in C_{c}^{\infty }(O)}$  such that ${\displaystyle \phi =1}$  on ${\displaystyle {\overline {\Omega }}}$ . Note that ${\displaystyle \phi u\in C_{c}^{1}(O)\subset C_{c}^{1}(\mathbb {R} ^{n})}$  and ${\displaystyle \phi u=u}$  on ${\displaystyle {\overline {\Omega }}}$ . Hence it suffices to prove the theorem for ${\displaystyle \phi u}$ . Hence we may assume that ${\displaystyle u\in C_{c}^{1}(\mathbb {R} ^{n})}$ .

(2) Let ${\displaystyle x_{0}\in \partial \Omega }$  be arbitrary. The assumption that ${\displaystyle {\overline {\Omega }}}$  has ${\displaystyle C^{1}}$  boundary means that there is an open neighborhood ${\displaystyle U}$  of ${\displaystyle x_{0}}$  in ${\displaystyle \mathbb {R} ^{n}}$  such that ${\displaystyle \partial \Omega \cap U}$  is the graph of a ${\displaystyle C^{1}}$  function with ${\displaystyle \Omega \cap U}$  lying on one side of this graph. More precisely, this means that after a translation and rotation of ${\displaystyle \Omega }$ , there are ${\displaystyle r>0}$  and ${\displaystyle h>0}$  and a ${\displaystyle C^{1}}$  function ${\displaystyle g:\mathbb {R} ^{n-1}\to \mathbb {R} }$ , such that with the notation

${\displaystyle x'=(x_{1},\dots ,x_{n-1}),}$

it holds that
${\displaystyle U=\{x\in \mathbb {R} ^{n}:|x'|

and for ${\displaystyle x\in U}$ ,
{\displaystyle {\begin{aligned}x_{n}=g(x')&\implies x\in \partial \Omega ,\\-h

Since ${\displaystyle \partial \Omega }$  is compact, we can cover ${\displaystyle \partial \Omega }$  with finitely many neighborhoods ${\displaystyle U_{1},\dots ,U_{N}}$  of the above form. Note that ${\displaystyle \{\Omega ,U_{1},\dots ,U_{N}\}}$  is an open cover of ${\displaystyle {\overline {\Omega }}=\Omega \cup \partial \Omega }$ . By using a ${\displaystyle C^{\infty }}$  partition of unity subordinate to this cover, it suffices to prove the theorem in the case where either ${\displaystyle u}$  has compact support in ${\displaystyle \Omega }$  or ${\displaystyle u}$  has compact support in some ${\displaystyle U_{j}}$ . If ${\displaystyle u}$  has compact support in ${\displaystyle \Omega }$ , then for all ${\displaystyle i\in \{1,\dots ,n\}}$ , ${\displaystyle \int _{\Omega }u_{x_{i}}\,dV=\int _{\mathbb {R} ^{n}}u_{x_{i}}\,dV=\int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{\infty }u_{x_{i}}(x)\,dx_{i}\,dx'=0}$  by the fundamental theorem of calculus, and ${\displaystyle \int _{\partial \Omega }u\nu _{i}\,dS=0}$  since ${\displaystyle u}$  vanishes on a neighborhood of ${\displaystyle \partial \Omega }$ . Thus the theorem holds for ${\displaystyle u}$  with compact support in ${\displaystyle \Omega }$ . Thus we have reduced to the case where ${\displaystyle u}$  has compact support in some ${\displaystyle U_{j}}$ .

(3) So assume ${\displaystyle u}$  has compact support in some ${\displaystyle U_{j}}$ . The last step now is to show that the theorem is true by direct computation. Change notation to ${\displaystyle U=U_{j}}$ , and bring in the notation from (2) used to describe ${\displaystyle U}$ . Note that this means that we have rotated and translated ${\displaystyle \Omega }$ . This is a valid reduction since the theorem is invariant under rotations and translations of coordinates. Since ${\displaystyle u(x)=0}$  for ${\displaystyle |x'|\geq r}$  and for ${\displaystyle |x_{n}-g(x')|\geq h}$ , we have for each ${\displaystyle i\in \{1,\dots ,n\}}$  that

{\displaystyle {\begin{aligned}\int _{\Omega }u_{x_{i}}\,dV&=\int _{|x'|

For ${\displaystyle i=n}$  we have by the fundamental theorem of calculus that
${\displaystyle \int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{g(x')}u_{x_{n}}(x',x_{n})\,dx_{n}\,dx'=\int _{\mathbb {R} ^{n-1}}u(x',g(x'))\,dx'.}$

Now fix ${\displaystyle i\in \{1,\dots ,n-1\}}$ . Note that
${\displaystyle \int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{g(x')}u_{x_{i}}(x',x_{n})\,dx_{n}\,dx'=\int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{0}u_{x_{i}}(x',g(x')+s)\,ds\,dx'}$

Define ${\displaystyle v:\mathbb {R} ^{n}\to \mathbb {R} }$  by ${\displaystyle v(x',s)=u(x',g(x')+s)}$ . By the chain rule,
${\displaystyle v_{x_{i}}(x',s)=u_{x_{i}}(x',g(x')+s)+u_{x_{n}}(x',g(x')+s)g_{x_{i}}(x').}$

But since ${\displaystyle v}$  has compact support, we can integrate out ${\displaystyle dx_{i}}$  first to deduce that
${\displaystyle \int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{0}v_{x_{i}}(x',s)\,ds\,dx'=0.}$

Thus
{\displaystyle {\begin{aligned}\int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{0}u_{x_{i}}(x',g(x')+s)\,ds\,dx'&=\int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{0}-u_{x_{n}}(x',g(x')+s)g_{x_{i}}(x')\,ds\,dx'\\&=\int _{\mathbb {R} ^{n-1}}-u(x',g(x'))g_{x_{i}}(x')\,dx'.\end{aligned}}}

In summary, with ${\displaystyle \nabla u=(u_{x_{1}},\dots ,u_{x_{n}})}$  we have
${\displaystyle \int _{\Omega }\nabla u\,dV=\int _{\mathbb {R} ^{n-1}}\int _{-\infty }^{g(x')}\nabla u\,dV=\int _{\mathbb {R} ^{n-1}}u(x',g(x'))(-\nabla g(x'),1)\,dx'.}$

Recall that the outward unit normal to the graph ${\displaystyle \Gamma }$  of ${\displaystyle g}$  at a point ${\displaystyle (x',g(x'))\in \Gamma }$  is ${\displaystyle \nu (x',g(x'))={\frac {1}{\sqrt {1+|\nabla g(x')|^{2}}}}(-\nabla g(x'),1)}$  and that the surface element ${\displaystyle dS}$  is given by ${\displaystyle dS={\sqrt {1+|\nabla g(x')|^{2}}}\,dx'}$ . Thus
${\displaystyle \int _{\Omega }\nabla u\,dV=\int _{\partial \Omega }u\nu \,dS.}$

This completes the proof.

### For compact Riemannian manifolds with boundary

We are going to prove the following:

Theorem — Let ${\displaystyle {\overline {\Omega }}}$  be a ${\displaystyle C^{2}}$  compact manifold with boundary with ${\displaystyle C^{1}}$  metric tensor ${\displaystyle g}$ . Let ${\displaystyle \Omega }$  denote the manifold interior of ${\displaystyle {\overline {\Omega }}}$  and let ${\displaystyle \partial \Omega }$  denote the manifold boundary of ${\displaystyle {\overline {\Omega }}}$ . Let ${\displaystyle (\cdot ,\cdot )}$  denote ${\displaystyle L^{2}({\overline {\Omega }})}$  inner products of functions and ${\displaystyle \langle \cdot ,\cdot \rangle }$  denote inner products of vectors. Suppose ${\displaystyle u\in C^{1}({\overline {\Omega }},\mathbb {R} )}$  and ${\displaystyle X}$  is a ${\displaystyle C^{1}}$  vector field on ${\displaystyle {\overline {\Omega }}}$ . Then

${\displaystyle (\operatorname {grad} u,X)=-(u,\operatorname {div} X)+\int _{\partial \Omega }u\langle X,N\rangle \,dS,}$

where ${\displaystyle N}$  is the outward-pointing unit normal vector to ${\displaystyle \partial \Omega }$ .

Proof of Theorem. [7] We use the Einstein summation convention. By using a partition of unity, we may assume that ${\displaystyle u}$  and ${\displaystyle X}$  have compact support in a coordinate patch ${\displaystyle O\subset {\overline {\Omega }}}$ . First consider the case where the patch is disjoint from ${\displaystyle \partial \Omega }$ . Then ${\displaystyle O}$  is identified with an open subset of ${\displaystyle \mathbb {R} ^{n}}$  and integration by parts produces no boundary terms:

{\displaystyle {\begin{aligned}(\operatorname {grad} u,X)&=\int _{O}\langle \operatorname {grad} u,X\rangle {\sqrt {g}}\,dx\\&=\int _{O}\partial _{j}uX^{j}{\sqrt {g}}\,dx\\&=-\int _{O}u\partial _{j}({\sqrt {g}}X^{j})\,dx\\&=-\int _{O}u{\frac {1}{\sqrt {g}}}\partial _{j}({\sqrt {g}}X^{j}){\sqrt {g}}\,dx\\&=(u,-{\frac {1}{\sqrt {g}}}\partial _{j}({\sqrt {g}}X^{j}))\\&=(u,-\operatorname {div} X).\end{aligned}}}

In the last equality we used the Voss-Weyl coordinate formula for the divergence, although the preceding identity could be used to define ${\displaystyle -\operatorname {div} }$  as the formal adjoint of ${\displaystyle \operatorname {grad} }$ . Now suppose ${\displaystyle O}$  intersects ${\displaystyle \partial \Omega }$ . Then ${\displaystyle O}$  is identified with an open set in ${\displaystyle \mathbb {R} _{+}^{n}=\{x\in \mathbb {R} ^{n}:x_{n}\geq 0\}}$ . We zero extend ${\displaystyle u}$  and ${\displaystyle X}$  to ${\displaystyle \mathbb {R} _{+}^{n}}$  and perform integration by parts to obtain
{\displaystyle {\begin{aligned}(\operatorname {grad} u,X)&=\int _{O}\langle \operatorname {grad} u,X\rangle {\sqrt {g}}\,dx\\&=\int _{\mathbb {R} _{+}^{n}}\partial _{j}uX^{j}{\sqrt {g}}\,dx\\&=(u,-\operatorname {div} X)-\int _{\mathbb {R} ^{n-1}}u(x',0)X^{n}(x',0){\sqrt {g(x',0)}}\,dx',\end{aligned}}}

where ${\displaystyle dx'=dx_{1}\dots dx_{n-1}}$ . By a variant of the straightening theorem for vector fields, we may choose ${\displaystyle O}$  so that ${\displaystyle {\frac {\partial }{\partial x_{n}}}}$  is the inward unit normal ${\displaystyle -N}$  at ${\displaystyle \partial \Omega }$ . In this case ${\displaystyle {\sqrt {g(x',0)}}\,dx'={\sqrt {g_{\partial \Omega }(x')}}\,dx'=dS}$  is the volume element on ${\displaystyle \partial \Omega }$  and the above formula reads
${\displaystyle (\operatorname {grad} u,X)=(u,-\operatorname {div} X)+\int _{\partial \Omega }u\langle X,N\rangle \,dS.}$

This completes the proof.

## Informal derivation

The divergence theorem follows from the fact that if a volume V is partitioned into separate parts, the flux out of the original volume is equal to the sum of the flux out of each component volume.[8][9] This is true despite the fact that the new subvolumes have surfaces that were not part of the original volume's surface, because these surfaces are just partitions between two of the subvolumes and the flux through them just passes from one volume to the other and so cancels out when the flux out of the subvolumes is summed.

A volume divided into two subvolumes. At right the two subvolumes are separated to show the flux out of the different surfaces.

See the diagram. A closed, bounded volume V is divided into two volumes V1 and V2 by a surface S3 (green). The flux Φ(Vi) out of each component region Vi is equal to the sum of the flux through its two faces, so the sum of the flux out of the two parts is

${\displaystyle \Phi (V_{\text{1}})+\Phi (V_{\text{2}})=\Phi _{\text{1}}+\Phi _{\text{31}}+\Phi _{\text{2}}+\Phi _{\text{32}}}$

where Φ1 and Φ2 are the flux out of surfaces S1 and S2, Φ31 is the flux through S3 out of volume 1, and Φ32 is the flux through S3 out of volume 2. The point is that surface S3 is part of the surface of both volumes. The "outward" direction of the normal vector ${\displaystyle \mathbf {\hat {n}} }$  is opposite for each volume, so the flux out of one through S3 is equal to the negative of the flux out of the other

${\displaystyle \Phi _{\text{31}}=\iint _{S_{3}}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S=-\iint _{S_{3}}\mathbf {F} \cdot (-\mathbf {\hat {n}} )\;\mathrm {d} S=-\Phi _{\text{32}}}$

so these two fluxes cancel in the sum. Therefore

${\displaystyle \Phi (V_{\text{1}})+\Phi (V_{\text{2}})=\Phi _{\text{1}}+\Phi _{\text{2}}}$

Since the union of surfaces S1 and S2 is S

${\displaystyle \Phi (V_{\text{1}})+\Phi (V_{\text{2}})=\Phi (V)}$

The volume can be divided into any number of subvolumes and the flux out of V is equal to the sum of the flux out of each subvolume, because the flux through the green surfaces cancels out in the sum. In (b) the volumes are shown separated slightly, illustrating that each green partition is part of the boundary of two adjacent volumes

This principle applies to a volume divided into any number of parts, as shown in the diagram.[9] Since the integral over each internal partition (green surfaces) appears with opposite signs in the flux of the two adjacent volumes they cancel out, and the only contribution to the flux is the integral over the external surfaces (grey). Since the external surfaces of all the component volumes equal the original surface.

${\displaystyle \Phi (V)=\sum _{V_{\text{i}}\subset V}\Phi (V_{\text{i}})}$

As the volume is subdivided into smaller parts, the ratio of the flux ${\displaystyle \Phi (V_{\text{i}})}$  out of each volume to the volume ${\displaystyle |V_{\text{i}}|}$  approaches ${\displaystyle \operatorname {div} \mathbf {F} }$

The flux Φ out of each volume is the surface integral of the vector field F(x) over the surface

${\displaystyle \iint _{S(V)}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S=\sum _{V_{\text{i}}\subset V}\iint _{S(V_{\text{i}})}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S}$

The goal is to divide the original volume into infinitely many infinitesimal volumes. As the volume is divided into smaller and smaller parts, the surface integral on the right, the flux out of each subvolume, approaches zero because the surface area S(Vi) approaches zero. However, from the definition of divergence, the ratio of flux to volume, ${\displaystyle {\frac {\Phi (V_{\text{i}})}{|V_{\text{i}}|}}={\frac {1}{|V_{\text{i}}|}}\iint _{S(V_{\text{i}})}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S}$ , the part in parentheses below, does not in general vanish but approaches the divergence div F as the volume approaches zero.[9]

${\displaystyle \iint _{S(V)}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S=\sum _{V_{\text{i}}\subset V}\left({\frac {1}{|V_{\text{i}}|}}\iint _{S(V_{\text{i}})}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S\right)|V_{\text{i}}|}$

As long as the vector field F(x) has continuous derivatives, the sum above holds even in the limit when the volume is divided into infinitely small increments

${\displaystyle \iint _{S(V)}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S=\lim _{|V_{\text{i}}|\to 0}\sum _{V_{\text{i}}\subset V}\left({\frac {1}{|V_{\text{i}}|}}\iint _{S(V_{\text{i}})}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S\right)|V_{\text{i}}|}$

As ${\displaystyle |V_{\text{i}}|}$  approaches zero volume, it becomes the infinitesimal dV, the part in parentheses becomes the divergence, and the sum becomes a volume integral over V

${\displaystyle \;\iint _{S(V)}\mathbf {F} \cdot \mathbf {\hat {n}} \;\mathrm {d} S=\iiint _{V}\operatorname {div} \mathbf {F} \;\mathrm {d} V\;}$

Since this derivation is coordinate free, it shows that the divergence does not depend on the coordinates used.

## Corollaries

By replacing F in the divergence theorem with specific forms, other useful identities can be derived (cf. vector identities).[10]

• With ${\displaystyle \mathbf {F} \rightarrow \mathbf {F} g}$  for a scalar function g and a vector field F,
${\displaystyle \iiint _{V}\left[\mathbf {F} \cdot \left(\nabla g\right)+g\left(\nabla \cdot \mathbf {F} \right)\right]\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle g\mathbf {F} \cdot \mathbf {n} \mathrm {d} S.}$
A special case of this is ${\displaystyle \mathbf {F} =\nabla f}$ , in which case the theorem is the basis for Green's identities.
• With ${\displaystyle \mathbf {F} \rightarrow \mathbf {F} \times \mathbf {G} }$  for two vector fields F and G, where ${\displaystyle \times }$  denotes a cross product,
${\displaystyle \iiint _{V}\nabla \cdot \left(\mathbf {F} \times \mathbf {G} \right)\mathrm {d} V=\iiint _{V}\left[\mathbf {G} \cdot \left(\nabla \times \mathbf {F} \right)-\mathbf {F} \cdot \left(\nabla \times \mathbf {G} \right)\right]\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {F} \times \mathbf {G} )\cdot \mathbf {n} \mathrm {d} S.}$
• With ${\displaystyle \mathbf {F} \rightarrow \mathbf {F} \cdot \mathbf {G} }$  for two vector fields F and G, where ${\displaystyle \cdot }$  denotes a dot product,
${\displaystyle \iiint _{V}\nabla \left(\mathbf {F} \cdot \mathbf {G} \right)\mathrm {d} V=\iiint _{V}\left[\mathbf {F} \cdot \left(\nabla \cdot \mathbf {G} \right)+\left(\nabla \cdot \mathbf {F} \right)\cdot \mathbf {G} \right]\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {F} \cdot \mathbf {G} )\cdot \mathbf {n} \mathrm {d} S.}$
• With ${\displaystyle \mathbf {F} \rightarrow f\mathbf {c} }$  for a scalar function f and vector field c:[11]
${\displaystyle \iiint _{V}\mathbf {c} \cdot \nabla f\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {c} f)\cdot \mathbf {n} \mathrm {d} S-\iiint _{V}f(\nabla \cdot \mathbf {c} )\,\mathrm {d} V.}$
The last term on the right vanishes for constant ${\displaystyle \mathbf {c} }$  or any divergence free (solenoidal) vector field, e.g. Incompressible flows without sources or sinks such as phase change or chemical reactions etc. In particular, taking ${\displaystyle \mathbf {c} }$  to be constant:
${\displaystyle \iiint _{V}\nabla f\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle f\mathbf {n} \mathrm {d} S.}$
• With ${\displaystyle \mathbf {F} \rightarrow \mathbf {c} \times \mathbf {F} }$  for vector field F and constant vector c:[11]
${\displaystyle \iiint _{V}\mathbf {c} \cdot (\nabla \times \mathbf {F} )\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {F} \times \mathbf {c} )\cdot \mathbf {n} \mathrm {d} S.}$
By reordering the triple product on the right hand side and taking out the constant vector of the integral,
${\displaystyle \iiint _{V}(\nabla \times \mathbf {F} )\,\mathrm {d} V\cdot \mathbf {c} =}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathrm {d} \mathbf {S} \times \mathbf {F} )\cdot \mathbf {c} .}$
Hence,
${\displaystyle \iiint _{V}(\nabla \times \mathbf {F} )\,\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle \mathbf {n} \times \mathbf {F} \mathrm {d} S.}$

## Example

The vector field corresponding to the example shown. Vectors may point into or out of the sphere.

The divergence theorem can be used to calculate a flux through a closed surface that fully encloses a volume, like any of the surfaces on the left. It can not directly be used to calculate the flux through surfaces with boundaries, like those on the right. (Surfaces are blue, boundaries are red.)

Suppose we wish to evaluate

${\displaystyle \scriptstyle S}$  ${\displaystyle \mathbf {F} \cdot \mathbf {n} \,\mathrm {d} S,}$

where S is the unit sphere defined by

${\displaystyle S=\left\{(x,y,z)\in \mathbb {R} ^{3}\ :\ x^{2}+y^{2}+z^{2}=1\right\},}$

and F is the vector field

${\displaystyle \mathbf {F} =2x\mathbf {i} +y^{2}\mathbf {j} +z^{2}\mathbf {k} .}$

The direct computation of this integral is quite difficult, but we can simplify the derivation of the result using the divergence theorem, because the divergence theorem says that the integral is equal to:

${\displaystyle \iiint _{W}(\nabla \cdot \mathbf {F} )\,\mathrm {d} V=2\iiint _{W}(1+y+z)\,\mathrm {d} V=2\iiint _{W}\mathrm {d} V+2\iiint _{W}y\,\mathrm {d} V+2\iiint _{W}z\,\mathrm {d} V,}$

where W is the unit ball:

${\displaystyle W=\left\{(x,y,z)\in \mathbb {R} ^{3}\ :\ x^{2}+y^{2}+z^{2}\leq 1\right\}.}$

Since the function y is positive in one hemisphere of W and negative in the other, in an equal and opposite way, its total integral over W is zero. The same is true for z:

${\displaystyle \iiint _{W}y\,\mathrm {d} V=\iiint _{W}z\,\mathrm {d} V=0.}$

Therefore,

${\displaystyle \scriptstyle S}$  ${\displaystyle \mathbf {F} \cdot \mathbf {n} \,\mathrm {d} S=2\iiint _{W}\,dV={\frac {8\pi }{3}},}$

because the unit ball W has volume 4π/3.

## Applications

### Differential and integral forms of physical laws

As a result of the divergence theorem, a host of physical laws can be written in both a differential form (where one quantity is the divergence of another) and an integral form (where the flux of one quantity through a closed surface is equal to another quantity). Three examples are Gauss's law (in electrostatics), Gauss's law for magnetism, and Gauss's law for gravity.

#### Continuity equations

Continuity equations offer more examples of laws with both differential and integral forms, related to each other by the divergence theorem. In fluid dynamics, electromagnetism, quantum mechanics, relativity theory, and a number of other fields, there are continuity equations that describe the conservation of mass, momentum, energy, probability, or other quantities. Generically, these equations state that the divergence of the flow of the conserved quantity is equal to the distribution of sources or sinks of that quantity. The divergence theorem states that any such continuity equation can be written in a differential form (in terms of a divergence) and an integral form (in terms of a flux).[12]

### Inverse-square laws

Any inverse-square law can instead be written in a Gauss's law-type form (with a differential and integral form, as described above). Two examples are Gauss's law (in electrostatics), which follows from the inverse-square Coulomb's law, and Gauss's law for gravity, which follows from the inverse-square Newton's law of universal gravitation. The derivation of the Gauss's law-type equation from the inverse-square formulation or vice versa is exactly the same in both cases; see either of those articles for details.[12]

## History

Joseph-Louis Lagrange introduced the notion of surface integrals in 1760 and again in more general terms in 1811, in the second edition of his Mécanique Analytique. Lagrange employed surface integrals in his work on fluid mechanics.[13] He discovered the divergence theorem in 1762.[14]

Carl Friedrich Gauss was also using surface integrals while working on the gravitational attraction of an elliptical spheroid in 1813, when he proved special cases of the divergence theorem.[15][13] He proved additional special cases in 1833 and 1839.[16] But it was Mikhail Ostrogradsky, who gave the first proof of the general theorem, in 1826, as part of his investigation of heat flow.[17] Special cases were proven by George Green in 1828 in An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism,[18][16] Siméon Denis Poisson in 1824 in a paper on elasticity, and Frédéric Sarrus in 1828 in his work on floating bodies.[19][16]

## Worked examples

### Example 1

To verify the planar variant of the divergence theorem for a region ${\displaystyle R}$ :

${\displaystyle R=\left\{(x,y)\in \mathbb {R} ^{2}\ :\ x^{2}+y^{2}\leq 1\right\},}$

and the vector field:

${\displaystyle \mathbf {F} (x,y)=2y\mathbf {i} +5x\mathbf {j} .}$

The boundary of ${\displaystyle R}$  is the unit circle, ${\displaystyle C}$ , that can be represented parametrically by:

${\displaystyle x=\cos(s),\quad y=\sin(s)}$

such that ${\displaystyle 0\leq s\leq 2\pi }$  where ${\displaystyle s}$  units is the length arc from the point ${\displaystyle s=0}$  to the point ${\displaystyle P}$  on ${\displaystyle C}$ . Then a vector equation of ${\displaystyle C}$  is

${\displaystyle C(s)=\cos(s)\mathbf {i} +\sin(s)\mathbf {j} .}$

At a point ${\displaystyle P}$  on ${\displaystyle C}$ :

${\displaystyle P=(\cos(s),\,\sin(s))\,\Rightarrow \,\mathbf {F} =2\sin(s)\mathbf {i} +5\cos(s)\mathbf {j} .}$

Therefore,

{\displaystyle {\begin{aligned}\oint _{C}\mathbf {F} \cdot \mathbf {n} \,\mathrm {d} s&=\int _{0}^{2\pi }(2\sin(s)\mathbf {i} +5\cos(s)\mathbf {j} )\cdot (\cos(s)\mathbf {i} +\sin(s)\mathbf {j} )\,\mathrm {d} s\\&=\int _{0}^{2\pi }(2\sin(s)\cos(s)+5\sin(s)\cos(s))\,\mathrm {d} s\\&=7\int _{0}^{2\pi }\sin(s)\cos(s)\,\mathrm {d} s\\&=0.\end{aligned}}}

Because ${\displaystyle M=2y}$ , we can evaluate ${\displaystyle {\frac {\partial M}{\partial x}}=0}$ , and because ${\displaystyle N=5x}$ , ${\displaystyle {\frac {\partial N}{\partial y}}=0}$ . Thus

${\displaystyle \iint _{R}\,\mathbf {\nabla } \cdot \mathbf {F} \,\mathrm {d} A=\iint _{R}\left({\frac {\partial M}{\partial x}}+{\frac {\partial N}{\partial y}}\right)\,\mathrm {d} A=0.}$

### Example 2

Let's say we wanted to evaluate the flux of the following vector field defined by ${\displaystyle \mathbf {F} =2x^{2}{\textbf {i}}+2y^{2}{\textbf {j}}+2z^{2}{\textbf {k}}}$  bounded by the following inequalities:

${\displaystyle \left\{0\leq x\leq 3\right\}\left\{-2\leq y\leq 2\right\}\left\{0\leq z\leq 2\pi \right\}}$

By the divergence theorem,

${\displaystyle \iiint _{V}\left(\mathbf {\nabla } \cdot \mathbf {F} \right)\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle (\mathbf {F} \cdot \mathbf {n} )\,\mathrm {d} S.}$

We now need to determine the divergence of ${\displaystyle {\textbf {F}}}$ . If ${\displaystyle \mathbf {F} }$  is a three-dimensional vector field, then the divergence of ${\displaystyle {\textbf {F}}}$  is given by ${\textstyle \nabla \cdot {\textbf {F}}=\left({\frac {\partial }{\partial x}}{\textbf {i}}+{\frac {\partial }{\partial y}}{\textbf {j}}+{\frac {\partial }{\partial z}}{\textbf {k}}\right)\cdot {\textbf {F}}}$ .

Thus, we can set up the following flux integral ${\displaystyle I=}$   ${\displaystyle {\scriptstyle S}}$  ${\displaystyle \mathbf {F} \cdot \mathbf {n} \,\mathrm {d} S,}$  as follows:

{\displaystyle {\begin{aligned}I&=\iiint _{V}\nabla \cdot \mathbf {F} \,\mathrm {d} V\\[6pt]&=\iiint _{V}\left({\frac {\partial \mathbf {F_{x}} }{\partial x}}+{\frac {\partial \mathbf {F_{y}} }{\partial y}}+{\frac {\partial \mathbf {F_{z}} }{\partial z}}\right)\mathrm {d} V\\[6pt]&=\iiint _{V}(4x+4y+4z)\,\mathrm {d} V\\[6pt]&=\int _{0}^{3}\int _{-2}^{2}\int _{0}^{2\pi }(4x+4y+4z)\,\mathrm {d} V\end{aligned}}}

Now that we have set up the integral, we can evaluate it.

{\displaystyle {\begin{aligned}\int _{0}^{3}\int _{-2}^{2}\int _{0}^{2\pi }(4x+4y+4z)\,\mathrm {d} V&=\int _{-2}^{2}\int _{0}^{2\pi }(12y+12z+18)\,\mathrm {d} y\,\mathrm {d} z\\[6pt]&=\int _{0}^{2\pi }24(2z+3)\,\mathrm {d} z\\[6pt]&=48\pi (2\pi +3)\end{aligned}}}

## Generalizations

### Multiple dimensions

One can use the general Stokes' Theorem to equate the n-dimensional volume integral of the divergence of a vector field F over a region U to the (n − 1)-dimensional surface integral of F over the boundary of U:

${\displaystyle \underbrace {\int \cdots \int _{U}} _{n}\nabla \cdot \mathbf {F} \,\mathrm {d} V=\underbrace {\oint _{}\cdots \oint _{\partial U}} _{n-1}\mathbf {F} \cdot \mathbf {n} \,\mathrm {d} S}$

This equation is also known as the divergence theorem.

When n = 2, this is equivalent to Green's theorem.

When n = 1, it reduces to the fundamental theorem of calculus, part 2.

### Tensor fields

Writing the theorem in Einstein notation:

${\displaystyle \iiint _{V}{\dfrac {\partial \mathbf {F} _{i}}{\partial x_{i}}}\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle \mathbf {F} _{i}n_{i}\,\mathrm {d} S}$

suggestively, replacing the vector field F with a rank-n tensor field T, this can be generalized to:[20]

${\displaystyle \iiint _{V}{\dfrac {\partial T_{i_{1}i_{2}\cdots i_{q}\cdots i_{n}}}{\partial x_{i_{q}}}}\mathrm {d} V=}$   ${\displaystyle \scriptstyle S}$  ${\displaystyle T_{i_{1}i_{2}\cdots i_{q}\cdots i_{n}}n_{i_{q}}\,\mathrm {d} S.}$

where on each side, tensor contraction occurs for at least one index. This form of the theorem is still in 3d, each index takes values 1, 2, and 3. It can be generalized further still to higher (or lower) dimensions (for example to 4d spacetime in general relativity[21]).

## References

1. ^ Katz, Victor J. (1979). "The history of Stokes's theorem". Mathematics Magazine. 52 (3): 146–156. doi:10.2307/2690275. JSTOR 2690275. reprinted in Anderson, Marlow (2009). Who Gave You the Epsilon?: And Other Tales of Mathematical History. Mathematical Association of America. pp. 78–79. ISBN 978-0883855690.
2. ^ R. G. Lerner; G. L. Trigg (1994). Encyclopaedia of Physics (2nd ed.). VHC. ISBN 978-3-527-26954-9.
3. ^ Byron, Frederick; Fuller, Robert (1992), Mathematics of Classical and Quantum Physics, Dover Publications, p. 22, ISBN 978-0-486-67164-2
4. ^ Wiley, C. Ray, Jr. Advanced Engineering Mathematics, 3rd Ed. McGraw-Hill. pp. 372–373.
5. ^ Kreyszig, Erwin; Kreyszig, Herbert; Norminton, Edward J. (2011). Advanced Engineering Mathematics (10 ed.). John Wiley and Sons. pp. 453–456. ISBN 9780470458365.
6. ^ Alt, Hans Wilhelm (2016). "Linear Functional Analysis". Universitext. London: Springer London. pp. 259–261, 270–272. doi:10.1007/978-1-4471-7280-2. ISBN 978-1-4471-7279-6. ISSN 0172-5939.
7. ^ Taylor, Michael E. (2011). "Partial Differential Equations I". Applied Mathematical Sciences. New York, NY: Springer New York. pp. 178–179. doi:10.1007/978-1-4419-7055-8. ISBN 978-1-4419-7054-1. ISSN 0066-5452.
8. ^ Benford, Frank A. (May 2007). "Notes on Vector Calculus" (PDF). Course materials for Math 105: Multivariable Calculus. Prof. Steven Miller's webpage, Williams College. Retrieved 14 March 2022.
9. ^ a b c Purcell, Edward M.; David J. Morin (2013). Electricity and Magnetism. Cambridge Univ. Press. pp. 56–58. ISBN 978-1107014022.
10. ^ M. R. Spiegel; S. Lipschutz; D. Spellman (2009). Vector Analysis. Schaum’s Outlines (2nd ed.). USA: McGraw Hill. ISBN 978-0-07-161545-7.
11. ^ a b MathWorld
12. ^ a b C.B. Parker (1994). McGraw Hill Encyclopaedia of Physics (2nd ed.). McGraw Hill. ISBN 978-0-07-051400-3.
13. ^ a b Katz, Victor (2009). "Chapter 22: Vector Analysis". A History of Mathematics: An Introduction. Addison-Wesley. pp. 808–9. ISBN 978-0-321-38700-4.
14. ^ In his 1762 paper on sound, Lagrange treats a special case of the divergence theorem: Lagrange (1762) "Nouvelles recherches sur la nature et la propagation du son" (New researches on the nature and propagation of sound), Miscellanea Taurinensia (also known as: Mélanges de Turin ), 2: 11 – 172. This article is reprinted as: "Nouvelles recherches sur la nature et la propagation du son" in: J.A. Serret, ed., Oeuvres de Lagrange, (Paris, France: Gauthier-Villars, 1867), vol. 1, pages 151–316; on pages 263–265, Lagrange transforms triple integrals into double integrals using integration by parts.
15. ^ C. F. Gauss (1813) "Theoria attractionis corporum sphaeroidicorum ellipticorum homogeneorum methodo nova tractata," Commentationes societatis regiae scientiarium Gottingensis recentiores, 2: 355–378; Gauss considered a special case of the theorem; see the 4th, 5th, and 6th pages of his article.
16. ^ a b c Katz, Victor (May 1979). "A History of Stokes' Theorem". Mathematics Magazine. 52 (3): 146–156. doi:10.1080/0025570X.1979.11976770. JSTOR 2690275.
17. ^ Mikhail Ostragradsky presented his proof of the divergence theorem to the Paris Academy in 1826; however, his work was not published by the Academy. He returned to St. Petersburg, Russia, where in 1828–1829 he read the work that he'd done in France, to the St. Petersburg Academy, which published his work in abbreviated form in 1831.
• His proof of the divergence theorem – "Démonstration d'un théorème du calcul intégral" (Proof of a theorem in integral calculus) – which he had read to the Paris Academy on February 13, 1826, was translated, in 1965, into Russian together with another article by him. See: Юшкевич А.П. (Yushkevich A.P.) and Антропова В.И. (Antropov V.I.) (1965) "Неопубликованные работы М.В. Остроградского" (Unpublished works of MV Ostrogradskii), Историко-математические исследования (Istoriko-Matematicheskie Issledovaniya / Historical-Mathematical Studies), 16: 49–96; see the section titled: "Остроградский М.В. Доказательство одной теоремы интегрального исчисления" (Ostrogradskii M. V. Dokazatelstvo odnoy teoremy integralnogo ischislenia / Ostragradsky M.V. Proof of a theorem in integral calculus).
• M. Ostrogradsky (presented: November 5, 1828 ; published: 1831) "Première note sur la théorie de la chaleur" (First note on the theory of heat) Mémoires de l'Académie impériale des sciences de St. Pétersbourg, series 6, 1: 129–133; for an abbreviated version of his proof of the divergence theorem, see pages 130–131.
• Victor J. Katz (May1979) "The history of Stokes' theorem," Archived April 2, 2015, at the Wayback Machine Mathematics Magazine, 52(3): 146–156; for Ostragradsky's proof of the divergence theorem, see pages 147–148.
18. ^ George Green, An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism (Nottingham, England: T. Wheelhouse, 1838). A form of the "divergence theorem" appears on pages 10–12.
19. ^ Other early investigators who used some form of the divergence theorem include:
• Poisson (presented: February 2, 1824 ; published: 1826) "Mémoire sur la théorie du magnétisme" (Memoir on the theory of magnetism), Mémoires de l'Académie des sciences de l'Institut de France, 5: 247–338; on pages 294–296, Poisson transforms a volume integral (which is used to evaluate a quantity Q) into a surface integral. To make this transformation, Poisson follows the same procedure that is used to prove the divergence theorem.
• Frédéric Sarrus (1828) "Mémoire sur les oscillations des corps flottans" (Memoir on the oscillations of floating bodies), Annales de mathématiques pures et appliquées (Nismes), 19: 185–211.
20. ^ K.F. Riley; M.P. Hobson; S.J. Bence (2010). Mathematical methods for physics and engineering. Cambridge University Press. ISBN 978-0-521-86153-3.
21. ^ see for example:
J.A. Wheeler; C. Misner; K.S. Thorne (1973). Gravitation. W.H. Freeman & Co. pp. 85–86, §3.5. ISBN 978-0-7167-0344-0., and
R. Penrose (2007). The Road to Reality. Vintage books. ISBN 978-0-679-77631-4.