LIMA
With God’s help
עברית

Divergence

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.

Theory in brief

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.

dS S V The flux leaving through the surface S equals the total of the sources inside the volume V A particle crossing the surface turns gold

How to read the lab

Light particle

A tiny grain carried along by the field. Its direction shows where the field flows at each point.

Blue dot at the center = source

Here the field flows outward: the divergence is positive. The bigger the dot, the stronger the outflow.

Red dot at the center = sink

Here the field is drawn inward and disappears: the divergence is negative.

Arrow

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.

Glass ball = Gauss surface

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 equation in the corner

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.

Mouse

Dragging rotates the space, and the wheel zooms in and out. Dragging the ball moves it.

To the lab ↓
Loading the lab...
1

Experiments to try in the lab

  1. The calm river (zero divergence). Set the slider to the center, at the value zero (0). Turn on the "Gauss surface" button so that the glass ball encloses the center of the space. Focus on the particles crossing the ball’s surface.
    Think of it like a river flowing gently – nothing is created out of nothing and nothing disappears. If a hundred particles enter your glass ball from one side, exactly a hundred particles must leave from the other side. Because there is no hidden "faucet" inside the ball adding water, the net divergence is simply zero. You can be completely exhausted, but the rule here couldn’t be simpler: what goes in – comes out. No surprises.
  2. The space sprinkler (positive divergence). Move the slider to the right to a high positive value (+). Switch the view from "Particles" to vector field "Arrows" (Vector Mode). Zoom in on the central point and examine the direction of the arrows.
    Imagine someone just turned on a powerful sprinkler inside the space. The arrows all move away from the center outward (they "diverge" – hence the name Divergence), as if there were a small sun there firing rays in every direction. Positive divergence means that, mathematically, we have found a source. This point produces flow that wasn’t there before. That’s why the equation in the corner jumps to a positive number – it simply measures the strength of this "explosion"!
  3. The drain hole (negative divergence). Pull the slider to the left to a negative value (-). Switch back to the particle view and turn on the transparent Gauss surface again. Watch the particles arriving from outside the ball.
    Notice how everything gets sucked inward. It’s exactly like the moment you pull the plug in the bathtub and the water starts disappearing down the drain. The particles enter through the glass of the ball, but they never come out! They are simply swallowed by the red center. This is a sink. When the divergence is negative, space literally "eats" the flow and makes it vanish into that one point.
  4. The language of mathematics (reading the equation in real time). Play with the slider quickly between plus and minus while looking only at the equation floating in the corner \((\nabla\cdot\vec{F})\). Try to predict what will happen to the value of the equation just before you stop the slider.
    Let’s connect the intuition to the formulas that scare students. All this strange symbol \((\nabla\cdot)\) does is go point by point through space and ask one simple question: "Are things running away from you or being sucked toward you?". When you see particles flying outward, the math translates what you see into a positive number. It’s not a threatening equation, it’s simply a flow meter reading the terrain.
  5. Gauss’s optical illusion (a source outside the surface). Set the slider to a strong positive divergence. Now, using the mouse, drag the glass surface (the Gauss ball) so that it no longer encloses the center, but just sits in an empty region on the right side. Check what happens to the particles that pass through it now.
    Boom! This is where the whole course clicks! Even though there is a crazy sprinkler spraying particles through space, look at the ball we moved aside: every particle fired from the sprinkler into the ball passes through it and keeps going. There is no new source inside the ball itself. And so, from the ball’s point of view, the divergence inside it is exactly... zero! Gauss’s theorem says that if you have no faucet or drain hole inside the volume you are checking, everything that goes into it must come out. Brilliant, right?