Divergence theorem is green's theorem extended to oriented surfaces and vector fields in R3. The rate of change of amount of fluid inside a solid Q bounded by a surface $\partial Q$ can be computed in two ways. One way, it can be viewed as the flow into or out of Q across the boundary $\partial Q$ which is given by the Flux integral $\int \int _{\partial Q}F . ndS$. On the other hand, it can be considered as the sum of collection or dispersal of fluid at each point inside Q, which is given by the triple integral $\int \int \int _{Q}\bigtriangledown . F(x,y,z)dV$

Divergence Theorem

We thus, get an extension of Green's theorem known as Gauss's Divergence theorem.
$\int \int _{\partial Q}F.ndS$ = $\int \int \int _{Q}\bigtriangledown .F(x,y,z)dV$

Suppose Q is a simple solid region bounded by the surface $\partial Q$ and n(x,y,z) denotes the outward normal vector of $\partial Q$. Let F(x,y,z) be a vector field, whose components have continuous partial derivatives in an open region containing Q. Then,
$\int \int _{\partial Q}F.ndS$ = $\int \int \int _{Q}\bigtriangledown .F(x,y,z)dV$

To put the theorem in other words, it can be stated that the Flux integral of a continuously differentiable vector field across a boundary surface is equal to the integral of divergence of that vector field within the region enclosed by the boundary.

Using the divergence theorem, it can be proved, that the divergence of a vector field F at an interior point P0 is equal to the limiting value of the flux per unit volume over a sphere centered at P0, as the radius of the sphere tends to zero.

div F(P0) = $\lim_{a\rightarrow 0}\frac{1}{V_{a}}\int \int _{S_{a}}F.ndS$
Let F(x,y,z) = M(x,y,z)i + N(x,y,z)j + P(x,y,z)k
Hence, div F = $\bigtriangledown$ F = $\frac{\partial M}{\partial x}+\frac{\partial N}{\partial y}+\frac{\partial P}{\partial z}$

$\int \int \int _{Q}\bigtriangledown .F(x,y,z)dV$ = $\int \int \int _{Q}$$\frac{\partial M}{\partial x}$$dV + \int \int \int _{Q}$$\frac{\partial N}{\partial y}$$ + \int \int \int _{Q}$$\frac{\partial P}{\partial z}$

The flux integral on the left side can be written as
$\int \int _{\partial Q}F.ndS$ = $\int \int _{\partial Q}(M(x,y,z)i+N(x,y,z)j+P(x,y,z)k.ndS$
                        = $\int \int _{\partial Q}M(x,y,z)i.ndS+\int \int _{\partial Q}N(x,y,z)j.ndS+\int \int _{\partial Q}P(x,y,z)k.ndS$

Hence to prove the divergence theorem, it is sufficient to prove,
$\int \int \int _{Q}$$\frac{\partial M}{\partial x}$$dV$ = $\int \int _{\partial Q}M(x,y,z)i.ndS$         -----------------(1)

$\int \int \int _{Q}$$\frac{\partial N}{\partial y}$$dV$ = $\int \int _{\partial Q}N(x,y,z)j.ndS$          -----------------(2)

$\int \int \int _{Q}$$\frac{\partial P}{\partial z}$$dV$ = $\int \int _{\partial Q}P(x,y,z)k.ndS$          -----------------(3)

We prove the equation (3) above defining the region Q as follows:
Q = {(x, y, z) | g(x, y) $\leq$ z $\leq$ h(x, y), for (x, y) $\epsilon$ D}    
In other words, D is the projection of Q on (x,y) plane.

Divergence Theorem Proof

Hence, the triple integral equation (3) can be rewritten as

$\int \int \int _{Q}$$\frac{\partial P}{\partial z}$$dV$ = $\int \int _{D}[\int_{g(x,y))}^{h(x,y))}$$\frac{\partial P}{\partial z}$$(x,y,z)dz]dA$

$\int \int \int _{Q}$$\frac{\partial P}{\partial z}$$dV$ = $\int \int _{D}[P(x,y,h(x,y)) - P(x,y,g(x,y))]dA$         -----------(4)   (By Fundamental Theorem of Calculus)

The boundary surface $\partial Q$ consists of three pieces, the bottom surface S1, the top surface S2 and a vertical surface S3. In some cases, as on a spherical surface, $\partial Q$ will not contain the vertical surface S3. If the vertical surface S3 is present, then on S3, we have k.n = 0, since the unit normal vector n is horizontal and k is vertical.

Hence, $\int \int _{S_{3}}P(x,y,z)k.ndS= \int \int _{S_{3}}0dS$ = 0

$\int \int _{S}P(x,y,z)k.ndS=\int \int _{S_{1}}P(x,y,z)k.ndS+\int \int _{S_{2}}P(x,y,z)k.ndS$     --------------------------------(5)

On the surface S2, the normal n points upwards, while it points downwards on S1.
Using evaluation theorem, the surface integrals can be written as double integrals over D as follows:

$\int \int _{S_{2}}P(x,y,z)k.ndS=\int \int _{D}P(x,y,h(x,y))dA$

$\int \int _{S_{1}}P(x,y,z)k.ndS=-\int \int _{D}P(x,y,g(x,y))dA$

Hence, equation (5) can be written as

$\int \int _{S}P(x,y,z)k.ndS=\int \int _{D}P(x,y,h(x,y))dA-\int \int _{D}P(x,y,g(x,y))dA$

Comparing this with equation (4), we get equation (3) proved.

$\int \int \int _{Q}$$\frac{\partial P}{\partial z}$$dV$ = $\int \int _{\partial Q}P(x,y,z)k.ndS$

Equations (1) and (2) can also be proved in a similar manner, defining the region Q suitable.
Given below are some of the examples on gauss divergence theorem.

Solved Examples

Question 1: Find the flux of the vector field, F(X) = ex sin(y) i + ex cos(y) j + yz2 k over the Surface S bounded by the planes x = 0,  x = 1, y = 0, y = 1, z = 0 and z = 2.
Solution:
Divergence Theorem Examples

The composite Surface S is formed by the six faces of a cuboid as shown in the diagram. If we are to calculate the flux integral direct, then we need to evaluate the integral over six regions, the six faces of the cuboid. It is easier to calculate using the triple integral applying divergence theorem.
  
$\bigtriangledown$.F(X) = $\frac{\partial }{\partial x}$$(e^{x}sin(y)) + $$\frac{\partial }{\partial y}$$(e^{x}cos(y)) + $$\frac{\partial }{\partial z}$$(yz^{2})$

             = $e^{x} \sin (y) - e^{x} \sin (y) + 2yz$ = 2yz

$\int \int _{S}F.nds=\int \int \int _{Q}\bigtriangledown .F(X)dV$                 (Divergence Theorem)

                           = $\int_{0}^{1}\int_{0}^{1}\int_{0}^{2}(2yz)dzdydx$

                           = $2\int_{0}^{1}dx\int_{0}^{1}ydy\int_{0}^{2}zdz$

                           = 2 x 1 x $\frac{1}{2}$ x 2  = 2

Question 2: Prove $\int \int _{S}a . nds$ = 0, where, a is a constant vector.
Solution:
$\int \int _{S}a.nds = \int \int \int _{Q}\bigtriangledown .adV$                (Divergence Theorem)
$\bigtriangledown$.a = 0                                                                                           (Gradient of a constant is zero)
=> $ \int \int \int _{Q}\bigtriangledown .adV$ = $ \int \int \int _{Q}0dV$ = 0
Hence, $\int \int _{S}a . nds$ = 0

Let us prove the following Green's identities in three dimension using Divergence theorem.

Green's first identity states that
$\int \int \int _{Q}f\bigtriangledown ^{2}gdV=\int \int _{\partial Q}f(\bigtriangledown g).nds-\int \int \int _{Q}(\bigtriangledown f.\bigtriangledown g)dV$

The vector field to be considered here is F = f (∇g)

Applying divergence theorem, we get
$\int \int _{\partial Q}f(\bigtriangledown g).nds = \int \int \int _{Q}div(f(\bigtriangledown g))dV$

div (f(∇g)) = f (div(∇g)) + ∇g . ∇f                         (Identity on divergence)
               = f ∇2 g + ∇f . ∇g
Thus, we have
$\int \int _{\partial Q}f(\bigtriangledown g).nds$ = $\int \int \int _{Q}(f\bigtriangledown ^{2}g +\bigtriangledown f.\bigtriangledown g)dV$
                                =$\int \int \int _{Q}f\bigtriangledown ^{2}gdV+\int \int \int _{Q}\bigtriangledown f.\bigtriangledown gdV$

$\int \int \int _{Q}f\bigtriangledown ^{2}gdV=\int \int _{\partial Q}f(\bigtriangledown g).nds-\int \int \int _{Q}(\bigtriangledown f.\bigtriangledown g)dV$


Green's second identity in three dimensions states that
$\int \int \int _{Q}(f\bigtriangledown ^{2}g-g\bigtriangledown ^{2}f)dV=\int \int _{\partial Q}(f\bigtriangledown g-g\bigtriangledown f).nds$

Applying the first identity we get,
$\int \int _{\partial Q}(f\bigtriangledown g-g\bigtriangledown f).ndS=\int \int \int _{Q}[(f\bigtriangledown ^{2}g+\bigtriangledown f.\bigtriangledown g)-(g\bigtriangledown ^{2}+\bigtriangledown g.\bigtriangledown f)]dV$

Since the vector dot product is commutative we have ∇f . ∇g = ∇g . ∇f
$\int \int \int _{Q}(f\bigtriangledown ^{2}g-g\bigtriangledown ^{2}f)dV=\int \int _{\partial Q}(f\bigtriangledown g-g\bigtriangledown f).nds$