Why Spherical Coordinates Change the Calculation
Divergence measures the local net outward flux of a vector field per unit volume. In Cartesian coordinates, the small volume used for this comparison has constant side lengths as it moves through space. In spherical coordinates, the lengths and areas associated with angular changes depend on the distance from the origin and on the polar angle.
Those changing lengths are captured by the coordinate scale factors. Once the factors are included, the divergence formula accounts for how much field crosses each face of a small spherical volume, including how the face areas change from one side to the other.
Coordinates, Components, and Scale Factors
Use spherical coordinates \((r,\theta,\phi)\), where \(r\) is the distance from the origin, \(\theta\) is the polar angle measured from the positive \(z\)-axis, and \(\phi\) is the azimuthal angle measured from the positive \(x\)-axis in the \(xy\)-plane. Thus \(r>0\), \(0<\theta<\pi\), and \(\phi\) is taken modulo \(2\pi\) on a regular coordinate region.
Write a vector field using its components along the spherical unit vectors: \(\mathbf{F}=F_r\mathbf{e}_r+F_\theta\mathbf{e}_\theta+F_\phi\mathbf{e}_\phi\). These are components along unit directions, not components along coordinate curves of unit length. An angular change \(d\theta\) corresponds to a physical length \(r\,d\theta\), while an angular change \(d\phi\) corresponds to \(r\sin\theta\,d\phi\).
The scale factors give the side lengths of a small spherical coordinate box: \(dr\) in the radial direction, \(r\,d\theta\) in the polar direction, and \(r\sin\theta\,d\phi\) in the azimuthal direction. In particular, its volume to leading order is \(r^2\sin\theta\,dr\,d\theta\,d\phi\).
The Divergence Formula
Because \(r\) does not depend on \(\theta\) or \(\phi\), and \(\sin\theta\) does not depend on \(r\) or \(\phi\), the same formula can be written as
The first form displays the flux contributions before division by the local volume. The second form is often convenient for calculation. Both require the same regularity assumptions and apply where the coordinates are regular; the displayed denominators should not be evaluated directly at \(r=0\) or \(\sin\theta=0\).
Why the Formula Works: A Small-Volume Derivation
Consider a small coordinate box with sides \(dr,d\theta,d\phi\), located near \((r,\theta,\phi)\). Its leading-order volume is \(r^2\sin\theta\,dr\,d\theta\,d\phi\). Divergence is the limiting net outward flux divided by volume, so we add the flux differences across each pair of opposite faces.
The area of a face at radius \(r\) is \(r^2\sin\theta\,d\theta\,d\phi\). The outward flux difference between the faces at \(r+dr\) and \(r\), to first order, is \(\frac{\partial}{\partial r}(r^2\sin\theta F_r)\,dr\,d\theta\,d\phi\).
A face at angle \(\theta\) has area \(r\sin\theta\,dr\,d\phi\). The difference of outward fluxes across the two polar faces is \(\frac{\partial}{\partial\theta}(r\sin\theta F_\theta)\,d\theta\,dr\,d\phi\), to first order.
A face at angle \(\phi\) has area \(r\,dr\,d\theta\). The outward flux difference across the two azimuthal faces is \(\frac{\partial}{\partial\phi}(rF_\phi)\,d\phi\,dr\,d\theta\), to first order.
Add the three first-order flux differences and divide by \(r^2\sin\theta\,dr\,d\theta\,d\phi\). In the limit as the box shrinks, the result is exactly the stated formula.
The factors inside the derivatives arise because the face areas vary across the box. This is why a formula that differentiates each spherical component as if it were a Cartesian component misses part of the local flux.
Radially Symmetric Fields
A radially symmetric vector field has the form \(\mathbf{F}=f(r)\mathbf{e}_r\), where \(f\) is differentiable. Its angular components vanish, so the general formula reduces to a one-variable expression.
This expression involves both the change in the radial component and the growth of the area of a sphere as its radius increases. It is therefore not generally just \(f'(r)\).
Worked Example: The Position Vector Field
Let \(\mathbf{F}=r\mathbf{e}_r\), for \(r>0\). Its spherical components are \(F_r=r\), \(F_\theta=0\), and \(F_\phi=0\). Using the radial form,
To check, \(r\mathbf{e}_r=(x,y,z)\), so Cartesian differentiation gives \(\nabla\cdot\mathbf{F}=\partial x/\partial x+\partial y/\partial y+\partial z/\partial z=1+1+1=3\). The two calculations agree.
Worked Example: A Radial Inverse-Square Field
Consider \(\mathbf{F}=\frac{1}{r^2}\mathbf{e}_r\), defined for \(r>0\). Here \(f(r)=r^{-2}\), so
The check is direct: the radial flux factor \(r^2F_r\) is the constant \(1\), whose derivative is zero. This computation is only on the stated domain \(r>0\); the field is not defined at the origin, so this calculation makes no claim about divergence there.
Fields with Angular Dependence
When a spherical component depends on \(\theta\) or \(\phi\), its angular derivative contributes to divergence. The next examples show that angular dependence can either produce a nonzero contribution or cancel another term.
Worked Example: A Field with Polar-Angle Dependence
Let \(\mathbf{F}=z\mathbf{k}\), where \(\mathbf{k}\) is the unit vector in the positive \(z\)-direction. Since \(z=r\cos\theta\), projection onto the spherical unit vectors gives \(F_r=r\cos^2\theta\), \(F_\theta=-r\sin\theta\cos\theta\), and \(F_\phi=0\). Apply the formula term by term:
For a check, the original Cartesian field is \((0,0,z)\). Its divergence is \(0+0+1=1\), as found in spherical coordinates. In particular, the polar-angle derivative is needed: the radial term alone would give \(3\cos^2\theta\), not the full answer.
Worked Example: An Azimuth-Dependent Azimuthal Component
On a region with \(r>0\) and \(0<\theta<\pi\), let the only nonzero spherical component be \(F_\phi=r\sin\theta\cos\phi\). The radial and polar terms vanish. The remaining term is
Check independently in Cartesian coordinates. Set \(\rho=r\sin\theta\), so \(x=\rho\cos\phi\), \(y=\rho\sin\phi\), and \(\mathbf{e}_\phi=(-\sin\phi,\cos\phi,0)\). Then \(F_\phi=r\sin\theta\cos\phi=x\), and
Because \(\rho=\sqrt{x^2+y^2}\), differentiation gives
Adding these terms yields \(\nabla\cdot\mathbf{F}=-y/\rho=-\sin\phi\), which verifies the spherical result.
A Common Error: Omitting the Scale Factors
A frequent mistake is to differentiate \(F_r,F_\theta,F_\phi\) as though they were Cartesian components, without accounting for the changing spherical face areas. For example, using only \(\partial F_r/\partial r\) on \(\mathbf{F}=r\mathbf{e}_r\) gives \(1\). That is not the spherical divergence: it omits the outward flux increase caused by the growing area of spheres.
The correct calculation includes the radial area factor:
A useful check is to confirm that the \(r^2\) and \(\sin\theta\) factors are placed inside the appropriate derivatives in the full formula. The derivative with respect to \(\phi\) acts on \(rF_\phi\); it does not introduce an extra \(\sin\theta\) in that numerator.
Using the Formula Reliably
For a field with spherical components, a careful calculation follows a consistent sequence:
- Write the field as \(F_r\mathbf{e}_r+F_\theta\mathbf{e}_\theta+F_\phi\mathbf{e}_\phi\), using the stated angle convention.
- Identify which components depend on \(r\), \(\theta\), or \(\phi\).
- Substitute into the full divergence formula, preserving its scale factors.
- Differentiate each term with respect to its indicated variable, then simplify.
- Where practical, check the result by expressing the field in Cartesian components and differentiating.
The formula matters whenever spherical geometry makes the field or the region easier to describe than in Cartesian coordinates. Radially symmetric fields are a particularly clear case: one derivative of \(r^2f(r)\) captures how radial strength and spherical area combine. For fields with angular variation, the additional terms record the flux changes across the angular faces.
Check Your Understanding
Use the spherical divergence formula and show the intermediate steps in each calculation.
- For \(\mathbf{F}=r^2\mathbf{e}_r\), compute the divergence for \(r>0\), then check using Cartesian components.
- For \(\mathbf{F}=r\cos\theta\,\mathbf{e}_r\), compute the divergence and identify which variables its components depend on.
- If \(F_\theta=r\sin\theta\) and the other spherical components vanish, what is \(\nabla\cdot\mathbf{F}\)?
- If \(F_\phi=r\sin\theta\sin\phi\) and the other components vanish, compute the divergence, including the azimuthal derivative.
- Why does the radial term involve the derivative of \(r^2F_r\), rather than just the derivative of \(F_r\)?