Mathwords logoMathwords

Divergence — Definition, Formula & Examples

Divergence is a scalar quantity that measures how much a vector field expands or contracts at a given point. A positive divergence means the field is spreading outward (like a source), while a negative divergence means it is converging inward (like a sink).

Given a vector field F=(F1,F2,F3)\mathbf{F} = (F_1, F_2, F_3) defined on a subset of R3\mathbb{R}^3 where each component has continuous first partial derivatives, the divergence of F\mathbf{F} is the scalar field F=F1x+F2y+F3z\nabla \cdot \mathbf{F} = \dfrac{\partial F_1}{\partial x} + \dfrac{\partial F_2}{\partial y} + \dfrac{\partial F_3}{\partial z}. It equals the trace of the Jacobian matrix of F\mathbf{F} and represents the volume density of the outward flux of the field from an infinitesimal region around each point.

Key Formula

F=F1x+F2y+F3z\nabla \cdot \mathbf{F} = \frac{\partial F_1}{\partial x} + \frac{\partial F_2}{\partial y} + \frac{\partial F_3}{\partial z}
Where:
  • F=(F1,F2,F3)\mathbf{F} = (F_1, F_2, F_3) = A vector field with component functions $F_1(x,y,z)$, $F_2(x,y,z)$, $F_3(x,y,z)$
  • \nabla = The del operator, $\left(\frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z}\right)$
  • F\nabla \cdot \mathbf{F} = The divergence of $\mathbf{F}$, a scalar-valued function

How It Works

To compute divergence, take the partial derivative of each component of the vector field with respect to its corresponding variable, then add them together. The result is a scalar function, not a vector. Physically, divergence captures whether fluid or flux is being created or destroyed at a point: if you imagine the vector field as the velocity of a fluid, positive divergence at a point means fluid is being produced there, zero divergence means the fluid is incompressible at that point, and negative divergence means fluid is disappearing. Divergence is the key ingredient in the Divergence Theorem (Gauss's Theorem), which relates the total flux through a closed surface to a volume integral of the divergence inside.

Worked Example

Problem: Find the divergence of the vector field F(x,y,z)=(x2y,  3yz,  2xz2)\mathbf{F}(x, y, z) = (x^2 y,\; 3yz,\; 2xz^2).
Step 1: Identify the components: F1=x2yF_1 = x^2 y, F2=3yzF_2 = 3yz, F3=2xz2F_3 = 2xz^2.
Step 2: Compute each partial derivative with respect to its matching variable.
F1x=2xy,F2y=3z,F3z=4xz\frac{\partial F_1}{\partial x} = 2xy, \quad \frac{\partial F_2}{\partial y} = 3z, \quad \frac{\partial F_3}{\partial z} = 4xz
Step 3: Add the three partial derivatives together.
F=2xy+3z+4xz\nabla \cdot \mathbf{F} = 2xy + 3z + 4xz
Step 4: Evaluate at a specific point if needed. At (1,2,3)(1, 2, 3):
F(1,2,3)=2(1)(2)+3(3)+4(1)(3)=4+9+12=25\nabla \cdot \mathbf{F}\big|_{(1,2,3)} = 2(1)(2) + 3(3) + 4(1)(3) = 4 + 9 + 12 = 25
Answer: F=2xy+3z+4xz\nabla \cdot \mathbf{F} = 2xy + 3z + 4xz, which equals 2525 at the point (1,2,3)(1, 2, 3).

Another Example

Problem: Determine whether the vector field G(x,y,z)=(y,  x,  0)\mathbf{G}(x, y, z) = (-y,\; x,\; 0) is incompressible (divergence-free).
Step 1: Identify the components: G1=yG_1 = -y, G2=xG_2 = x, G3=0G_3 = 0.
Step 2: Compute each partial derivative.
G1x=0,G2y=0,G3z=0\frac{\partial G_1}{\partial x} = 0, \quad \frac{\partial G_2}{\partial y} = 0, \quad \frac{\partial G_3}{\partial z} = 0
Step 3: Sum the results.
G=0+0+0=0\nabla \cdot \mathbf{G} = 0 + 0 + 0 = 0
Answer: The divergence is 00 everywhere, so G\mathbf{G} is incompressible. This field represents pure rotation around the zz-axis with no expansion or contraction.

Why It Matters

Divergence appears throughout Calculus III (Multivariable Calculus) and is essential for understanding the Divergence Theorem, one of the central results that connects surface integrals to volume integrals. In physics and engineering, Maxwell's equations use divergence to describe electric and magnetic fields — Gauss's law states that the divergence of the electric field equals the charge density divided by the permittivity of free space. Fluid dynamics, heat transfer, and computational simulations all rely on divergence to model how quantities flow and accumulate.

Common Mistakes

Mistake: Differentiating each component with respect to all three variables instead of only its corresponding variable.
Correction: F1F_1 is differentiated only with respect to xx, F2F_2 only with respect to yy, and F3F_3 only with respect to zz. You are computing a dot product of \nabla with F\mathbf{F}, not the full Jacobian.
Mistake: Expecting divergence to produce a vector.
Correction: Divergence always outputs a scalar. If your result is a vector, you may have confused divergence (F\nabla \cdot \mathbf{F}) with the gradient (f\nabla f) or curl (×F\nabla \times \mathbf{F}).