Imagine you are standing in the middle of a wide square crowded with people. If a sudden downpour starts, everyone will start running from the center outward toward the covered streets – this is positive divergence, representing an "outflow" of motion from the point.
On the other hand, if someone hands out money in the middle of the square, people will stream inward from all the streets toward the center – this is negative divergence (a sink), which draws the motion into it.
If a group of people passes through the square so that the number entering exactly equals the number leaving, there is no net change, and the divergence at the center of the square is zero.
In vector analysis, divergence is an operator that measures the local density of sources or sinks in a given vector field, and the result of applying it is a scalar quantity. Mathematically, the operation is defined as the dot product of the nabla operator \((\nabla)\) with the vector field \(\vec{F}\), that is: \[\text{div}\, \vec{F} = \nabla \cdot \vec{F}.\] In Cartesian coordinates, for a field \[\vec{F} = F_x \hat{i} + F_y \hat{j} + F_z \hat{k},\] the formula for computing it is the sum of the partial derivatives: \[\nabla \cdot \vec{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}.\]
The main importance of the concept is expressed in Gauss’s theorem (the divergence theorem), which states that \[\iiint_V (\nabla \cdot \vec{F})\, dV = \iint_S \vec{F} \cdot d\vec{S},\] which proves that the total flux leaving a closed surface \(S\) is exactly equal to the sum of all the "sources" inside the volume \(V\) enclosed by it.
In addition, divergence is a cornerstone of Maxwell’s equations, for example in Gauss’s law for electricity \[\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0},\] which explains how electric charge density \((\rho)\) acts as a source that creates a positive or negative electric field.
A tiny grain carried along by the field. Its direction shows where the field flows at each point.
Here the field flows outward: the divergence is positive. The bigger the dot, the stronger the outflow.
Here the field is drawn inward and disappears: the divergence is negative.
The direction of the field at a point. The longer and brighter the arrow, the stronger the field. Blue: pointing away from the center. Red: pointing toward it.
A closed surface. Every particle or arrow that crosses it turns gold. The control panel shows how many particles entered and left each second.
The divergence value in real time: at the central point, and when the Gauss surface is on, inside the ball. Blue when positive, red when negative.
Dragging rotates the space, and the wheel zooms in and out. Dragging the ball moves it.