Review / Chapter 2 — Vector Calculus

Divergence

Chapter 2 — Vector Calculus

The divergence of a vector field \(\vec{F}\) is a local measure of how much the field is spreading out (or converging) at a point. Its formal definition is flux-per-unit-volume:

\[(\vec{\nabla}\cdot\vec{F})(\vec{r}) = \lim_{V\to 0}\frac{1}{V}\oint_{\partial V} \vec{F}\cdot d\vec{A},\]

where the integral is over the closed surface bounding a tiny volume \(V\) centered at \(\vec{r}\). Shrinking the volume to zero makes this into a pointwise scalar field — the divergence.

Cartesian formula

Taking the limiting volume to be a little rectangular prism and Taylor-expanding the field across each pair of faces gives the workhorse formula,

\[\vec{\nabla}\cdot\vec{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}.\]

Notation-wise this is exactly the "dot product" of the vector operator \(\vec{\nabla} = (\partial_x,\partial_y,\partial_z)\) with the field \(\vec{F}\).

Physical picture

Think of \(\vec{F}\) as the velocity field of a fluid. Then:

Three vector-field patterns: one with arrows spreading outward from a point (positive divergence), one with arrows flowing inward (negative divergence), and a uniform-parallel pattern (zero divergence).
Positive, negative, and zero divergence. A source "pumps" field outward; a sink "drains" it; a uniform field has zero divergence because every face's flux is balanced.

Uniform fields have zero divergence

If \(\vec{F}\) is a constant vector, every partial derivative vanishes and \(\vec{\nabla}\cdot\vec{F} = 0\). Geometrically, every flux-in is canceled by an equal flux-out. This is why "uniform" and "divergence-free" so often go together.

Worked example

Let \(\vec{F}(x,y,z) = (x^2,\ 3xy,\ 2z)\). Compute \(\vec{\nabla}\cdot\vec{F}\).

\[\partial_x(x^2) = 2x,\quad \partial_y(3xy) = 3x,\quad \partial_z(2z) = 2.\]

So \(\vec{\nabla}\cdot\vec{F} = 2x + 3x + 2 = 5x + 2\). That's a scalar function of position — bigger where \(x\) is bigger, and equal to \(2\) on the plane \(x=0\).

Divergence of a Coulomb field (heads-up)

For \(\vec{E} = \frac{q}{4\pi\epsilon_0}\frac{\hat{r}}{r^2}\) — the point-charge field — a direct computation away from the origin gives \(\vec{\nabla}\cdot\vec{E} = 0\). Right at \(r=0\) the field blows up, and the divergence "hides" a delta-function spike there. This is consistent with Gauss's law: charge density is zero except at the point charge itself.

Practice Problems

Problem 1easy
Compute \(\vec{\nabla}\cdot\vec{F}\) for \(\vec{F} = (y,\ x,\ z)\).
Hint
Add the three relevant partial derivatives.
Solution

\(\partial_x(y) = 0\), \(\partial_y(x) = 0\), \(\partial_z(z) = 1\).

Answer: \(\vec{\nabla}\cdot\vec{F} = 1\).

Problem 2easy
Compute \(\vec{\nabla}\cdot\vec{F}\) for \(\vec{F} = (cy,\ cx,\ 0)\).
Hint
Each partial is a derivative of one coordinate with respect to a different coordinate.
Solution

\(\partial_x(cy) = 0\), \(\partial_y(cx) = 0\), \(\partial_z(0) = 0\).

Answer: \(\vec{\nabla}\cdot\vec{F} = 0\).

Problem 3medium
A vector field is \(\vec{F} = \vec{r} = (x,y,z)\). Find its divergence and interpret it as a source density.
Hint
Each partial is 1.
Solution

\(\vec{\nabla}\cdot\vec{r} = 1+1+1 = 3\). The field is sourced uniformly everywhere — every tiny volume in space produces the same amount of outward flux per unit volume.

Answer: \(\vec{\nabla}\cdot\vec{r} = 3\).

Problem 4medium
For \(\vec{F} = (x^2 y,\ y^2 z,\ z^2 x)\), compute the divergence at the point \((1,2,3)\).
Hint
Compute \(\vec{\nabla}\cdot\vec{F}\) symbolically, then plug in.
Solution

\(\partial_x(x^2 y) = 2xy\), \(\partial_y(y^2 z) = 2yz\), \(\partial_z(z^2 x) = 2zx\). So \(\vec{\nabla}\cdot\vec{F} = 2(xy+yz+zx)\). At \((1,2,3)\): \(2(2+6+3) = 22\).

Answer: \(22\).

Problem 5medium
Which (if any) of the following fields has nonzero divergence in a neighborhood of the origin? (a) \(\vec{F}=(y,-x,0)\); (b) \(\vec{F}=(x,y,0)\); (c) \(\vec{F}=(\sin y, \sin x, 0)\).
Hint
Just compute each divergence directly.
Solution

(a) \(0+0+0=0\). (b) \(1+1+0=2\). (c) \(\partial_x(\sin y)+\partial_y(\sin x)+0=0\).

Answer: only (b) has nonzero divergence; it equals \(2\) everywhere.

Problem 6hard
Show that for \(\vec{F}(\vec{r}) = \hat{r}/r^2\) (a pure Coulomb-shaped field), \(\vec{\nabla}\cdot\vec{F} = 0\) for \(r\neq 0\).
Hint
Write \(\hat{r}/r^2 = \vec{r}/r^3\) with \(r=\sqrt{x^2+y^2+z^2}\). Use the product rule and \(\partial_x r = x/r\).
Solution

\(F_x = x/r^3\). By the product rule, \(\partial_x(x/r^3) = 1/r^3 + x\cdot(-3/r^4)\cdot(x/r) = 1/r^3 - 3x^2/r^5\). Summing the cyclic permutations: \(3/r^3 - 3(x^2+y^2+z^2)/r^5 = 3/r^3 - 3r^2/r^5 = 0\).

Answer: \(\vec{\nabla}\cdot(\hat{r}/r^2)=0\) for \(r>0\).