Formal definition of divergence in two dimensions

Learn how line integrals are used to formalize the idea of divergence.

Background

If you haven't already, you may also want to read "Why care about the formal definitions of divergence and curl" for motivation.

What we're building to

• In two dimensions, divergence is formally defined as follows:
\begin{aligned} \text{div}\, \blueE{\textbf{F}}\goldE{(x, y)} = \lim_{\left|\redE{A}_{\goldE{(x, y)}}\right| \to 0} \underbrace{ \dfrac{1}{\left|\redE{A}_{\goldE{(x, y)}}\right|} \overbrace{ \oint_{\redE{C}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} }^{\text{2d-flux through \redE{C}}} }_{\text{Flux per unit area}} \end{aligned}
There is a lot going on in this definition, but we will build up to it one piece at a time. The bulk of the intuition comes from the background understanding of flux.

"Outward flow" at a point doesn't really make sense

By this point you should have some idea of what divergence is trying to measure. When a vector field $\blueE{\textbf{F}}(x, y)$ represents a fluid flow, divergence measures the tendency for the fluid to flow away from each point.
However, there's a disconnect between the idea of "outward flow" and divergence itself:
• Divergence is a function which takes in individual points in space.
• The idea of outward flow only makes sense with respect to a region in space. You can ask if a fluid flows out of a given region or into it, but it doesn't make sense to talk about fluid flowing out of a single point.
Formally defining divergence will involve using a flux integral, which measures the outward flow in a region, then taking the appropriate limit as this region shrinks around a specific point.

From a region to a point

In the article on two-dimensional flux, we had the following setup:
• $\blueE{\textbf{F}(x, y)}$ is a vector-valued function representing the velocity vector field of some fluid.
• $\redE{C}$ is a closed loop in the $xy$-plane.
• $\greenE{\hat{\textbf{n}}(x, y)}$ is a function that gives the outward unit normal vector at all points on the curve $\redE{C}$.
I talked about how if you were tracking the mass of fluid in the region enclosed by the curve $\redE{C}$, you could compute the rate at which mass is leaving the region using the following line integral:
\begin{aligned} \underbrace{ -\dfrac{d(\text{fluid mass in region})}{dt} }_{\text{Rate at which mass leaves region}} = \underbrace{ \oint_{\redE{C}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} }_{\text{Flux integral}} \end{aligned}
This is called a "flux integral". If it is positive, fluid tends to be exiting the region, otherwise it tends to be entering the region. You can interpret this integral by imagining walking along the boundary $\redE{C}$ and measuring how much fluid tends to be exiting/entering the region at each point.
What if instead of measuring the change of mass, you wanted to know the change in density? Well, just divide this integral by the area of the region in question. Let's go ahead and give that region a name, $\redE{A}$, and say that $|\redE{A}|$ is the area of the region.
\begin{aligned} \underbrace{ -\dfrac{d(\text{fluid \blueE{\text{density}} in region})}{dt} }_{ \text{Change in mass } \blueE{\text{per unit area in }} \redE{A} } = \dfrac{1}{|\redE{A}|} \oint_{\redE{C}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} \end{aligned}
To formally define divergence of $\blueE{\textbf{F}}$ at a point $\goldE{(x, y)}$, we consider the limit of this change in density as the region shrinks around the point $\goldE{(x, y)}$.
There is no set-in-stone notation for this, but here's what I'll go with:
• Rather than just writing $\redE{A}$, write $\redE{A}_{\goldE{(x, y)}}$ to emphasize that this region contains a specific point $\goldE{(x, y)}$.
This is important because as we start letting the region shrink, we don't want it to wander away from the point.
The expression "$|\redE{A}_{\goldE{(x, y)}}| \to 0$" will indicate that we are considering the limit as the area of $\redE{A}_{\goldE{(x, y)}}$ goes to $0$, meaning $\redE{A}_{\goldE{(x, y)}}$ is shrinking around the point $\goldE{(x, y)}$.
With all this, here's how we write the formal definition of divergence:

"Simple" example: Constant divergence

Unlike other topics, the purpose of an example here is not to practice a skill that you will need. It is just to get a feel for what this relatively abstract definition actually looks like with a concrete function.
Let's use the quintessential "outward flowing" vector field in two dimensions:
\begin{aligned} \blueE{\textbf{F}}(x, y) = \left[ \begin{array}{c} x \\ y \end{array} \right] \end{aligned}
Concept check: Using the usual divergence formula, the one which arises from the notation $\nabla \cdot \blueE{\textbf{F}}$, what is the divergence of $\blueE{\textbf{F}}(x, y) = \left[\begin{array}{c} x \\ y \end{array} \right]$?
Now let's see how the formal definition of divergence works in this case. Let's focus on the origin.
$\goldE{(x, y)} = (0, 0)$
And for our shrinking regions around this point, consider circles. Let $C_r$ denote a circle of radius $r$ centered at the origin, and $D_r$ represent the region enclosed by that circle, where $D$ stands for "Disk".
Notice, for all values of $r$, the disk $D_r$ will contain the point $\goldE{(0, 0)}$, so this is indeed a good family of regions to use.
The formal definition of divergence at $\goldE{(0, 0)}$ would then be written as follows:
\begin{aligned} \; \text{div}\, \blueE{\textbf{F}}\goldE{(0, 0)} = \lim_{|D_r| \to 0} \dfrac{1}{|D_r|} \oint_{\redE{C_r}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} \end{aligned}
This is rather abstract, so let's start filling in the details of this integral.
Concept check: What is $|D_r|$?
Concept check: Which of the following parameterizes $\redE{C_r}$?
Concept check: Using this parameterization, what should we replace $\redE{ds}$ with in the integral $\displaystyle \int_\redE{C_r} \dots\, \redE{ds}$?
Concept check: Which of the following gives an outward facing unit normal vector $\greenE{\hat{\textbf{n}}}$ to $\redE{C_r}$?
Applying all these answers to the expression we had before, here's what we get:
\begin{aligned} \; &\quad \text{div}\, \blueE{\textbf{F}}\goldE{(0, 0)} \\\\ &\qquad \Downarrow \\\\ &= \lim_{|D_r| \to 0} \dfrac{1}{|D_r|} \oint_{\redE{C_r}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} \\\\ &= \lim_{r \to 0} \dfrac{1}{\pi r^2} \int_0^{2\pi} \blueE{\textbf{F}(r\cos(t), r\sin(t))} \cdot \greenE{\hat{\textbf{n}}(r\cos(t), r\sin(t))}\; r\,dt \\\\ &= \lim_{r \to 0} \dfrac{1}{\pi r^2} \int_0^{2\pi} \blueE{\left[ \begin{array}{c} r\cos(t) \\ r\sin(t) \end{array} \right]} \cdot \greenE{\left[ \begin{array}{c} (r\cos(t))/r \\ (r\sin(t))/r \end{array} \right]} \;r\,dt \\\\ &= \lim_{r \to 0} \dfrac{1}{\pi r^2} \int_0^{2\pi} \underbrace{(r\cos^2(t) + r\sin^2(t))}_{r} r\,dt \\\\ &= \lim_{r \to 0} \dfrac{1}{\pi r^2} \int_0^{2\pi} r^2 dt \\\\ &= \lim_{r \to 0} \dfrac{1}{\pi r^2} 2\pi r^2 \\\\ &= 2 \end{aligned}
So the formal definition does actually match the formula $\nabla \cdot \blueE{\textbf{F}}$ that we know and love. Well, at least for this specific example anyway.
I think you'll agree, though, that this is much more labor-intensive to compute. But the point of this formal definition is not to use it for actual computations. The point is that it does a much better job reflecting the idea of "outward fluid flow" in a mathematical formula. Having such a solid grasp of that idea will be helpful when you learn about Green's divergence theorem.

\begin{aligned} \text{div}\, \blueE{\textbf{F}}\goldE{(x, y)} = \lim_{\left|\redE{A}_{\goldE{(x, y)}}\right| \to 0} \underbrace{ \dfrac{1}{\left|\redE{A}_{\goldE{(x, y)}}\right|} \overbrace{ \oint_{\redE{C}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} }^{\text{2d-flux}} }_{\text{Flux per unit area}} \end{aligned}