From the "ledger" of a tiny box to ∇·F — seeing divergence step by step
From ScratchNo Steps SkippedDiagrams ⇄ Formulas 1-to-1
Part I
What is Divergence: From Water Flow to Formula
Goal: Turn "divergence" from a scary term into something you can draw.
1Problem Introduction: Secrets in Water Flow
Imagine you are standing in a stream. In some places, water rushes at you from all directions (you are at a convergence point); in other places, water spreads out in all directions from beneath your feet (you are at a spring).
We use a vector field to describe water flow: at every point on the plane, draw a small arrow—arrow direction = flow direction, arrow length = flow speed. In the figure below, can you see where the flow is "welling out" and where it is "sucking in"?
Enter the ProtagonistDivergence is a number that tells you: at a given point, is the vector field "spurting outward" (positive divergence), "sucking inward" (negative divergence), or "just flowing through—no spurt, no suck" (zero divergence). Denoted as ∇·F or div F.
Notation ConventionThe vector field is written as F(x, y) = ( P(x, y), Q(x, y) ). P is the x-component of the arrow (horizontal push), Q is the y-component (vertical push). In what follows, "x-direction flux" and "y-direction flux" refer to the changes in P and Q.
21D Warm-Up: 1D "Divergence" Is Just the Derivative
Before diving into 2D, let us look at a "vector field" on a line—essentially a number line where each point is labeled with a signed number. For example, F(x) = x: the positive half pushes right, the negative half pushes left (both push away from the origin). Now consider F(x) = −x: everything points toward the origin.
In 1D, "divergence" reduces to the derivative dF/dx:
F(x) = x → dFdx = +1 (pushes outward everywhere)
F(x) = −x → dFdx = −1 (sucks inward everywhere)
Key IntuitionDerivative > 0 → take one step to the right, the arrow gets longer (diverging); derivative < 0 → take one step to the right, the arrow gets shorter (converging). 1D divergence = derivative = a measure of "how fast the arrow changes with position".
In 1D there is a simple verification: at point x, look at the net outflow from left and right. Inflow from the left = F(x−Δx), outflow from the right = F(x+Δx). Net outflow ≈ F(x+Δx) − F(x−Δx) ≈ 2Δx · F'(x). The larger the derivative, the larger the net outflow.
1D Is Not EnoughReal-world flows are 2D (or even 3D). In 1D there is only one direction for "in and out"; in 2D there are four directions! So we need to upgrade—now entering 2D.
3Entering 2D: A Sea of Arrows on the Plane
A 2D vector field F(x, y) = (P(x, y), Q(x, y))—at every point (x, y) on the plane, attach an arrow (P, Q). This is a "sea of arrows".
Let us first look at the four simplest fields to build intuition:
Feel First, Don't CalculateDon't worry about the divergence formula yet. Just look at these four fields: where do the arrows seem to "spurt outward"? Where do the arrows seem to "gather together"?
Key FactIn 2D, a point can push outward horizontally while sucking inward vertically (or vice versa). Divergence adds together the "in and out" from both directions—horizontal net outflow + vertical net outflow.
How do we calculate "net outflow"? We need to draw a tiny box around a point and count what comes in and what goes out. That is the next section.
4Discovery I: The Small Box "Ledger"
Draw a tiny rectangle with sides Δx and Δy around point (x, y). Each of the four sides has a "flux entry"—the total amount of the vector field passing through the boundary.
The Ledger: Net Flux Through Four Sides
1
Right side (at x+Δx): outflow ≈ P(x+Δx, y) × Δy (horizontal component × side length). Why P? Because the flux through a vertical side depends on the horizontal component.
2
Left side (at x): inflow ≈ P(x, y) × Δy. The left side is "inflow"—vectors point into the box, equivalent to negative outflow.
3
Horizontal net outflow = right − left ≈ [P(x+Δx, y) − P(x, y)] × Δy.
4
Similarly, vertical net outflow = top − bottom ≈ [Q(x, y+Δy) − Q(x, y)] × Δx.
Total net outflow ≈ [P(x+Δx, y) − P(x, y)] × Δy + [Q(x, y+Δy) − Q(x, y)] × Δx
Key FactTotal net flux = horizontal change + vertical change. Not done yet—we need to divide by area to get "net outflow per unit area", i.e., divergence.
5Discovery II: Limit—The Divergence Formula Is Born
Divergence = net outflow per unit area, so we divide the total net outflow by the box area Δx·Δy, then let the box shrink to a point (Δx→0, Δy→0):
1
Divide by area:
Total net outflowΔx·Δy ≈
P(x+Δx, y) − P(x, y)Δx +
Q(x, y+Δy) − Q(x, y)Δy
2
Take limits Δx→0, Δy→0: the two fractions become partial derivatives!
div F =
∂P∂x +
∂Q∂y
Divergence Formula (2D Cartesian Coordinates)Divergence = partial derivative of P with respect to x + partial derivative of Q with respect to y. Remember the mantra: differentiate the horizontal component with respect to the horizontal coordinate + differentiate the vertical component with respect to the vertical coordinate.
Why Is It Called "Divergence"?"Di-" — apart; "vergere" — to turn (Latin). Divergence measures the degree to which a point spreads apart the vector field around it. The English word comes from Latin: di- (apart) + vergere (to turn, to bend).
Takeaway∇·F = ∂P/∂x + ∂Q/∂y. This is the formula for 2D divergence. Let us verify with concrete fields below.
6Verification: Plug in Concrete Fields to Check
Plug the four fields we just saw into the formula one by one, and see whether the divergence values match our geometric intuition:
Field ①: F = (x, y) — Radially Outward
P = x, Q = y
∂P∂x = 1, ∂Q∂y = 1
div F = 1 + 1 = 2
Everywhere positive divergence = 2: every point is a "spring", spurting outward.
Field ②: F = (−x, −y) — All Sucked Toward the Origin
P = −x, Q = −y
∂P∂x = −1, ∂Q∂y = −1
div F = −1 + (−1) = −2
Everywhere negative divergence = −2: every point is a "drain".
Field ③: F = (x, −y) — Horizontally Divergent, Vertically Convergent
P = x, Q = −y
∂P∂x = 1, ∂Q∂y = −1
div F = 1 + (−1) = 0
Zero divergence: however much spurts out horizontally, exactly that much is sucked in vertically—they cancel exactly!
Field ④: F = (y, −x) — Pure Rotation
P = y, Q = −x
∂P∂x = 0, ∂Q∂y = 0
div F = 0 + 0 = 0
Pure rotation: neither component varies with its own coordinate—divergence is zero.
Verification PassedThe divergence formula results for all four fields match visual intuition perfectly ✓. Field ①: positive divergence (source), field ②: negative divergence (sink), fields ③/④: zero divergence (cancellation / rotation).
NoteFields ③ and ④ both have divergence 0, but their shapes are completely different. Divergence only tells you about "in and out", not about "rotation"—rotation is the job of curl. Each describes a different aspect of the vector field.
Part II
Geometric Dictionary of Divergence: Recognize Divergence by Looking
Goal: Build the intuitive reflex of "see a vector field → say its divergence".
7Discovery III: The Three Faces of Divergence
To summarize the first six sections, divergence has only three possible "faces":
div F > 0
Net outflow > net inflow This point is a source Vectors spread outward from this point
e.g. F=(x, y), div=2 Positive charge in an electric field
div F < 0
Net inflow > net outflow This point is a sink Vectors converge toward this point from all sides
e.g. F=(−x,−y), div=−2 Negative charge in an electric field
div F = 0
Net outflow = net inflow This point is solenoidal Whatever comes in goes out
e.g. F=(x,−y), div=0 Incompressible fluid
MnemonicPositive divergence = spring (water bubbles up from underground), negative divergence = leak (water drains into a hole), zero divergence = flow (water just passes through, neither increasing nor decreasing).
8Visual Dictionary: Divergence of Six Classic Vector Fields
Below are the six most common 2D vector fields, with divergence values labeled on each diagram. Look at them repeatedly until you can "guess the divergence just by looking":
Hint: pay attention to the change in arrow length (not change in direction)—divergence cares about "whether arrows get longer or shorter along their own direction".
How to "see" divergence?Imagine placing a tiny rubber band at each point, letting the vector field push and deform it. If the band's area increases → positive divergence; area decreases → negative divergence; area unchanged → zero divergence. This is the geometric definition of divergence!
Key InsightDivergence is unrelated to whether arrow directions rotate. The field F=(y, −x) is a perfect whirlpool—arrows bend sharply—but its divergence is zero everywhere. Divergence only cares about "volume/area change", not about rotation.
9A Major Twist: From Local to Global—The Divergence Theorem
The first six sections were all about divergence at a single point. Now for a major twist: what do we get if we add up the divergence at every point inside a region?
Major Twist (Key)The Divergence Theorem (also called Gauss's Theorem, the divergence form of Green's Theorem): Adding up the divergence at every point inside a region = total flux through the region's boundary. Local accumulation = global outflow.
∬region Ddiv F dA =
∮boundary ∂DF·n ds
Left side: sum of divergence over all infinitesimal elements in the region (volume integral). Right side: total outward flux through the boundary (surface integral).
Intuitive AnalogyA country's population change = births − deaths = sum of changes in the number of babies across all households = net migration flow across borders. The Divergence Theorem says exactly: total internal change = net flux across the boundary.
10Discovery IV: An Intuitive Proof of the Divergence Theorem
Why does the Divergence Theorem hold? Slice the region into countless tiny squares. Each tiny square's net outflow = div F × area. Sum the net outflow of all tiny squares:
1
Internal boundaries cancel each other out. The shared edge of two adjacent squares—one square's "outflow" is exactly the other square's "inflow"; positive and negative cancel to zero.
2
Only the outermost boundary survives. After all internal boundaries cancel in pairs, what remains is exactly the outer boundary of the entire region.
3
Therefore: sum of divergence over all tiny squares (interior integral) = total flux across the outer boundary (boundary integral).
VerificationThis proof uses only one fact: the flux on the shared edge of adjacent squares is equal in magnitude and opposite in direction. This is a necessary consequence of local conservation. No advanced mathematics is required.
11Cross-Disciplinary Easter Eggs: Divergence Is Everywhere
Divergence is not an isolated mathematical trick—it appears repeatedly in physics and engineering, just under different names:
Electromagnetism · Gauss's Law
∇·E = ρ/ε₀ Electric field divergence = charge density. Positive charges are "sources" of the electric field, negative charges are "sinks".
Heat Conduction · Heat Equation
∂u/∂t = α ∇²u = α ∇·(∇u) Temperature change = diffusion of heat divergence. Heat flows from high to low temperature.
General Relativity · Einstein Field Equations
∇·G = 0 The divergence of the Einstein tensor is identically zero—energy-momentum is automatically conserved.
A Unifying ThreadThe Divergence Theorem (Gauss's Theorem) is the common mathematical skeleton of these physical laws. It translates "change inside a region" into "flow across the boundary"—this is the universal language of conservation laws. What you are learning is not just a formula, but a way of seeing the world.
12Full Map: The Path You Have Traveled
Problem: where does water spurt out, where does it get sucked in?
1D: "divergence" = derivative dF/dx
2D: the four-sided ledger of a tiny box
Formula: div F = ∂P/∂x + ∂Q/∂y
Verification: four fields plugged into formula ✓ all match
Three Faces: positive · negative · zero divergence
Six-Field Dictionary: intuition training for recognizing divergence
Divergence Theorem: local accumulation ⇄ global outflow
Intuitive Proof: internal cancellation, only boundary remains
You Can Now
Look at a vector field → judge the sign of divergence → compute divergence values → understand why the Divergence Theorem holds → recognize divergence's various incarnations in physics.
Divergence is no longer just an entry on a formula sheet—you have seen it.
🎮 Divergence Calculator: Try What You Just Learned
Select a vector field, drag the sliders to pick a point, and see the divergence at that point. The nearby arrows are drawn on the right.