Search Continuum Mechanics Website

# Divergence Theorem

home > basic math > divergence theorem

## Introduction

The divergence theorem is an equality relationship between surface integrals and volume integrals, with the divergence of a vector field involved. It often arises in mechanics problems, especially so in variational calculus problems in mechanics. The equality is valuable because integrals often arise that are difficult to evaluate in one form (volume vs. surface), but are easier to evaluate in the other form (surface vs. volume). This page presents the divergence theorem, several variations of it, and several examples of its application.

## Divergence Theorem

The divergence theorem, applied to a vector field $${\bf f}$$, is

$\int_V \nabla \cdot {\bf f} \, dV = \int_S {\bf f} \cdot {\bf n} \, dS$
where the LHS is a volume integral over the volume, $$V$$, and the RHS is a surface integral over the surface enclosing the volume. The surface has outward-pointing unit normal, $${\bf n}$$. The vector field, $${\bf f}$$, can be any vector field at all. Do not assume that it is limited to forces due to the use of the letter $${\bf f}$$ in the above equation.

### Tensor Notation

The divergence theorem can be written in tensor notation as

$\int_V f_{i,i} \, dV = \int_S f_i n_i \, dS$

### Divergence Theorem in 1-D

The divergence theorem is nothing more than a generalization of the straight forward 1-D integration process we all know and love. To see this, start with the divergence theorem written out as

$\int_V \left( {\partial f_x \over \partial x} + {\partial f_y \over \partial y} + {\partial f_z \over \partial z} \right) dV = \int_S \left( f_x n_x + f_y n_y + f_z n_z \right) dS$
But in 1-D, there are no $$y$$ or $$z$$ components, so we can neglect them. And the volume integral becomes a simple integral over $$x$$, so $$dV$$ becomes $$dx$$.

On the RHS, the surface integral becomes the left and right boundaries on the x-axis, and $$n_x$$ equals -1 on the left boundary and +1 on the right. All this reduces the above equation to

$\int_{x_1}^{x_2} \, {\partial f_x \over \partial x} \, dx = f(x_2) - f(x_1)$
And that's it! To show that this works, let $$f(x) = x^2$$, then $${\partial f_x \over \partial x} = 2x$$, and we get

$\int_{x_1}^{x_2} \, 2x \, dx = (x_2)^2 - (x_1)^2$
which is clearly the correct 1-D result.
The following examples present integrals over cubic volumes only because this keeps the math simple and allows the concepts to be more easily grasped. But note that the divergence theorem applies regardless of the shape of the volume.

### Divergence Example

Consider a constant velocity field of a fluid flowing at 5 m/s in the y-direction, $${\bf v} = 5{\bf j}$$. The net volumetric flow, $$Q$$, out of the box shown in the figure, with each face having area = 4m2, is given by

$Q = \int_S {\bf v} \cdot {\bf n} \, dS$
This is easily evaluated because the velocity field is constant, exactly normal to two faces, and exactly parallel to all others. For the left face, $${\bf n} = -1{\bf j}$$ and

$\int_{Face1} {\bf v} \cdot {\bf n} \, dS = 5 * (-4) = -20 \;\text{m}^3\!\!/\text{s}$
For the right face, $${\bf n} = 1{\bf j}$$ and

$\int_{Face2} {\bf v} \cdot {\bf n} \, dS = 5 * (+4) = +20 \;\text{m}^3\!\!/\text{s}$
So the total integral is

$Q = \int_S {\bf v} \cdot {\bf n} \, dS = -20 + 20 = 0$
That was easy. But it would be easier still to evaluate

$Q = \int_V \nabla \cdot {\bf v} \, dV$
because since $$\nabla \cdot {\bf v} = 0$$, then the integral over any volume of the quantity zero, is zero. And this is exactly equal to the surface integral as it must be.

### 2nd Divergence Example

Consider instead a more complex velocity field of $${\bf v} = 5x{\bf i} + 10xz{\bf j} - 2z{\bf k}$$ The net volumetric flow, $$Q$$, out of the same box is still given by

$Q = \int_S {\bf v} \cdot {\bf n} \, dS$
While this is still possible to solve, it is in fact much easier to apply the divergence theorem and instead evaluate the divergence of the velocity field over the volume.

$\nabla \cdot {\bf v} \;\; = \;\; {\partial (5x) \over \partial x} + {\partial (10xz) \over \partial y} + {\partial (-2z) \over \partial z} \;\; = \;\; 3$
and the integral of 3 over a volume of 8m3 is

$Q \;\; = \;\; \int_V \nabla \cdot {\bf v} \, dV \;\; = \;\; 3 * 8 \;\; = \;\; 24$
and this means that the surface integral above must also equal 24. If this were a conservation of mass problem, then the net outflow of material must mean that something very curious is happening to the density!

## Alternate Forms

Several variations of the divergence theorem exist. For example, a closely related alternate form is

$\int_V \nabla f({\bf x}) \, dV = \int_S f({\bf x}) {\bf n} \, dS$
where $$f({\bf x})$$ is a scalar function of the vector $${\bf x}$$. This equation is in fact three separate, independent ones because it is a vector. This is seen more clearly when written in tensor form.

$\int_V f,_i \, dV = \int_S f \; n_i \, dS$
Writing each equation out explicitly gives

$\int_V {\partial f({\bf x}) \over \partial x} \, dV = \int_S f({\bf x}) n_x \, dS \qquad \qquad \int_V {\partial f({\bf x}) \over \partial y} \, dV = \int_S f({\bf x}) n_y \, dS \qquad \qquad \int_V {\partial f({\bf x}) \over \partial z} \, dV = \int_S f({\bf x}) n_z \, dS$
Each equation is separate and can be used independently, in isolation of the others. In fact, the first equation arises in the derivation of the J-Integral. In that case, $$f({\bf x})$$ is actually the strain energy density, $$w({\bf x})$$, in the vicinity of the crack tip. Finally, note how closely each equation resembles the 1-D case discussed above. Nevertheless, it is a slightly different variation because in this case, the volume is a 3-D object, not 1-D.

A second alternate form involves the application of the divergence theorem to 2nd rank tensors, such as the stress tensor, $$\boldsymbol{\sigma}$$.

$\int_V \nabla \cdot \boldsymbol{\sigma} \, dV = \int_S \boldsymbol{\sigma } \cdot {\bf n} \, dS$
This identity often arises because stress-times-area is force. It can be written in tensor notation as

$\int_V \sigma_{ij,j} \, dV = \int_S \sigma_{ij} \, n_j \, dS$

## Summary

Note how similar the three forms discussed above appear to be when written in tensor notation.

$\int_V f,_i \, dV = \int_S f \; n_i \, dS$
$\int_V f_{i,i} \, dV = \int_S f_i n_i \, dS$
$\int_V \sigma_{ij,j} \, dV = \int_S \sigma_{ij} \, n_j \, dS$
The equations are written for a scalar function, $$f$$, and then a vector function, $$f_i$$, and finally a tensor function, $$\sigma_{ij}$$. In each case, the "$$,i$$" in the volume integral becomes $$n_i$$ in the surface integral (except it's a $$j$$ in the last example). Tensor notation makes the various forms of the divergence theorem very easy to remember.

### Thank You

Thank you for visiting this webpage. Feel free to email me if you have questions.

Bob McGinty
bmcginty@gmail.com

### Entire Math Chapter - $4.99 For$4.99, you receive two formatted PDFs (the first for 8.5" x 11" pages, the second for tablets) of the entire chapter.

Click here to see a sample page in each of the two formats.