# The Divergence

## Definition

We've discussed partial derivatives, and we've even discussed a way to take a sort of "complete" derivative of multivariable functions (the gradient). But the gradient only works for scalar functions; how about a "complete" kind of derivative for vector fields?

In two dimensions, there is just one, but in three dimensions, there are, for reasons which won't appear until much later in your mathematical education. The first of these is called the divergence, which we investigate now.

Consider a vector field $\vec{F}=f_1\vec{i}+f_2\vec{j}+f_3\vec{k}$, which we interpret as representing the velocity of a fluid occupying space, or a very thin layer of flowing fluid on a plane. Suppose we wished to find out if there are any sources of fluid (like a faucet), or drains - how might we go about this?

Well, consider some specific point, $(x_0,y_0,z_0)=\vec{p}$. If we surround $\vec{p}$ with a sphere, call it S, then obviously

$\iint\limits_{S}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\;\;\;\subset\!\supset \vec{F} dS$

will contain some contribution from whatever "flow" is coming out of, or going into, $\vec{p}$. It will, of course, also contains contributions from the various other points in its interior, but, if we let the radius r of the sphere S go to 0, then this integral will ONLY measure the flow at $\vec{p}$. Hence we define the divergence of a vector field $\vec{F}$ as

$\operatorname{div}\ \vec{F} = \lim_{r\to 0} \left( \frac{1}{\frac{4}{3}\pi r^3} \iint\limits_{S}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\;\;\;\subset\!\supset \vec{F}\cdot\vec{n}_S dS \right)$

where $\vec{n}_S$ is the outward pointing surface normal of unit length to S.

### Two Dimensions

The obvious form of this for a two-dimensional vector field would be the limit of a line integral on a circle around a point, with one minor exception: usually, when we take the line integral of a vector field, we examine the dot product of the field with the curve tangent. However, in this case, we will examine the dot product of the field with the outward pointing curve normal, which for a circle, is $-\partial_s \vec{T}$ where the derivative is taken with regard to arc length on the circle s.

Therefore, in two dimensions, we have:

$\operatorname{div}\ \vec{F} = \lim_{r\to 0} \left( \frac{1}{\pi r^2} \oint_C \vec{F}\cdot\frac{-d\vec{T}}{ds} dA \right)$

## Computation

See the proof page for details.

This is an unwieldy definition, so we frequently use the equivalent statement

$\operatorname{div} \vec{F} = \frac{\partial f_1}{\partial x} + \frac{\partial f_2}{\partial y} + \frac{\partial f_3}{\partial z}$

or in two dimensions, just $\frac{\partial f_1}{\partial x} + \frac{\partial f_2}{\partial y}$. Note that if we were to define a "vector" $\nabla = \vec{i}\partial_x +\vec{j}\partial_y + \vec{k}\partial_z$, we would have $\operatorname{div}\ \vec{F} = \nabla \cdot \vec{F}$. Note that this isn't technically a vector, since the component are not number but differential operators, and the kind of "multiplication" we're doing isn't really multiplication, since you can't multiply an operator by a function; instead we're differentiating the components. Nevertheless, it's a handy notational convenience, and it actually does point to a deeper truth we won't begin to address in this course, so we'll continue to use $\nabla \cdot \vec{F}$ for the divergence.

# The Curl

Since we've taken the dot product of our new differential operator $\nabla$ with a vector field, it only makes sense to see what happens when we take the cross product as well.

$\nabla \times \vec{F} = \begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\ \partial_x & \partial_y & \partial_z \\f_1&f_2&f_3\end{vmatrix} = \left( \frac{\partial f_3}{\partial y} - \frac{\partial f_2}{\partial z} \right)\vec{i} - \left(\frac{\partial f_3}{\partial x} - \frac{\partial f_1}{\partial z} \right) \vec{j} + \left( \frac{\partial f_2}{\partial x} - \frac{\partial f_1}{\partial y} \right) \vec{k}$

$= \left( \frac{\partial f_3}{\partial y} - \frac{\partial f_2}{\partial z} \right)\vec{i} + \left( \frac{\partial f_1}{\partial z} - \frac{\partial f_3}{\partial x} \right) \vec{j} + \left( \frac{\partial f_2}{\partial x} - \frac{\partial f_1}{\partial y} \right) \vec{k}$.

Of course, this is useless if we don't know what it measures. Let's investigate:

Here, we see space with the positive x-axis poking out of the screen towards us. Note that the difference in values and direction of the two partial derivatives is cause by the fact that the direction of the lines coming out of their common basepoint is rotating around in the neighborhood of that point.

The first component, $\left( \partial_y f_3 - \partial_z f_2 \right)$, gives us the extent of the vector $\nabla \times \vec{F}$ in the x-axis direction. The expressions gives us, basically, how fast the fluid moving "up" along the z-axis "tips" in the direction of the y-axis, minus how much the fluid moving in the direction of the y axis tips in the direction of the z axis. This is just a measurement of how much the field is rotating about the x-axis (see illustration). By a similar logic, we see the other components will measure how much the field is rotating about the various other axes, and so when we add these all together, the result will be a vector which A) points along the line around which the field is rotating the most, and B) has magnitdue equal to how fast the fluid is rotating. For this reason, the expression $\nabla \times \vec{F}$ is often called the rotation or curl of $\vec{F}$, and you will sometimes see $\mathbf{rot}\vec{F}$ or $\mathbf{curl}\vec{F}$ used for $\nabla \times \vec{F}$.

# Applications of the Divergence and Curl

If we imagine a vector field as being a fluid which fills space, and moves around in it, so that the atom of water at point $\vec{p}$ is travelling in the direction of $\vec{F}$ with speed equal to $\vec{F}$s magnitude, then the divergence $\nabla \cdot \vec{F}$ simply tells us if it is compressing or decompressing. For this reason, a vector field such that $( \nabla \cdot \vec{F})(\vec{p})=0$ for all points $\vec{p}$ is called incompressible. For reasons associated with magnetic and electrical phenomenon, we also call such a field "solenoidal".

Alternatively, we may view a vector field as heat flowing through a solid body, like a metal bar. Places where the divergence is positive would then be places where heat is being created (by a fire, by contact with a hot body, by nuclear decay, etc.), and for those reasons, points $\vec{p}$ where $(\nabla \cdot \vec{F})(\vec{p})>0$ are called sources. Similarly, if the divergence is negative, that means heat is leaving, maybe because of refrigeration, contact with a cold body, or an endothermic reaction of some kind. For that reason, points $\vec{p}$ where $(\nabla \cdot \vec{F})(\vec{p})<0$ are called heat sinks or more commonly, simply sinks.

If we return now the the fluid understanding of a vector field, imagine putting a paddlewheel in a particular spot. The fluid might make the paddlewheel spin if we put in in along one axis, and might not if it goes in along another axis. The axis along which the wheel will spin fastest is the direction of $\nabla \times \vec{F}$, and the magnitude of $\nabla \times \vec{F}$ tells us how fast the paddlewheel will spin.

So, if a vector field satisfies $\nabla \times \vec{F}=\vec{0}$, it means it's not spinning around any axis, anywhere. It makes sense to call such a field irrotational.