Tutorials › Calculus III › A Systematic Flux-to-Volume Setup

The Divergence Theorem · Tutorial 957 of 999

A Systematic Flux-to-Volume Setup

Turn a closed-surface flux problem into a carefully bounded volume integral, while keeping the divergence, coordinate limits, and orientation consistent.

Advanced 9 min read

What You'll Learn

  • State the conditions needed to use the Divergence Theorem.
  • Identify the solid enclosed by a piecewise-smooth closed surface.
  • Compute divergence by differentiating each field component with respect to its matching coordinate.
  • Choose an integration order and write bounds that describe the entire solid exactly once.
  • Use coordinate symmetry and Jacobian factors when selecting a coordinate system.
  • Track how inward orientation changes the sign of flux.

From a Boundary to Its Enclosed Solid

A surface-flux problem is posed on a boundary, but the Divergence Theorem replaces that surface calculation with an integral over the solid inside it. The theorem does not remove the need for careful setup. The enclosed region, the divergence, the coordinate limits, and the orientation must all match the original problem.

A reliable setup begins by asking what the surface encloses, not by immediately writing integration limits. Once the solid is clear, compute the divergence and describe the solid in coordinates that make its points easy to cover without gaps or overlaps.

The Divergence Theorem: If \(E\) is a bounded solid whose boundary \(\partial E\) is a closed, piecewise-smooth surface, and \(\mathbf{f}\) has continuous first partial derivatives on an open region containing \(E\), then $$ \iint_{\partial E}\mathbf{f}\cdot\mathbf{n}\,dS = \iiint_E \nabla\cdot\mathbf{f}\,dV. $$ Here \(\mathbf{n}\) is the outward unit normal. The theorem gives the outward flux; flux with inward orientation is the negative of this value.

The field must be sufficiently regular throughout the solid, not merely on its boundary. The boundary must enclose the solid being integrated over, and the normal used by the theorem points outward on every boundary piece. If these conditions are not met, this conversion cannot be applied as stated.

A Reliable Setup in Four Steps

1
Identify the enclosed solid.
Translate the boundary description into inequalities for points \((x,y,z)\) in \(E\). Include every bounding surface and determine which side of each surface belongs to the solid.
2
Check the theorem’s conditions.
Confirm that the boundary is closed and piecewise smooth and that the field has continuous first partial derivatives throughout a region containing \(E\).
3
Compute the divergence.
For \(\mathbf{f}=(f_1,f_2,f_3)\), calculate \(\nabla\cdot\mathbf{f}=\frac{\partial f_1}{\partial x}+\frac{\partial f_2}{\partial y}+\frac{\partial f_3}{\partial z}\). Each component is differentiated with respect to its matching coordinate.
4
Choose coordinates and bounds.
Describe every point in \(E\) exactly once, include the appropriate volume element, and integrate the divergence over those limits.

Cartesian coordinates are often effective when the solid is described by coordinate planes or by one coordinate lying between two graphs. Cylindrical coordinates can be useful when the geometry has rotational symmetry about an axis; spherical coordinates can be useful when it is organized around a point. In a change of coordinates, the volume element must include its Jacobian factor: for example, \(dV=r\,dz\,dr\,d\theta\) in cylindrical coordinates and \(dV=\rho^2\sin\phi\,d\rho\,d\phi\,d\theta\) in spherical coordinates. The limits must describe the same solid as in the original coordinates.

Why Nested Bounds Describe a Solid

Suppose a solid can be described by taking \((x,y)\) in a planar region \(D\), then letting \(z\) range between a lower surface \(z=g_1(x,y)\) and an upper surface \(z=g_2(x,y)\). This description requires \(g_1(x,y)\leq g_2(x,y)\) throughout \(D\), and each vertical line over \(D\) must intersect the solid in precisely that interval.

For a continuous function \(h\), integration over such a solid can be performed by first integrating along each vertical interval and then over the base region. This follows by summing the contributions of the vertical slices: each point of the solid belongs to the slice above exactly one base point \((x,y)\), and its contribution is included between the two stated heights.

$$ \iiint_E h(x,y,z)\,dV = \iint_D\left(\int_{g_1(x,y)}^{g_2(x,y)} h(x,y,z)\,dz\right)dA. $$

The same principle applies when a different coordinate is chosen for the inner integral. The inner limits must describe the solid’s extent in that coordinate; the outer limits must cover the projection of the solid onto the remaining coordinates.

Worked Examples

Worked Example: Flux Through a Rectangular Solid

Let \(E=\{(x,y,z):0\leq x\leq1,\ 0\leq y\leq2,\ 0\leq z\leq1\}\), and let \(\mathbf{f}=(x^2,xy,z^2)\). Find the outward flux through \(\partial E\) using the Divergence Theorem.

The solid is the stated rectangular region. The field is polynomial, so its first partial derivatives are continuous throughout a neighborhood of \(E\). Compute the divergence component by component:

$$ \nabla\cdot\mathbf{f} = \frac{\partial x^2}{\partial x} +\frac{\partial (xy)}{\partial y} +\frac{\partial z^2}{\partial z} =2x+x+2z=3x+2z. $$

The bounds cover the full solid, with \(z\) innermost:

$$ \begin{aligned} \iint_{\partial E}\mathbf{f}\cdot\mathbf{n}\,dS &=\int_0^1\int_0^2\int_0^1(3x+2z)\,dz\,dy\,dx\\ &=\int_0^1\int_0^2(3x+1)\,dy\,dx\\ &=\int_0^1(6x+2)\,dx\\ &=\left[3x^2+2x\right]_0^1=5. \end{aligned} $$

As a check, compute the flux across the six faces directly. The faces \(x=0,\ y=0,\ z=0\) contribute zero. On \(x=1\), the outward flux is \(\int_0^2\int_0^1 1\,dz\,dy=2\). On \(y=2\), it is \(\int_0^1\int_0^1 2x\,dz\,dx=1\). On \(z=1\), it is \(\int_0^1\int_0^2 1\,dy\,dx=2\). Their sum is \(2+1+2=5\), matching the volume integral.

Worked Example: A Solid with a Slanted Projection

Let \(E\) be bounded by \(0\leq x\leq1\), \(0\leq y\leq x\), and \(0\leq z\leq1+y^2\). For \(\mathbf{f}=(x,y,z)\), set up and evaluate the outward flux.

These inequalities describe the solid directly. The field is smooth, and

$$ \nabla\cdot\mathbf{f} = \frac{\partial x}{\partial x} +\frac{\partial y}{\partial y} +\frac{\partial z}{\partial z} =1+1+1=3. $$

At each fixed \(x\), the coordinate \(y\) runs from \(0\) to \(x\); at each fixed \((x,y)\), \(z\) runs from \(0\) to \(1+y^2\). Therefore

$$ \begin{aligned} \iint_{\partial E}\mathbf{f}\cdot\mathbf{n}\,dS &=\int_0^1\int_0^x\int_0^{1+y^2}3\,dz\,dy\,dx\\ &=\int_0^1\int_0^x3(1+y^2)\,dy\,dx\\ &=\int_0^1(3x+x^3)\,dx\\ &=\frac{3}{2}+\frac{1}{4}=\frac{7}{4}. \end{aligned} $$

To check the bounds and arithmetic, reverse the order of \(x\) and \(y\). The same triangular projection is \(0\leq y\leq1,\ y\leq x\leq1\). Thus the integral is

$$ \begin{aligned} \int_0^1\int_y^1\int_0^{1+y^2}3\,dz\,dx\,dy &=3\int_0^1(1+y^2)(1-y)\,dy\\ &=3\left(1-\frac12+\frac13-\frac14\right) =\frac74. \end{aligned} $$

The two orders give the same result. In particular, replacing the triangular projection with the full square \(0\leq x,y\leq1\) would describe a different solid.

Worked Example: Reversing the Inner Coordinate

Let \(E\) be given by \(-1\leq x\leq1,\ x^2\leq y\leq1,\ 0\leq z\leq2-y\), and let \(\mathbf{f}=(x,y,z)\). Find the outward flux.

The field is smooth and its divergence is \(1+1+1=3\). With the original bounds,

$$ \begin{aligned} \iint_{\partial E}\mathbf{f}\cdot\mathbf{n}\,dS &=\int_{-1}^1\int_{x^2}^1\int_0^{2-y}3\,dz\,dy\,dx\\ &=\int_{-1}^1\int_{x^2}^1 3(2-y)\,dy\,dx\\ &=\int_{-1}^1\left(\frac92-6x^2+\frac32x^4\right)dx\\ &=9-4+\frac35=\frac{28}{5}. \end{aligned} $$

For a check, describe the same region by fixing \(y\) first. Since \(x^2\leq y\) and \(0\leq y\leq1\), we have \(-\sqrt y\leq x\leq\sqrt y\). The \(z\)-limits remain \(0\leq z\leq2-y\). Hence

$$ \begin{aligned} \int_0^1\int_{-\sqrt y}^{\sqrt y}\int_0^{2-y}3\,dz\,dx\,dy &=\int_0^1 6\sqrt y(2-y)\,dy\\ &=12\left(\frac23\right)-6\left(\frac25\right) =\frac{28}{5}. \end{aligned} $$

The reversed limits recover the same solid and the same flux.

Orientation and a Common Error

The volume integral on the right-hand side of the Divergence Theorem corresponds specifically to the outward normal. If the requested flux uses the inward normal instead, negate the outward result. For instance, the rectangular-solid example has outward flux \(5\); its inward-oriented flux is \(-5\).

A common setup error is to differentiate a field component with respect to the wrong variable. For \(\mathbf{f}=(x^2,xy,z^2)\), writing the divergence as \(2x+y+2z\) is incorrect: the middle component is \(xy\), and its derivative with respect to \(y\) is \(x\), not \(y\). The correct divergence is \(2x+x+2z=3x+2z\). A useful check is to write all three matching component-coordinate derivatives before simplifying.

Why the Setup Matters

The Divergence Theorem can make a difficult boundary integral manageable, but only if the volume integral represents exactly the region enclosed by the boundary. A missing slice, an extra portion of the projection, reversed upper and lower limits, or a missing coordinate Jacobian changes the integral. Before evaluating, test whether the limits produce sensible boundary points and whether their inequalities describe each part of the solid once.

Keep the roles distinct: the field and its derivatives determine the integrand, the geometry determines the bounds, and the chosen orientation determines the sign. Separating those decisions makes errors easier to locate and the final conversion easier to verify.

Check Your Understanding

Use these questions to test a flux-to-volume setup before carrying out the integration.

  1. What conditions on the solid, boundary, and field are required to apply the Divergence Theorem?
  2. For \(\mathbf{f}=(x^2,yz,z)\), what three partial derivatives form \(\nabla\cdot\mathbf{f}\)?
  3. If a solid is described by \(a\leq z\leq b(x,y)\), what must be true of \(a\), \(b(x,y)\), and the base region for these to be valid vertical bounds?
  4. How does the answer change if a problem asks for inward flux instead of outward flux?
  5. Why must a Jacobian factor be included when a triple integral is written in cylindrical or spherical coordinates?