Divergence

Divergence operator measuring net volumetric flux and source-sink density in vector fields.

What it is

Divergence is a differential operator acting on a differentiable vector field F⃗(x,y,z)\vec{F}(x,y,z) to produce a scalar field ∇⃗⋅F⃗\vec{\nabla}\cdot\vec{F}. In Cartesian coordinates it is defined as:

∇⃗⋅F⃗=∂Fx∂x+∂Fy∂y+∂Fz∂z\vec{\nabla}\cdot\vec{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}

Physically, divergence quantifies the volumetric net outward flux density of a vector field at any point in space:

∇⃗⋅F⃗=lim⁡V→01V∮SF⃗⋅dS⃗\vec{\nabla}\cdot\vec{F} = \lim_{V \to 0} \frac{1}{V} \oint_S \vec{F} \cdot d\vec{S}

  • If ∇⃗⋅F⃗(P)>0\vec{\nabla}\cdot\vec{F}(P) > 0: Point PP is a net source (field lines emerge or expand outwards).
  • If ∇⃗⋅F⃗(P)<0\vec{\nabla}\cdot\vec{F}(P) < 0: Point PP is a net sink (field lines converge and vanish inwards).
  • If ∇⃗⋅F⃗(P)=0\vec{\nabla}\cdot\vec{F}(P) = 0: The field is solenoidal or incompressible at PP (inflow across any infinitesimal boundary equals outflow identically).

Why it appears in physics

Divergence is the foundational syntax for conservation laws and Maxwell's equations:

  • Gauss's law for electrostatics: ∇⃗⋅E⃗=ρε0\vec{\nabla}\cdot\vec{E} = \frac{\rho}{\varepsilon_0}. Electric charges act as local sources and sinks of electric field lines.
  • Gauss's law for magnetism: ∇⃗⋅B⃗=0\vec{\nabla}\cdot\vec{B} = 0. Magnetic monopoles do not exist; magnetic field lines are unbroken closed loops.
  • Fluid continuity equation: ∂ρ∂t+∇⃗⋅(ρv⃗)=0\frac{\partial \rho}{\partial t} + \vec{\nabla}\cdot(\rho \vec{v}) = 0. Divergence of mass flux governs local temporal mass accumulation.
  • Incompressible fluid flow: ∇⃗⋅v⃗=0\vec{\nabla}\cdot\vec{v} = 0. Liquids conserve local fluid parcel volume during motion.

Visual or geometric intuition

Imagine water flow in a large pool:

  • A submerged nozzle pumping in water creates diverging outward velocity vectors: positive divergence (+).
  • A drain sucking water creates converging inward velocity vectors: negative divergence (-).
  • Steady uniform laminar flow across a channel creates zero net divergence (0).

Minimal symbolic language

  • Cartesian coordinates: ∇⃗⋅F⃗=∂Fx∂x+∂Fy∂y+∂Fz∂z\vec{\nabla}\cdot\vec{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}.
  • Cylindrical coordinates (r,θ,z)(r, \theta, z): ∇⃗⋅F⃗=1r∂(rFr)∂r+1r∂Fθ∂θ+∂Fz∂z\vec{\nabla}\cdot\vec{F} = \frac{1}{r} \frac{\partial (r F_r)}{\partial r} + \frac{1}{r} \frac{\partial F_\theta}{\partial \theta} + \frac{\partial F_z}{\partial z}.
  • Spherical coordinates (r,θ,φ)(r, \theta, \varphi): ∇⃗⋅F⃗=1r2∂(r2Fr)∂r+1rsin⁡θ∂(sin⁡θFθ)∂θ+1rsin⁡θ∂Fφ∂φ\vec{\nabla}\cdot\vec{F} = \frac{1}{r^2} \frac{\partial (r^2 F_r)}{\partial r} + \frac{1}{r \sin\theta} \frac{\partial (\sin\theta F_\theta)}{\partial \theta} + \frac{1}{r \sin\theta} \frac{\partial F_\varphi}{\partial \varphi}.
  • Divergence theorem (Gauss): ∫V(∇⃗⋅F⃗) dV=∮SF⃗⋅dS⃗\int_V (\vec{\nabla}\cdot\vec{F}) \, dV = \oint_S \vec{F} \cdot d\vec{S}.
  • Solenoidal vector field: ∇⃗⋅F⃗=0  ⟺  F⃗=∇⃗×A⃗\vec{\nabla}\cdot\vec{F} = 0 \iff \vec{F} = \vec{\nabla}\times\vec{A}.

What the result means

The scalar output ∇⃗⋅F⃗\vec{\nabla}\cdot\vec{F} carries units of [F⃗]/[meter][\vec{F}]/[\text{meter}]. It represents the local net production rate of field lines per unit volume without any spatial direction.

When not to use it

  • Do not attempt to take the divergence of a scalar field ϕ\phi. Divergence operates exclusively on vector fields.
  • Do not omit curvilinear metric scale factors: in spherical coordinates, writing ∂rFr\partial_r F_r instead of 1r2∂r(r2Fr)\frac{1}{r^2} \partial_r (r^2 F_r) causes fatal errors.
  • Do not assume radial field lines imply non-zero divergence: the point-mass gravitational field g⃗=−GMr2e^r\vec{g} = -\frac{GM}{r^2} \hat{e}_r has ∇⃗⋅g⃗≡0\vec{\nabla}\cdot\vec{g} \equiv 0 everywhere except at r=0r=0.

Operational summary

To compute ∇⃗⋅F⃗\vec{\nabla}\cdot\vec{F}: evaluate the partial derivative of each component along its coordinate, taking into account geometric metric prefactors in curvilinear coordinates, and sum the scalar terms.

Procedure

Before calculating

Ensure the input is a genuine vector field F⃗\vec{F} and select the most appropriate coordinate frame.

Step 1: Identify the mathematical object

Isolate the individual components of F⃗\vec{F} and verify their spatial functional dependencies.

Step 2: Choose the operation

Deploy the divergence expression adapted to the chosen system:

  • Cartesian: ∂Fx∂x+∂Fy∂y+∂Fz∂z\frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}.
  • Cylindrical: 1r∂(rFr)∂r+1r∂Fθ∂θ+∂Fz∂z\frac{1}{r} \frac{\partial (r F_r)}{\partial r} + \frac{1}{r} \frac{\partial F_\theta}{\partial \theta} + \frac{\partial F_z}{\partial z}.
  • Spherical: 1r2∂(r2Fr)∂r+1rsin⁡θ∂(sin⁡θFθ)∂θ+1rsin⁡θ∂Fφ∂φ\frac{1}{r^2} \frac{\partial (r^2 F_r)}{\partial r} + \frac{1}{r \sin\theta} \frac{\partial (\sin\theta F_\theta)}{\partial \theta} + \frac{1}{r \sin\theta} \frac{\partial F_\varphi}{\partial \varphi}.

Step 3: Conserve units and signs

Differentiate each term. In curvilinear coordinates, multiply by geometric scale factors prior to differentiation.

Step 4: Calculate

Sum all terms. When evaluating at a point PP, substitute coordinates to produce the final scalar value.

Step 5: Interpret the result

Assess the physical significance of the scalar sign: positive for source density, negative for sink density, zero for solenoidal behavior.

Self-check checklist

  • Is the output a pure scalar without basis vectors?
  • Are dimensions equal to [F⃗]/[m][\vec{F}]/[\text{m}]?
  • Were radial metric weights placed inside the differential operator?

Guided example

Physical situation

An inhomogeneous electrostatic field in space is given by: E⃗(x,y,z)=(2x2y)i^−(y2z)j^+(3z2x)k^[N/C]\vec{E}(x,y,z) = (2x^2 y) \hat{i} - (y^2 z) \hat{j} + (3z^2 x) \hat{k} \quad [\text{N/C}] where x,y,zx,y,z are in meters. Determine the free volume electric charge density ρ(x,y,z)\rho(x,y,z) at point P(1,2,−1)P(1, 2, -1) via differential Gauss's law: ∇⃗⋅E⃗=ρε0\vec{\nabla}\cdot\vec{E} = \frac{\rho}{\varepsilon_0} with ε0≈8.854×10−12 F/m\varepsilon_0 \approx 8.854 \times 10^{-12} \text{ F/m}.

Mathematical translation

Compute Cartesian divergence ∇⃗⋅E⃗=∂xEx+∂yEy+∂zEz\vec{\nabla}\cdot\vec{E} = \partial_x E_x + \partial_y E_y + \partial_z E_z, then calculate ρ=ε0(∇⃗⋅E⃗)\rho = \varepsilon_0 (\vec{\nabla}\cdot\vec{E}).

Step-by-step calculation

  1. Differentiate components: ∂Ex∂x=4xy,∂Ey∂y=−2yz,∂Ez∂z=6zx\frac{\partial E_x}{\partial x} = 4xy, \quad \frac{\partial E_y}{\partial y} = -2yz, \quad \frac{\partial E_z}{\partial z} = 6zx

  2. Sum to obtain divergence: ∇⃗⋅E⃗=4xy−2yz+6zx\vec{\nabla}\cdot\vec{E} = 4xy - 2yz + 6zx

  3. Evaluate at P(1,2,−1)P(1, 2, -1): ∇⃗⋅E⃗(P)=4(1)(2)−2(2)(−1)+6(−1)(1)=8+4−6=+6 N/(C⋅m)\vec{\nabla}\cdot\vec{E}(P) = 4(1)(2) - 2(2)(-1) + 6(-1)(1) = 8 + 4 - 6 = +6 \text{ N/(C}\cdot\text{m)}

  4. Calculate charge density: ρ=(8.854×10−12)×6=5.3124×10−11 C/m3=+53.12 pC/m3\rho = (8.854 \times 10^{-12}) \times 6 = 5.3124 \times 10^{-11} \text{ C/m}^3 = +53.12 \text{ pC/m}^3

Reading the result

Positive divergence indicates outward flux expansion, physically demanding a net positive charge density of +53.12 pC/m3+53.12 \text{ pC/m}^3 at point PP.

Common error avoided

Retaining unit vectors in the divergence expression; divergence is purely scalar.


Inverse example

Given result

A 2D incompressible velocity field has horizontal component vx(x,y)=3x2−2yv_x(x,y) = 3x^2 - 2y.

What physical question it can answer

What vertical velocity component vy(x,y)v_y(x,y) preserves continuity? Incompressibility requires ∇⃗⋅v⃗=∂xvx+∂yvy=0\vec{\nabla}\cdot\vec{v} = \partial_x v_x + \partial_y v_y = 0: ∂xvx=6x  ⟹  ∂yvy=−6x  ⟹  vy(x,y)=−6xy+g(x)\partial_x v_x = 6x \implies \partial_y v_y = -6x \implies v_y(x,y) = -6xy + g(x) Any function of this form preserves local fluid volume.

Common errors

Error 1: Retaining unit vectors in divergence outputs

Keeping basis vectors i^,j^,k^\hat{i}, \hat{j}, \hat{k} in divergence results. Divergence is fundamentally a scalar contraction.

Error 2: Missing the r2r^2 prefactor inside spherical radial derivatives

Calculating ∂rFr\partial_r F_r rather than 1r2∂r(r2Fr)\frac{1}{r^2} \partial_r (r^2 F_r). This erroneously suggests the Coulomb field has non-zero divergence in vacuum.

Error 3: Equating zero divergence with constant fields

Assuming ∇⃗⋅F⃗=0\vec{\nabla}\cdot\vec{F} = 0 requires F⃗\vec{F} to be uniform. Swirling vortex flows have zero divergence while varying intensely in space.

Error 4: Overlooking the origin Dirac delta singularity

For F⃗=r^r2\vec{F} = \frac{\hat{r}}{r^2}, stating divergence is zero everywhere without qualifying r=0r=0. At r=0r=0, ∇⃗⋅(r^/r2)=4πδ3(r⃗)\vec{\nabla}\cdot(\hat{r}/r^2) = 4\pi \delta^3(\vec{r}).

Error 5: Applying divergence to scalar fields

Writing ∇⃗⋅ϕ\vec{\nabla}\cdot\phi. Divergence operates strictly on vector fields; on scalars, one uses the gradient.

Quick detection rule

If a divergence expression outputs vectors or fails to carry units of [F⃗]/[m][\vec{F}]/[\text{m}], the calculation is flawed.

Physical applications

1. Electromagnetism and Maxwell's equations

Divergence anchors the two source equations:

  • ∇⃗⋅E⃗=ρ/ε0\vec{\nabla}\cdot\vec{E} = \rho/\varepsilon_0 (Gauss's law for charge sources).
  • ∇⃗⋅B⃗=0\vec{\nabla}\cdot\vec{B} = 0 (No magnetic monopoles).

2. Hydrodynamics and incompressibility

In Navier-Stokes modeling of liquids, the incompressibility constraint ∇⃗⋅v⃗=0\vec{\nabla}\cdot\vec{v} = 0 ensures volume conservation.

3. Compressible gas dynamics and shocks

In supersonic aerodynamics, ∇⃗⋅v⃗\vec{\nabla}\cdot\vec{v} measures dilatation and compression rates across shock fronts.

4. Heat conduction with internal generation

Thermal energy balances in solids with nuclear or chemical heating follow −∇⃗⋅q⃗+Q=ρcp∂tT-\vec{\nabla}\cdot\vec{q} + Q = \rho c_p \partial_t T.

5. Stellar astrophysics and radiative equilibrium

Inside stellar interiors, radiative energy flux satisfies ∇⃗⋅F⃗rad=ρϵ\vec{\nabla}\cdot\vec{F}_{\text{rad}} = \rho \epsilon where ϵ\epsilon represents thermonuclear energy production.

Practice

Problem 1: Divergence of a radial power-law force field

A central force field is given by F⃗(r⃗)=rne^r\vec{F}(\vec{r}) = r^n \hat{e}_r.

  1. Compute ∇⃗⋅F⃗\vec{\nabla}\cdot\vec{F} for r>0r > 0 using spherical coordinates.
  2. For what exponent nn is the field strictly solenoidal?

Solution:

  1. In spherical coordinates: ∇⃗⋅F⃗=1r2∂∂r(r2rn)=1r2(n+2)rn+1=(n+2)rn−1\vec{\nabla}\cdot\vec{F} = \frac{1}{r^2} \frac{\partial}{\partial r}(r^2 r^n) = \frac{1}{r^2} (n+2) r^{n+1} = (n+2) r^{n-1}
  2. Setting divergence to zero: n+2=0  ⟹  n=−2n+2 = 0 \implies n = -2 Inverse-square laws (1/r21/r^2, such as gravity and Coulomb forces) are the unique power laws with zero divergence in source-free space.

Problem 2: Compressibility of atmospheric wind patterns

An atmospheric flow field is given by: v⃗(x,y)=(U0cos⁡(kx)cosh⁡(ky))i^−(U0sin⁡(kx)sinh⁡(ky))j^\vec{v}(x,y) = (U_0 \cos(kx)\cosh(ky)) \hat{i} - (U_0 \sin(kx)\sinh(ky)) \hat{j}

  1. Compute ∇⃗⋅v⃗\vec{\nabla}\cdot\vec{v}.
  2. Determine if the wind field exhibits convergence or incompressibility.

Solution:

∂xvx=−kU0sin⁡(kx)cosh⁡(ky),∂yvy=−kU0sin⁡(kx)cosh⁡(ky)\partial_x v_x = -k U_0 \sin(kx)\cosh(ky), \quad \partial_y v_y = -k U_0 \sin(kx)\cosh(ky) ∇⃗⋅v⃗=−2kU0sin⁡(kx)cosh⁡(ky)\vec{\nabla}\cdot\vec{v} = -2k U_0 \sin(kx)\cosh(ky) Non-zero divergence indicates compressibility; zones with ∇⃗⋅v⃗<0\vec{\nabla}\cdot\vec{v} < 0 represent mass convergence zones driving cloud formation.


Problem 3: Charge conservation and conduction current

Current density is J⃗=J0e−αt(xi^+yj^+zk^)\vec{J} = J_0 e^{-\alpha t} (x \hat{i} + y \hat{j} + z \hat{k}). Find ∂ρ∂t\frac{\partial \rho}{\partial t} using the continuity equation.

Solution:

∇⃗⋅J⃗=J0e−αt(1+1+1)=3J0e−αt\vec{\nabla}\cdot\vec{J} = J_0 e^{-\alpha t}(1+1+1) = 3J_0 e^{-\alpha t} ∂ρ∂t=−∇⃗⋅J⃗=−3J0e−αt\frac{\partial \rho}{\partial t} = -\vec{\nabla}\cdot\vec{J} = -3J_0 e^{-\alpha t}