Multivariable calculus

Divergence of the Radial Field F = (x, y)

For the radial field F(x, y) = (x, y) the divergence is the constant 2. Both diagonal partials equal 1, and 1 plus 1 is 2. The value does not depend on x or y, so the field spreads at the same rate everywhere: every point in the plane acts as a source of identical strength.

F(x,y)=x, y\mathbf{F}(x,y) = \langle x,\ y \rangle
Px=x(x)=1\frac{\partial P}{\partial x} = \frac{\partial}{\partial x}\left(x\right) = 1
Qy=y(y)=1\frac{\partial Q}{\partial y} = \frac{\partial}{\partial y}\left(y\right) = 1
F=1+1=2\nabla \cdot \mathbf{F} = 1 + 1 = 2

Differentiate each component with respect to its own variable

Divergence eats a vector field and returns a number at each point. You differentiate the first component with respect to xx, the second with respect to yy, and add. Only those two diagonal pairings appear.

F=Px+Qy\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}

Here P(x,y)=xP(x,y) = x and Q(x,y)=yQ(x,y) = y, so both derivatives are as easy as derivatives get.

Px=1,Qy=1\frac{\partial P}{\partial x} = 1, \qquad \frac{\partial Q}{\partial y} = 1

Adding gives F=2\nabla \cdot \mathbf{F} = 2 at every point of the plane, the origin included.

The mistake: adding the wrong two partials

This field has four first partials, and only two of them belong to the divergence.

  • Px=1\frac{\partial P}{\partial x} = 1 and Qy=1\frac{\partial Q}{\partial y} = 1: these two are the divergence.
  • Py=0\frac{\partial P}{\partial y} = 0 and Qx=0\frac{\partial Q}{\partial x} = 0: these two are the curl.
  • Swap the pairs and you report a divergence of 00 when the true value is 22: you have read the curl's two partials and put the divergence's name on them.
scalar curl=QxPy=00=0\text{scalar curl} = \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} = 0 - 0 = 0

The other habit to break is stacking instead of summing. If your answer is 1,1\langle 1, 1 \rangle, you have built a vector, which is what the gradient does. Divergence of a plane field is one number.

Why a constant answer is the right shape here

Picture the arrows: at each point the arrow points straight away from the origin, with length equal to the distance from the origin. Far out the arrows are long, near the origin they are short. Divergence does not measure that length. It measures how fast nearby arrows spread apart.

That spreading rate is the same everywhere, which is what the constant 22 records. Read as a fluid velocity, a small blob carried by this flow grows its area at a relative rate of 22 per unit time no matter where it starts.

The pattern generalises: in nn dimensions the field x1,x2,,xn\langle x_1, x_2, \dots, x_n \rangle has divergence nn, because each of the nn diagonal partials contributes exactly 11.

Checked on every build: each component is differentiated numerically with respect to its own variable, and the sum is compared against the divergence above at six sample points.

Frequently asked questions

Is the divergence of (x, y) smaller near the origin, where the arrows are short?

No. It equals 22 at every point, origin included. Short arrows near the origin still spread apart at the same relative rate, and that rate is what divergence measures.

What is the divergence of the 3D radial field (x, y, z)?

It is 33. The computation is the same with one more term: xx+yy+zz=1+1+1=3\frac{\partial}{\partial x}x + \frac{\partial}{\partial y}y + \frac{\partial}{\partial z}z = 1 + 1 + 1 = 3.