MULTIVARIABLE CALCULUS • VECTOR FIELDS

Divergence — Compute divergence and interpret it

Learn how divergence measures whether a vector field acts as a source, a sink, or neither at every point in space.

Historical Context & Motivation

Imagine you are standing beside a river, watching the water flow. At some spots, water seems to well up from an underground spring, spreading outward in all directions. At other spots, water funnels down into a drain, disappearing from the surface. Scientists in the 1800s faced a similar challenge: they needed a precise mathematical way to describe where fluid (or electric charge, or heat) was being created or consumed in a flow. That quest gave birth to the concept of divergence, one of the most powerful tools in vector calculus.

Divergence grew out of the broader effort to describe physical phenomena—fluid flow, electromagnetism, and heat transfer—using the language of calculus. The key figures who developed this idea were mathematicians and physicists who realized that a single number at each point in space could capture whether material was spreading out or collecting together.

1828
Green's Theorem
George Green published his essay linking integrals over regions to integrals along their boundaries, laying groundwork for relating flux to divergence in two dimensions.
1831
Gauss and Flux
Carl Friedrich Gauss formulated the Divergence Theorem (also called Gauss's Theorem), connecting surface flux to volume integrals of divergence.
1861
Maxwell's Equations
James Clerk Maxwell used divergence explicitly in his equations for electromagnetism, showing that the divergence of the electric field equals the charge density divided by a constant.
1880s
The Nabla Operator
Oliver Heaviside and Josiah Willard Gibbs standardized the del operator (∇) notation, giving divergence its modern compact form: ∇ · F.

The central question divergence answers is deceptively simple: At a given point in a vector field, is there a net outflow or a net inflow? Understanding how to compute and interpret this single scalar value opens the door to describing everything from air expanding inside a balloon to the electric field radiating from a charged particle.

Core Principles & Definitions

Before diving into calculations, let's nail down the foundational ideas. A vector field assigns a vector (a quantity with both magnitude and direction) to every point in space. Think of a weather map where each location has a wind arrow. Divergence is a single number we compute at each point of such a field. It tells us whether vectors are, on balance, spreading apart (positive divergence), converging together (negative divergence), or balanced (zero divergence) at that location.

1

Vector Field

A function that assigns a vector to every point in a region. Written as F(x, y) in 2D or F(x, y, z) in 3D. Examples include velocity fields in fluids and force fields in physics.
2

The Del Operator (∇)

A symbolic vector of partial derivative operators: ∇ = (∂/∂x, ∂/∂y, ∂/∂z). It doesn't act on its own—it combines with a field via a dot product to produce divergence or via a cross product to produce curl.
3

Divergence (∇ · F)

The dot product of ∇ with a vector field F. It yields a scalar function (a plain number at each point) measuring the net rate of outward flux per unit volume.
4

Source vs. Sink

A point where div F > 0 is a source (material flows outward). A point where div F < 0 is a sink (material flows inward). div F = 0 means the flow is incompressible there.
KEY TAKEAWAY
Think of divergence like a bathtub test. Place a tiny imaginary rubber ball at a point in the flow. If water pushes outward in every direction so the ball would expand, that point has positive divergence. If water rushes inward and would squeeze the ball, that point has negative divergence. If the ball keeps its shape, divergence is zero. Divergence is the "expansion rate" of a flow at a point.

Visual Explanation — Sources, Sinks, and Zero Divergence

The diagram below shows three small regions inside different vector fields. In each case, a tiny circle is drawn to represent a test region around the point in question. The arrows represent the vectors of the field.

Three scenarios: a source where vectors radiate outward, a sink where vectors converge inward, and a zero-divergence region where everything entering on one side exits on the other.

The key insight from this diagram is that divergence is a local measurement. You don't need to look at the entire vector field to find it—you only need to examine a tiny neighborhood around the point. If more "stuff" leaves that neighborhood than enters it, divergence is positive. If more enters than leaves, divergence is negative. If inflow and outflow balance perfectly, divergence is zero.

Mathematical Framework

Now let's turn intuition into algebra. Suppose you have a vector field in two dimensions, written as F(x, y) = ⟨P(x, y), Q(x, y)⟩, where P is the component in the x-direction and Q is the component in the y-direction. The divergence is found by taking the partial derivative of each component with respect to its own variable and then adding them together.

DIVERGENCE IN 2D
div F = ∇ · F = ∂P/∂x + ∂Q/∂y
P = x-component of F, Q = y-component of F. The symbol ∂ denotes a partial derivative—differentiate with respect to one variable while treating the others as constants.

In three dimensions the idea extends naturally. If F(x, y, z) = ⟨P, Q, R⟩, you differentiate each component with respect to the matching variable and add all three results.

DIVERGENCE IN 3D
div F = ∇ · F = ∂P/∂x + ∂Q/∂y + ∂R/∂z
P, Q, R are the x-, y-, and z-components of F respectively. Each partial derivative measures how fast that component changes along its own axis.
💡 Why a Dot Product?
The notation ∇ · F looks like a dot product because it is one—symbolically. The del operator ∇ = ⟨∂/∂x, ∂/∂y, ∂/∂z⟩ is "dotted" with F = ⟨P, Q, R⟩, giving (∂/∂x)(P) + (∂/∂y)(Q) + (∂/∂z)(R). This mirrors the ordinary dot product formula a₁b₁ + a₂b₂ + a₃b₃ but with derivatives instead of plain multiplication.
DIVERGENCE THEOREM (PREVIEW)
∬_S F · n̂ dS = ∭_V (∇ · F) dV
This powerful result says that the total flux of F out through a closed surface S equals the integral of divergence over the enclosed volume V. You'll study this more formally in a later unit, but it reinforces the idea that divergence measures outflow per unit volume.

Interpreting Divergence — A Closer Look

Computing divergence is a mechanical process—take partial derivatives and add. The deeper skill is interpreting what the result tells you. Let's look at several common vector fields and classify their divergence behavior.

Four 2D vector fields with their divergence values. Notice how F = ⟨x, y⟩ always expands (div = 2), while F = ⟨−y, x⟩ rotates without any expansion (div = 0). The field F = ⟨x², 0⟩ has divergence that depends on where you are (div = 2x), and F = ⟨−x, −y⟩ acts as a uniform sink (div = −2).
Divergence values for common 2D vector fields
Vector Field Fdiv FInterpretation
⟨x, y⟩2Uniform source — outflow at every point.
⟨−y, x⟩0Pure rotation — incompressible flow.
⟨x², 0⟩2xSource where x > 0, sink where x < 0, zero on the y-axis.
⟨−x, −y⟩−2Uniform sink — inflow at every point.
⟨y, x⟩0Flow has structure but no net expansion or compression.

Worked Example

Let's walk through a complete divergence computation for a 3D vector field, then interpret the result physically.

Computing Divergence of a 3D Vector Field
1
Step 1 — Identify the vector field and its componentsWe are given the vector field F(x, y, z) = ⟨3x²y, −2yz, 4xz²⟩. We identify P = 3x²y, Q = −2yz, and R = 4xz². Recall the divergence formula: div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z.
P = 3x²y, Q = −2yz, R = 4xz²
2
Step 2 — Compute ∂P/∂xDifferentiate P = 3x²y with respect to x, treating y as a constant. Using the power rule, d/dx(x²) = 2x, so ∂P/∂x = 3(2x)y = 6xy.
∂P/∂x = 6xy
3
Step 3 — Compute ∂Q/∂yDifferentiate Q = −2yz with respect to y, treating z as a constant. Since −2z is constant with respect to y, ∂Q/∂y = −2z.
∂Q/∂y = −2z
4
Step 4 — Compute ∂R/∂zDifferentiate R = 4xz² with respect to z, treating x as a constant. The power rule gives d/dz(z²) = 2z, so ∂R/∂z = 4x(2z) = 8xz.
∂R/∂z = 8xz
5
Step 5 — Add the three partial derivativesCombine the results: div F = 6xy + (−2z) + 8xz = 6xy − 2z + 8xz. This is a scalar function of x, y, and z. Its sign depends on the location.
div F = 6xy − 2z + 8xz
6
Step 6 — Interpret at a specific pointEvaluate at the point (1, 2, 1): div F = 6(1)(2) − 2(1) + 8(1)(1) = 12 − 2 + 8 = 18. Since 18 > 0, the field acts as a source at (1, 2, 1)—fluid would be expanding outward there.
div F at (1, 2, 1) = 18 > 0 → source

Divergence vs. Curl — Key Comparisons

Students often confuse divergence with another vector calculus operation called curl. Both use the del operator ∇ and both analyze vector fields, but they measure fundamentally different things. Understanding how they differ will help you avoid common mistakes and deepen your understanding of divergence itself.

Divergence versus curl at a glance
FeatureDivergence (∇ · F)Curl (∇ × F)
OperationDot product: ∇ · FCross product: ∇ × F
Output typeScalar (a single number at each point)Vector (has magnitude and direction)
What it measuresExpansion / compression (source or sink strength)Rotation / swirling tendency
Physical analogyAir blowing out of a balloonWater swirling down a drain
Zero means…Incompressible (no net expansion)Irrotational (no local spinning)
2D defined?Yes: ∂P/∂x + ∂Q/∂yYes (as a scalar): ∂Q/∂x − ∂P/∂y
KEY TAKEAWAY
A helpful memory trick: Divergence asks "Is the field spreading out?" while curl asks "Is the field spinning?" Think of a sprinkler: the water spreading across your lawn is divergence; the rotating sprinkler head itself is curl. Both can happen in the same field at the same time—they measure independent properties.

Connection to Advanced Theory

Divergence is not just an isolated calculation—it sits at the heart of many areas of higher mathematics and physics. Once you're comfortable computing ∇ · F, you'll encounter it in courses on differential equations, fluid dynamics, and electromagnetism. Here's a preview of where divergence leads.

How divergence connects to more advanced topics
Concept You Know NowAdvanced Extension
div F = ∂P/∂x + ∂Q/∂y + ∂R/∂zDivergence Theorem (Gauss's Theorem): relates the integral of div F over a volume to the flux through the enclosing surface.
div F = 0 means incompressibleContinuity equation in fluid dynamics: ∂ρ/∂t + ∇ · (ρv) = 0 expresses conservation of mass.
Positive divergence = sourceGauss's Law in electrostatics: ∇ · E = ρ/ε₀ says electric charge acts as a source of the electric field.
Divergence is a scalar from a vector fieldThe Laplacian ∇²f = ∇ · (∇f) applies divergence to a gradient, central to heat flow and wave equations.

The most important takeaway for now is that divergence is not the end of the story—it's a building block. When you eventually study the Divergence Theorem, you'll see how computing ∇ · F inside a region can replace a difficult surface integral around that region. And in physics, Maxwell's equations use divergence to state that electric charges are the sources of electric fields and that magnetic monopoles don't exist (∇ · B = 0). Each of these connections builds directly on the computation and interpretation skills you've learned in this lesson.

Practice Problems

PROBLEM 1CONCEPTUAL
A 2D vector field has arrows that all point in the same direction (to the right) and all have the same length everywhere. Is the divergence of this field positive, negative, or zero? Explain your reasoning using the source/sink idea.
PROBLEM 2BASIC CALCULATION
Compute the divergence of the 2D vector field F(x, y) = ⟨5xy, 3y²⟩.
PROBLEM 3INTERMEDIATE
Find the divergence of the 3D vector field F(x, y, z) = ⟨eˣ sin y, eˣ cos y, z²⟩. Then determine whether the point (0, π/2, 3) is a source or a sink.
PROBLEM 4APPLIED
A fluid velocity field is modeled by v(x, y) = ⟨2x − y, −x + 3y⟩ in meters per second. A chemical engineer wants to know whether fluid is accumulating or dispersing at the point (4, 1). Use divergence to answer, and explain what the numerical value means in physical terms.
PROBLEM 5CRITICAL THINKING
Consider the 2D vector field F(x, y) = ⟨f(x), g(y)⟩ where f and g are differentiable functions. Prove that the divergence of F depends only on f ′(x) and g ′(y), and explain why this means the divergence of any field of this separable form is completely determined by how each component stretches along its own axis. Give an example of a separable field with zero divergence everywhere that is not a constant field.

Lesson Summary

Divergence measures whether a vector field is expanding or compressing at a given point. Computed as ∇ · F = ∂P/∂x + ∂Q/∂y (+ ∂R/∂z in 3D), it produces a scalar function from a vector field. A positive divergence identifies a source (net outflow), a negative divergence identifies a sink (net inflow), and zero divergence means the flow is incompressible at that point.

The del operator ∇ acts on F via a symbolic dot product, matching each partial derivative to its corresponding component. Divergence differs from curl (which measures rotation) and connects forward to the Divergence Theorem, Maxwell's equations, and the Laplacian. Mastering computation and interpretation now builds a critical foundation for physics and advanced mathematics.

Varsity Tutors • Multivariable Calculus • Divergence — Compute divergence and interpret it