Icon for ACT® Math

ACT® Math

How to Use the Divergence Theorem

How to Use the Divergence Theorem in Multivariable Calculus

As you learned in your multi-variable calculus course, one of the consequences of Green’s theorem is that the flux of some vector field, \vec{F} , across the boundary, \partial D , of the planar region, D , equals the integral of the divergence of \vec{F} over D . In other words,

\int \limits_{\partial D} \vec{F}\cdot\vec{n}, ds = \int \limits_{D} \text{div} ,\vec{F}, dA

(If you are surprised with such a form of Green’s theorem, see our blog article on this topic.)

Do you know how to generalize this statement to three-dimensional space? Generalization of Green’s theorem to three-dimensional space is the divergence theorem, also known as Gauss’s theorem. Analogously to Green’s theorem, the divergence theorem relates a triple integral over some region in space, V , and a surface integral over the boundary of that region, \partial V , in the following way:

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = ii\int\limits_{V} \text{div} ,\vec{F} ,dV

In this review article, we’ll give you the physical interpretation of the divergence theorem and explain how to use it. After you practice our examples, you’ll feel confident operating with the divergence theorem in mathematical and physical applications.

What is the Flux of a Vector Field?

We start with the flux definition. The term flux can be explained physically as the flow of fluid. Suppose, the vector field, \vec{F}(x,y,z) , represents the rate and direction of fluid flow at a point (x, y, z) in space. Then, by definition, the flux is a measure of how much of the fluid passes through a given surface per unit of time. Fluid flow, \vec{F}(x,y,z) , can be decomposed into components perpendicular ( \vec{F}_{\perp} ) and parallel ( \vec{F}_{\parallel} ) to the unit normal of the surface, \vec{n} (see the illustration below).

General Flux Diagram
Image Source: Wikimedia Commons

Decomposition of the fluid flow, \vec{F} , into components perpendicular, \vec{F}_{\perp} , and parallel, \vec{F}_{\parallel} , to the unit normal of the surface, \vec{n}

As we can see from this image, the perpendicular component, \vec{F}_{\perp} , does not contribute to the flux because it corresponds to the fluid flow across the surface. Thus, only the parallel component, \vec{F}_{\parallel} , contributes to the flux. The rate of flow passing through the infinitesimal area of surface, dS , is given by |\vec{F}_{\parallel}| = \vec{F}\cdot \vec{n} . Thus, we can obtain the total amount of fluid, \Delta M , flowing through the surface, S , per unit time if calculate the integral over this surface, namely

\Delta M = i\int\limits_{S} \vec{F}\cdot\vec{n}, dS

Now, consider some compact region in space, V , which has a piece-wise smooth boundary S = \partial V . As the region V is compact, its boundary, \partial V , is closed, as illustrated in the image below:

Divergence Theorem
Image Source: Wikimedia Commons

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

For this example, the boundary of V , \partial V , is made up of six smooth surfaces. The top and bottom faces of \partial V are given by equations z=c(x,y) , while the left and right faces are surfaces given by y=b(x,z) and, finally, the front and back faces are surfaces of the form x=a(y,z) . In some special cases, one or more faces of \partial V can degenerate to a line or a point.

The surface integral of a vector field, \vec{F}(x,y,z) , over the closed surface, \partial V , is the sum of the surface integrals of \vec{F} over the six faces of V oriented by outward-pointing unit normals, \vec{n} :

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = \left[ i\int\limits_{S_1} + i\int\limits_{S_2} + i\int\limits_{S_3} + i\int\limits_{S_4} + i\int\limits_{S_5} + i\int\limits_{S_6} \right] \vec{F}\cdot\vec{n}, dS

If \vec{F} is a fluid flow, the surface integral i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS is the flux of \vec{F} across \partial V .

This surface integral can be interpreted as the rate at which the fluid is flowing from inside V across its boundary. Suppose, the mass of the fluid inside V at some moment of time equals M_V . Then, the rate of change of M_V equals

\dfrac{\Delta M_V}{\Delta t} = - i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS

We note that if the total flux over the boundary of V , i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS , is positive, the mass of fluid inside V is decreasing.

Below, we’ll illustrate through examples some practical techniques for calculating the flux across the closed surface.

Example 1

Find the flux of a vector field \vec{F} = (x^2, y^2, z^2) across the boundary of a rectangular box,

V: \quad 0 \leq x \leq a ,,\quad 0 \leq y \leq b ,,\quad 0 \leq z \leq c

The boundary, \partial V , of such a rectangular box, is made up of six planar rectangles (see the illustration below).

box

A rectangular box, V: \quad 0 \leq x \leq a ,,\quad 0 \leq y \leq b ,,\quad 0 \leq z \leq c .

Let’s find the flux across the top face of the rectangular box, which we denote by S_1 . The surface S_1 is given by relations

S_1: \quad z=c,, \quad 0 \leq x \leq a ,,\quad 0 \leq y \leq b

The outward unit normal to S_1 can be easily determined: \vec{n} = (0,0,1) . So, we have \vec{F}\cdot\vec{n} = z^2 = c^2 . By the definition, the flux of \vec{F} across S_1 equals

i\int\limits_{S_1} \vec{F}\cdot\vec{n}, dS = c^2 \int\limits_{0}^{a} dx \int\limits_{0}^{b} dy = abc^2

For the bottom face of the rectangular box, S_2 , we have

S_2: \quad z=0,, \quad 0 \leq x \leq a ,,\quad 0 \leq y \leq b

The outward unit normal to S_2 equals \vec{n} = (0,0,-1) . Correspondingly, \vec{F}\cdot\vec{n} = - z^2 = 0 , which results in

i\int\limits_{S_2} \vec{F}\cdot\vec{n}, dS = 0\cdot \int\limits_{0}^{a} dx \int\limits_{0}^{b} dy = 0

Analogously, we calculate the flux across the right face of the rectangle, S_3 ,

S_3:, y=b,,, 0 \leq x \leq a ,,, 0 \leq z \leq c,; \quad \vec{n} = (0,1,0),,, \vec{F}\cdot\vec{n} = y^2 = b^2,;\quad i\int\limits_{S_3} \vec{F}\cdot\vec{n}, dS = b^2 \int\limits_{0}^{a} dx \int\limits_{0}^{c} dz = ab^2c

and across the left face, S_4 ,

S_4:, y=0,,, 0 \leq x \leq a ,,, 0 \leq z \leq c,; \quad \vec{n} = (0,-1,0),,, \vec{F}\cdot\vec{n} = - y^2 = 0,;\quad i\int\limits_{S_4} \vec{F}\cdot\vec{n}, dS = 0\cdot \int\limits_{0}^{a} dx \int\limits_{0}^{c} dz = 0

Finally, the flux across the front face, S_5 , equals

S_5:, x=a,,, 0 \leq y \leq b ,,, 0 \leq z \leq c,; \quad \vec{n} = (1,0,0),,, \vec{F}\cdot\vec{n} = x^2 = a^2,;\quad i\int\limits_{S_5} \vec{F}\cdot\vec{n}, dS = a^2 \int\limits_{0}^{b} dy \int\limits_{0}^{c} dz = a^2bc

and the flux across the back face, S_6 , equals

S_6:, x=0,,, 0 \leq y \leq b ,,, 0 \leq z \leq c,; \quad \vec{n} = (-1,0,0),,, \vec{F}\cdot\vec{n} = - x^2 = 0,;\quad i\int\limits_{S_6} \vec{F}\cdot\vec{n}, dS = 0\cdot \int\limits_{0}^{b} dy \int\limits_{0}^{c} dz = 0

The total flux over the boundary of the rectangle box is the sum of fluxes across its faces, namely

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = \left[ i\int\limits_{S_1} + i\int\limits_{S_2} + i\int\limits_{S_3} + i\int\limits_{S_4} + i\int\limits_{S_5} + i\int\limits_{S_6} \right] \vec{F}\cdot\vec{n}, dS = abc^2 + 0 + ab^2c + 0 + a^2bc + 0 = abc(a+b+c)

Example 2

Consider the vector field \vec{F} = F_0, \vec{r}/r , where \vec{r}=(x, y, z) is the position vector, and find the flux of \vec{F} across the sphere of radius R ,

\partial V: \quad x^2 + y^2 + z^2 = R^2

The outward normal to the sphere at some point is proportional to the position vector of that point, \vec{r} = (x,y,z) , which is illustrated in the following image:

Moment of Inertia Solid Sphere
Image Source: Wikimedia Commons

Outward normal to the sphere at some point is proportional to the position vector of that point.

Consequently, outward normal to the sphere equals \vec{n} = \vec{r}/R , and we can evaluate

\vec{F}\cdot\vec{n} = \dfrac{F_0}{R^2} (\vec{r} \cdot \vec{r}) = F_0

Note that the above equality is valid only at the surface of the sphere, where r = R . Finally, we calculate the flux

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = F_0 i\int\limits_{\partial V}, dS = F_0 \cdot S_{sphere} = 4\pi R^2 F_0

Here, S_{sphere} = 4\pi R^2 is the area of the sphere of radius R .

Now that we are feeling comfortable with the flux and surface integrals, let’s take a look at the divergence theorem.

The Divergence Theorem

The divergence theorem states that, given a vector field, \vec{F} , and a compact region in space, V , which has a piece-wise smooth boundary, \partial V , we can relate the surface integral over \partial V with the triple integral over the volume of V ,

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = ii\int\limits_{V} \text{div},\vec{F} ,dV

In other words, the flux of \vec{F} across \partial V equals the volume integral of \text{div} ,\vec{F} over V . Here,

\text{div} ,\vec{F} is the divergence of the vector field, \vec{F} = (F_x, F_y, F_z) ,

\text{div} ,\vec{F} = \dfrac{\partial F_x}{\partial x} + \dfrac{\partial F_y}{\partial y} + \dfrac{\partial F_z}{\partial z}

When we apply the divergence theorem to an infinitesimally small element of volume, \Delta V , we get

i\int\limits_{\partial (\Delta V)} \vec{F}\cdot\vec{n}, dS \approx \text{div},\vec{F} ,\Delta V

Therefore, the divergence of \vec{F} at the point (x, y, z) equals the flux of \vec{F} across the boundary of the infinitesimally small region around this point. By definition of the flux, this means

\text{div},\vec{F} = \lim\limits_{\Delta V \rightarrow 0} \dfrac{1}{\Delta V }i\int\limits_{\partial (\Delta V)} \vec{F}\cdot\vec{n}, dS = -,\lim\limits_{\Delta V \rightarrow 0},\dfrac{\Delta M_V}{\Delta V\Delta t} = -,\dfrac{\Delta \rho_V}{\Delta t}

Consequently, the divergence is the rate of change of the density, \rho_V = M_V/\Delta V . Positive divergence means that the density is decreasing (fluid flows outward), and negative divergence means that the density is increasing (fluid flows inward).

The following examples illustrate the practical use of the divergence theorem in calculating surface integrals.

Example 3

Let’s see how the result that was derived in Example 1 can be obtained by using the divergence theorem.

The problem is to find the flux of \vec{F} = (x^2, y^2, z^2) across the boundary of a rectangular box

V: \quad 0 \leq x \leq a ,,\quad 0 \leq y \leq b ,,\quad 0 \leq z \leq c

First, we find the divergence of \vec{F} ,

\text{div} ,\vec{F} = \dfrac{\partial F_x}{\partial x} + \dfrac{\partial F_y}{\partial y} + \dfrac{\partial F_z}{\partial z} = \dfrac{\partial (x^2)}{\partial x} + \dfrac{\partial (y^2)}{\partial y} + \dfrac{\partial (z^2)}{\partial z} = 2(x+y+z)

Next, we apply the divergence theorem,

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = ii\int\limits_{V} \text{div},\vec{F} ,dV = 2 \int\limits_{0}^{a} dx \int\limits_{0}^{b} dy \int\limits_{0}^{c} dz (x+y+z) = I_1 + I_2 + I_3

Here,

\begin{array}{l} I_1 = 2 \int\limits_{0}^{a} x dx \int\limits_{0}^{b} dy \int\limits_{0}^{c} dz = 2\left(\dfrac{x^2}{2}\right)\Bigl|_{x=0}^{x=a}\cdot, y\Bigl|_{y=0}^{y=b}\cdot, z\Bigl|_{z=0}^{z=c} = a^2 b c \ \ I_2 = 2 \int\limits_{0}^{a} dx \int\limits_{0}^{b} y dy \int\limits_{0}^{c} dz = 2 x\Bigl|_{x=0}^{x=a}\cdot,\left(\dfrac{y^2}{2}\right)\Bigl|_{y=0}^{y=b} \cdot, z\Bigl|_{z=0}^{z=c} = a b^2 c \ \ I_3 = 2 \int\limits_{0}^{a} dx \int\limits_{0}^{b} dy \int\limits_{0}^{c} z dz = 2 x\Bigl|_{x=0}^{x=a} \cdot, y\Bigl|_{y=0}^{y=b} \cdot,\left(\dfrac{z^2}{2}\right)\Bigl|_{z=0}^{z=c} = a b c^2 \end{array}

Consequently, we get

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = I_1 + I_2 + I_3 = a^2bc + ab^2c + abc^2 = abc(a+b+c)

As you can see, the divergence theorem gives the same result with less effort in this case.

Example 4

Let’s verify also the result we have obtained in Example 2. Consider a ball, V , which is defined by the inequality

V: \quad x^2 + y^2 + z^2 \leq R^2

The boundary of the ball, \partial V , is the sphere of radius R . According to the divergence theorem, we can calculate the flux of \vec{F} = F_0, \vec{r}/r across \partial V by integrating the divergence of \vec{F} over the volume of V . Due to that \vec{r} = (x,y,z) and r = \sqrt{x^2+y^2+z^2} , we find

\text{div} ,\vec{F} = \dfrac{\partial}{\partial x}\left(\dfrac{F_0 x}{\sqrt{x^2+y^2+z^2}}\right) + ,\dfrac{\partial}{\partial y}\left(\dfrac{F_0 y}{\sqrt{x^2+y^2+z^2}}\right) + ,\dfrac{\partial}{\partial z}\left(\dfrac{F_0 z}{\sqrt{x^2+y^2+z^2}}\right) = I_1 + I_2 + I_3

Here,

\begin{array}{l} I_1 = \dfrac{\partial}{\partial x}\left(\dfrac{F_0 x}{\sqrt{x^2+y^2+z^2}}\right) = \dfrac{F_0}{\sqrt{x^2+y^2+z^2}} - \dfrac{2F_0x^2}{2(x^2+y^2+z^2)^{3/2}} = \dfrac{F_0}{r} - \dfrac{F_0 ,x^2}{r^3} \ \ I_2 = \dfrac{\partial}{\partial y}\left(\dfrac{F_0 y}{\sqrt{x^2+y^2+z^2}}\right) = \dfrac{F_0}{\sqrt{x^2+y^2+z^2}} - \dfrac{2F_0y^2}{2(x^2+y^2+z^2)^{3/2}} = \dfrac{F_0}{r} - \dfrac{F_0 ,y^2}{r^3} \ \ I_3 = \dfrac{\partial}{\partial z}\left(\dfrac{F_0 z}{\sqrt{x^2+y^2+z^2}}\right) = \dfrac{F_0}{\sqrt{x^2+y^2+z^2}} - \dfrac{2F_0z^2}{2(x^2+y^2+z^2)^{3/2}} = \dfrac{F_0}{r} - \dfrac{F_0 ,z^2}{r^3} \end{array}

Therefore, we have

\text{div} ,\vec{F} = I_1 + I_2 + I_3 = \dfrac{3 F_0}{r} - \dfrac{F_0 (x^2+y^2+z^2)}{r^3} = \dfrac{3 F_0}{r} - \dfrac{F_0 r^2}{r^3} = \dfrac{2 F_0}{r}

We can evaluate the triple integral over the volume of a ball in spherical coordinates,

ii\int\limits_{V} \text{div},\vec{F} ,dV = \int\limits_{0}^{2\pi} d\varphi \int\limits_{0}^{\pi} sin\theta d\theta \int\limits_{0}^{R} \left(\dfrac{2 F_0}{r}\right) r^2 dr = 4\pi\cdot 2 F_0 \left(\dfrac{r^2}{2}\right)\Bigl|^{r=R}_{r=0} = 4\pi R^2 F_0

Finally, we apply the divergence theorem and get the answer for the flux across the sphere,

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = ii\int\limits_{V} \text{div},\vec{F} ,dV = 4\pi R^2 F_0

Again, we notice the coincidence of results obtained by the application of divergence theorem and by the direct evaluation of the surface integral.

Example 5

Suppose, we are given the vector field, \vec{F} = (x, 2y, 3z) , in the region

V:\quad 0 \leq x \leq 1 ,,\quad 0 \leq y \leq x ,,\quad 0 \leq z \leq x+y

Visualizing this region and finding normals to the boundary, \partial V , is not an easy task. Fortunately, the divergence theorem allows to calculate the surface integral without specifying normals. To determine the flux, i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS , we just need to find the divergence of vec{F} ,

\text{div} ,\vec{F} = \dfrac{\partial x}{\partial x} + \dfrac{\partial (2y)}{\partial y} + \dfrac{\partial (3z)}{\partial z} = 1+2+3 = 6

and calculate the volume integral

ii\int\limits_{V} \text{div},\vec{F} ,dV = 6 \int\limits_{0}^{1} dx \int\limits_{0}^{x} dy \int\limits_{0}^{x+y} dz = 6 \int\limits_{0}^{1} dx \int\limits_{0}^{x} (x+y) dy = 6 \int\limits_{0}^{1} \left(x^2 + \dfrac{x^2}{2}\right) dx = 6\cdot \dfrac{3}{2} \left(\dfrac{x^3}{3}\right)\Bigl|^{x=1}_{x=0} = 3

Consequently, the surface integral equals

i\int\limits_{\partial V} \vec{F}\cdot\vec{n}, dS = ii\int\limits_{V} \text{div},\vec{F} ,dV = 3

Wrapping up the Divergence Theorem

In this review article, we have investigated the divergence theorem (also known as Gauss’s theorem) and explained how to use it. Now, you will be able to calculate the surface integral by the triple integration over the volume and apply the divergence theorem in different physical applications. Do you know any branches of physics where the divergence theorem can be used? Let us know in the comments.

Featured Image Source

Let’s put everything into practice. Try this Multivariable Calculus practice question:

Find the Divergence of the Vector Field F x y z Multivariable Calculus Practice Question

Looking for more Multivariable Calculus practice?

You can find thousands of practice questions on Albert.io. Albert.io lets you customize your learning experience to target practice where you need the most help. We’ll give you challenging practice questions to help you achieve mastery in Multivariable Calculus.

Start practicing here.

Are you a teacher or administrator interested in boosting Multivariable Calculus student outcomes?

Learn more about our school licenses here.

Interested in a school license?​

Bring Albert to your school and empower all teachers with the world's best question bank for:

➜ SAT® & ACT®
➜ AP®
➜ ELA, Math, Science, & Social Studies
➜ State assessments

Options for teachers, schools, and districts.