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\).
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
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:
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.
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.
Apply the Divergence Theorem to replace the outward flux by \(\iiint_{B_R}\nabla\cdot\mathbf{F}\,dV\).
Use \(dV=r^2\sin\phi\,dr\,d\phi\,d\theta\) and the full angular ranges.
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:
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,
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,
This polynomial field is continuously differentiable on the whole ball. Its divergence depends only on \(r\), so the radial formula applies:
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
The field is polynomial and smooth throughout the ball. Integrating its divergence,
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
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
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.
- What condition on a vector field allows the Divergence Theorem to be applied to the ball and its boundary sphere?
- What is the volume element in spherical coordinates, and which factor is the Jacobian?
- If the divergence is the constant \(c\), what is the outward flux through a sphere of radius \(R\)?
- If \(\nabla\cdot\mathbf{F}=h(r)\), write the one-dimensional radial integral for the flux.
- 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?