What Is Divergence?
A vector field F = ⟨P(x, y), Q(x, y)⟩ attaches an arrow to every point of the plane, think wind velocity on a weather map, or water current in a shallow basin. The divergence asks a local question at each point: is the field, on net, flowing out of a tiny neighborhood there, or into it?
div F = ∂P/∂x + ∂Q/∂y
Positive divergence marks a source arrows spread away, as from a faucet feeding the flow. Negative marks a sink arrows converge, a drain. Zero divergence means whatever flows in flows out: the field is incompressible there, the defining property of water-like flow. The formula's logic: ∂P/∂x measures whether the rightward component grows left-to-right (net horizontal escape), ∂Q/∂y the same vertically; their sum is total outflow tendency per unit area.
How to Use This Calculator
Enter both components of the field. The two relevant partials are computed symbolically and summed into div F as a formula; add a point for the numeric value with its interpretation, source-like, sink-like, or incompressible. The arrow plot draws the field itself, and the chips are built for eye-training: the radial source's arrows visibly flee the origin (div = 2 everywhere), the sink's converge, and the rotation field ⟨−y, x⟩ swirls without spreading, divergence exactly 0, all rotation, no expansion.
Worked Example
The radial field F = ⟨x, y⟩, every arrow points directly away from the origin, growing with distance. The partials: ∂P/∂x = 1, ∂Q/∂y = 1, so
div F = 2, at every point of the plane
A uniform source: each tiny region everywhere pumps out net flow at the same rate. The constant answer surprises students expecting more outflow far from the origin, but divergence is per unit area and while the arrows are longer out there, their spreading is no more intense. Contrast the rotation chip: ⟨−y, x⟩ has ∂(−y)/∂x = 0 and ∂x/∂y = 0, div = 0, pure swirl, nothing created or destroyed.
Divergence and Curl: the Two Local Questions
| Divergence | Curl | |
|---|---|---|
| Question | Expanding or contracting? | Rotating? |
| Formula (2D) | Px + Qy | Qx − Py |
| Zero means | Incompressible | Irrotational |
| Big theorem | Divergence theorem (flux) | Green's/Stokes' theorem (circulation) |
Together they decompose a field's local behavior completely, every field is locally a blend of expansion, rotation, and shear, and these two derivatives read off the first two ingredients. The Curl Calculator handles the rotational half.
Common Mistakes to Avoid
- Crossing the components. Divergence pairs each component with its own variable: P with x, Q with y. The crossed pairing (Qx Py) belongs to curl, the single most common mix-up.
- Expecting a vector answer. Divergence is a scalar field, one number per point. (The gradient of a scalar is a vector; the divergence of a vector is a scalar; they're adjoint operations, not twins.)
- Reading arrow length as divergence. Long arrows mean a strong field, not necessarily a spreading one, the uniform field ⟨5, 0⟩ has div = 0. Spreading is about how arrows change across space.
- Forgetting div is local. A field can be source-like in one region and sink-like in another; evaluate at the point you care about, not "for the field" globally.
Real-World Applications
Divergence is conservation law grammar. Fluid dynamics writes incompressibility as div v = 0, the constraint distinguishing water from compressible air in every simulation, from weather models to movie CGI smoke. Electromagnetism's Gauss law reads div E = charge density/ε₀: electric field lines begin on charges, and divergence is precisely the "beginning" detector, while div B = 0 encodes the absence of magnetic monopoles, one of Maxwell's four equations stated entirely in this page's operator.
Beyond physics: in meteorology, near-surface wind divergence marks high-pressure zones (sinking, spreading air) and convergence marks storm-breeding lows; oceanographers track upwelling the same way. Medical imaging quantifies heart-wall expansion via divergence of tissue-velocity fields, and computer graphics uses divergence-free projection every frame to keep simulated fluids from spontaneously gaining or losing volume. Wherever "stuff is conserved" meets "stuff flows," div F is the bookkeeping.
Frequently Asked Questions
What is the divergence theorem, informally?
Total outflow through a closed boundary equals the integral of divergence over the inside, add up all the microscopic sources and you get the macroscopic flux. It converts hard boundary integrals into often-easier area/volume integrals, and it's the reason "net flux from a region with no sources is zero" is a theorem rather than a hope.
How does 2D divergence extend to 3D?
Add the third term: div F = Px + Qy + Rz for F = ⟨P, Q, R⟩, same per-component pattern, same meaning. The ∇· notation makes the pattern mechanical: dot the derivative vector ⟨∂x, ∂y, ∂z⟩ against the field.
Can a field have zero divergence everywhere yet still "flow"?
Absolutely, the rotation chip is exactly that: vigorous motion, zero divergence. Incompressibility constrains the flow's geometry (no net local expansion), not its strength. Rivers flow powerfully while remaining nearly divergence-free.
What does the ∇· ("del dot") notation mean?
Formally treating the gradient operator ∇ = ⟨∂/∂x, ∂/∂y⟩ as a vector and taking its dot product with F: ∇·F = ∂P/∂x + ∂Q/∂y. The mnemonic runs deep, the same ∇ builds gradient (∇f), divergence (∇·F), and curl (∇×F), unifying vector calculus's three derivatives.
Is divergence related to the Laplacian?
Directly: the Laplacian of a scalar function is the divergence of its gradient, ∇²f = div(∇f) = fxx + fyy. Heat flowing down temperature gradients and diffusing chemicals both obey equations built from exactly this composition, tying this page to the second partials world.
Why is div F = 2 for ⟨x, y⟩ but 0 for the same-looking vortex arrows?
Because divergence reads growth of components along their own axes, not the arrows' visual drama. In ⟨x, y⟩ each component strengthens along its axis (both partials 1); in ⟨−y, x⟩ neither does (both partials 0). Two fields can look equally energetic while one expands and the other only circulates, the calculator's symbolic answer is the referee.
Is divergence a scalar or a vector quantity?
Divergence is a scalar field, producing one number at each point that measures net outflow per unit area. This contrasts with the gradient, which turns a scalar into a vector, and curl, which keeps a vector as a vector in three dimensions.