Tutorials › Calculus III › Flux Through Spheres Using the Divergence Theorem

The Divergence Theorem · Tutorial 958 of 999

Flux Through Spheres Using the Divergence Theorem

Learn to convert outward flux through a centered sphere into a spherical-coordinate integral of the divergence, then evaluate and check the result.

Advanced 10 min read

What You'll Learn

  • State the conditions for applying the Divergence Theorem to a ball.
  • Convert a volume integral over a centered ball into spherical coordinates.
  • Derive the flux formula when the divergence depends only on distance from the origin.
  • Compute flux for fields with constant divergence.
  • Compute and check flux for polynomial radial fields.
  • Recognize the missing radial Jacobian factor that commonly causes errors.

From Flux to a Ball Integral

A sphere is a particularly convenient boundary for the Divergence Theorem: its enclosed solid is a ball centered at the origin, and spherical coordinates describe that ball directly. The main calculation is therefore not usually a surface integral. It is an integral of the field's divergence over the ball.

Let \(R>0\), let \(B_R=\{(x,y,z):x^2+y^2+z^2<R^2\}\), and let \(S_R\) be its boundary sphere. If \(\mathbf{F}\) is continuously differentiable on an open set containing the closed ball, the Divergence Theorem gives the outward flux through \(S_R\) as the integral of \(\nabla\cdot\mathbf{F}\) over \(B_R\).

Theorem: For a continuously differentiable vector field \(\mathbf{F}\) on a neighborhood of the closed ball of radius \(R\), the outward flux through its boundary sphere is \[ \iint_{S_R}\mathbf{F}\cdot\mathbf{n}\,dS = \iiint_{B_R}\nabla\cdot\mathbf{F}\,dV, \] where \(\mathbf{n}\) is the outward unit normal.

The ball is a bounded solid with a smooth, closed boundary, so it meets the geometric requirements of the theorem. The differentiability condition matters: the field and its divergence must be well behaved throughout the ball, not merely on its boundary. Once these conditions hold, the spherical-coordinate volume element makes the integral especially direct.

Spherical Coordinates on a Centered Ball

Use \(r\) for distance from the origin, \(\phi\) for the angle measured down from the positive \(z\)-axis, and \(\theta\) for the angle in the \(xy\)-plane. Then

$$ x=r\sin\phi\cos\theta,\qquad y=r\sin\phi\sin\theta,\qquad z=r\cos\phi. $$

On the ball, the ranges are \(0\le r\le R\), \(0\le\phi\le\pi\), and \(0\le\theta\le2\pi\). The spherical-coordinate volume element is \(dV=r^2\sin\phi\,dr\,d\phi\,d\theta\). The factor \(r^2\sin\phi\) is the Jacobian: it accounts for how a small box in the coordinates \(r,\phi,\theta\) corresponds to a volume in three-dimensional space.

If the divergence is a function only of the distance \(r\), write it as \(h(r)\). Substituting the coordinates into the volume integral separates the radial and angular factors:

$$ \iiint_{B_R}h(r)\,dV = \int_0^R\int_0^\pi\int_0^{2\pi} h(r)\,r^2\sin\phi\,d\theta\,d\phi\,dr. $$

The angular integrals are \(\int_0^{2\pi}d\theta=2\pi\) and \(\int_0^\pi\sin\phi\,d\phi=2\). Thus the flux reduces to a single radial integral.

Useful formula: If \(\nabla\cdot\mathbf{F}=h(r)\) throughout the ball and the Divergence Theorem applies, then \[ \iint_{S_R}\mathbf{F}\cdot\mathbf{n}\,dS = 4\pi\int_0^R h(r)r^2\,dr. \]

Why the Radial Formula Works

The formula follows from the coordinate substitution, not from an assumption that flux is automatically the same in every direction. The divergence theorem first converts the flux to a volume integral. Spherical coordinates then describe the entire ball, and the Jacobian supplies the factor \(r^2\sin\phi\). When \(h\) depends only on \(r\), it can be taken outside the angular integrations.

1
Convert flux to volume.
Apply the Divergence Theorem to replace the outward flux by \(\iiint_{B_R}\nabla\cdot\mathbf{F}\,dV\).
2
Substitute spherical coordinates.
Use \(dV=r^2\sin\phi\,dr\,d\phi\,d\theta\) and the full angular ranges.
3
Integrate over the angles.
The angular factors contribute \(2\pi\cdot2=4\pi\), leaving \(4\pi\int_0^R h(r)r^2\,dr\) when the divergence is radial.

For constant divergence \(h(r)=c\), the radial integral gives \(cR^3/3\). Therefore the outward flux is \(4\pi cR^3/3\), the constant divergence multiplied by the ball's volume. This is a useful check on both the setup and the units of a calculation.

Worked Examples

Worked Example: A Field with Constant Divergence

Find the outward flux of \(\mathbf{F}(x,y,z)=(2x-y,\ y+3z,\ z+4x)\) through the sphere of radius \(2\) centered at the origin.

First compute the divergence, differentiating each component with respect to its corresponding variable:

$$ \nabla\cdot\mathbf{F} = \frac{\partial}{\partial x}(2x-y) +\frac{\partial}{\partial y}(y+3z) +\frac{\partial}{\partial z}(z+4x) =2+1+1=4. $$

The field is polynomial, so it is continuously differentiable throughout the ball. By the Divergence Theorem, the flux is the integral of \(4\) over the ball. Using spherical coordinates,

$$ \begin{aligned} \iint_{S_2}\mathbf{F}\cdot\mathbf{n}\,dS &=\int_0^2\int_0^\pi\int_0^{2\pi}4r^2\sin\phi\,d\theta\,d\phi\,dr\\ &=4\left(\int_0^2r^2\,dr\right) \left(\int_0^\pi\sin\phi\,d\phi\right) \left(\int_0^{2\pi}d\theta\right)\\ &=4\left(\frac{8}{3}\right)(2)(2\pi) =\frac{128\pi}{3}. \end{aligned} $$

As a check, the ball has volume \(4\pi(2^3)/3=32\pi/3\), and \(4\) times that volume is \(128\pi/3\), matching the flux.

Worked Example: A Radial Field with Variable Divergence

Find the outward flux of \(\mathbf{F}(x,y,z)=(1+x^2+y^2+z^2)(x,y,z)\) through the sphere of radius \(2\).

Set \(r=\sqrt{x^2+y^2+z^2}\). The field is \((1+r^2)(x,y,z)\). By the product rule,

$$ \begin{aligned} \nabla\cdot\big((1+r^2)(x,y,z)\big) &=(1+r^2)\nabla\cdot(x,y,z) +\nabla(1+r^2)\cdot(x,y,z)\\ &=3(1+r^2)+(2x,2y,2z)\cdot(x,y,z)\\ &=3+3r^2+2r^2 =3+5r^2. \end{aligned} $$

This polynomial field is continuously differentiable on the whole ball. Its divergence depends only on \(r\), so the radial formula applies:

$$ \begin{aligned} \iint_{S_2}\mathbf{F}\cdot\mathbf{n}\,dS &=4\pi\int_0^2(3+5r^2)r^2\,dr\\ &=4\pi\int_0^2(3r^2+5r^4)\,dr\\ &=4\pi\left(\left[r^3\right]_0^2+\left[r^5\right]_0^2\right)\\ &=4\pi(8+32) =160\pi. \end{aligned} $$

Check directly on the sphere: there \(r=2\) and \((x,y,z)=2\mathbf{n}\), so \(\mathbf{F}=5(2\mathbf{n})=10\mathbf{n}\). Hence \(\mathbf{F}\cdot\mathbf{n}=10\), and the sphere has area \(4\pi(2^2)=16\pi\). The surface flux is \(10(16\pi)=160\pi\), as found by the volume integral.

Worked Example: A Divergence Proportional to the Squared Radius

Find the outward flux of \(\mathbf{F}(x,y,z)=(x^2+y^2+z^2)(x,y,z)\) through the sphere of radius \(2\).

Writing \(r^2=x^2+y^2+z^2\), the field is \(r^2(x,y,z)\). The product rule gives

$$ \begin{aligned} \nabla\cdot\big(r^2(x,y,z)\big) &=r^2(1+1+1)+(2x,2y,2z)\cdot(x,y,z)\\ &=3r^2+2(x^2+y^2+z^2)\\ &=5r^2. \end{aligned} $$

The field is polynomial and smooth throughout the ball. Integrating its divergence,

$$ \begin{aligned} \iint_{S_2}\mathbf{F}\cdot\mathbf{n}\,dS &=4\pi\int_0^2 5r^2r^2\,dr\\ &=20\pi\left[\frac{r^5}{5}\right]_0^2\\ &=4\pi(32) =128\pi. \end{aligned} $$

On the sphere, \(r^2=4\) and \((x,y,z)=2\mathbf{n}\), so \(\mathbf{F}=8\mathbf{n}\). The direct surface flux is \(8\) times the area \(16\pi\), or \(128\pi\). This confirms the volume-integral result.

A Useful Identity for Radial Fields

Many fields pointing directly away from or toward the origin have the form \(\mathbf{F}=f(r)(x,y,z)\), where \(f\) is a differentiable scalar function of \(r\). For \(r>0\), the product rule gives

$$ \nabla\cdot\big(f(r)(x,y,z)\big) =3f(r)+\frac{f'(r)}{r}(x^2+y^2+z^2) =3f(r)+rf'(r). $$

This identity can make the divergence calculation faster, but it must be used with care at the origin: the field must still have a continuously differentiable extension there for the Divergence Theorem to apply to the entire ball. The polynomial radial fields above meet that condition.

Common Pitfall: Omitting the Jacobian

A frequent error is to integrate the divergence over \(r\) alone, forgetting that spherical coordinates have volume element \(r^2\sin\phi\,dr\,d\phi\,d\theta\). For the last example, omitting \(r^2\) would incorrectly give

$$ 4\pi\int_0^2 5r^2\,dr =4\pi\left(\frac{40}{3}\right) =\frac{160\pi}{3}, $$

which is not the flux. The divergence is \(5r^2\), and the volume element contributes another \(r^2\). The correct radial integrand is \(5r^4\), giving \(4\pi\int_0^2 5r^4\,dr=128\pi\). Always keep the Jacobian separate from the divergence until the full integrand is formed.

Why This Method Is Useful

A direct flux calculation requires describing the sphere's normal and the field's normal component at every boundary point. The Divergence Theorem can replace that surface calculation with a volume integral that is simpler, especially when the divergence is constant or depends only on distance from the origin. For radial divergence, the angular dependence disappears after integration, leaving one ordinary integral.

The method is not a license to ignore the theorem's hypotheses. A field with a singularity inside the ball, for example, is not continuously differentiable throughout a neighborhood of the closed ball, so the stated theorem cannot be applied directly. For smooth fields on the ball, however, the procedure is systematic: verify the hypotheses, calculate the divergence, include the spherical Jacobian, and evaluate the radial integral.

Check Your Understanding

Use the spherical-coordinate setup and the Divergence Theorem to answer these questions.

  1. What condition on a vector field allows the Divergence Theorem to be applied to the ball and its boundary sphere?
  2. What is the volume element in spherical coordinates, and which factor is the Jacobian?
  3. If the divergence is the constant \(c\), what is the outward flux through a sphere of radius \(R\)?
  4. If \(\nabla\cdot\mathbf{F}=h(r)\), write the one-dimensional radial integral for the flux.
  5. For \(\mathbf{F}=(x^2+y^2+z^2)(x,y,z)\), what is the divergence, and why must the radial integrand contain an \(r^4\) factor?