If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Multivariable calculus

### Course: Multivariable calculus>Unit 5

Lesson 1: Formal definitions of div and curl (optional reading)

# 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 start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, left parenthesis, x, comma, y, right parenthesis 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:
• start color #0c7f99, start bold text, F, end bold text, left parenthesis, x, comma, y, right parenthesis, end color #0c7f99 is a vector-valued function representing the velocity vector field of some fluid.
• start color #bc2612, C, end color #bc2612 is a closed loop in the x, y-plane.
• start color #0d923f, start bold text, n, end bold text, with, hat, on top, left parenthesis, x, comma, y, right parenthesis, end color #0d923f is a function that gives the outward unit normal vector at all points on the curve start color #bc2612, C, end color #bc2612.
I talked about how if you were tracking the mass of fluid in the region enclosed by the curve start color #bc2612, C, end color #bc2612, 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 start color #bc2612, C, end color #bc2612 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, start color #bc2612, A, end color #bc2612, and say that vertical bar, start color #bc2612, A, end color #bc2612, vertical bar 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 start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 at a point start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, we consider the limit of this change in density as the region shrinks around the point start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05.
There is no set-in-stone notation for this, but here's what I'll go with:
• Rather than just writing start color #bc2612, A, end color #bc2612, write start color #bc2612, A, end color #bc2612, start subscript, start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, end subscript to emphasize that this region contains a specific point start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05.
This is important because as we start letting the region shrink, we don't want it to wander away from the point.
The expression "vertical bar, start color #bc2612, A, end color #bc2612, start subscript, start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, end subscript, vertical bar, \to, 0" will indicate that we are considering the limit as the area of start color #bc2612, A, end color #bc2612, start subscript, start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, end subscript goes to 0, meaning start color #bc2612, A, end color #bc2612, start subscript, start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, end subscript is shrinking around the point start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05.
With all this, here's how we write the formal definition of divergence:
\begin{aligned} \text{div}\, \blueE{\textbf{F}}\goldE{(x, y)} = \!\!\!\!\!\! \underbrace{ \lim_{|\redE{A}_{\goldE{(x, y)}}| \to 0} }_{\substack{ \text{Region is shrinking} \\ \text{around \goldE{(x, y)}} }} \!\!\! \overbrace{ \dfrac{1}{|\redE{A}_{\goldE{(x, y)}}|} \underbrace{ \oint_{\redE{C}} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\;\redE{ds} }_{\text{Flux through \redE{C}}} }^{\substack{ \text{Negative change of} \\ \text{fluid \blueE{\text{density}} in \redE{A}_{\goldE{(x, y)}}} }} \end{aligned}

## "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 del, dot, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, what is the divergence of $\blueE{\textbf{F}}(x, y) = \left[\begin{array}{c} x \\ y \end{array} \right]$?
del, dot, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, left parenthesis, x, comma, y, right parenthesis, equals

Now let's see how the formal definition of divergence works in this case. Let's focus on the origin.
start color #a75a05, left parenthesis, x, comma, y, right parenthesis, end color #a75a05, equals, left parenthesis, 0, comma, 0, right parenthesis
And for our shrinking regions around this point, consider circles. Let C, start subscript, r, end subscript denote a circle of radius r centered at the origin, and D, start subscript, r, end subscript represent the region enclosed by that circle, where D stands for "Disk".
Notice, for all values of r, the disk D, start subscript, r, end subscript will contain the point start color #a75a05, left parenthesis, 0, comma, 0, right parenthesis, end color #a75a05, so this is indeed a good family of regions to use.
The formal definition of divergence at start color #a75a05, left parenthesis, 0, comma, 0, right parenthesis, end color #a75a05 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 vertical bar, D, start subscript, r, end subscript, vertical bar?
vertical bar, D, start subscript, r, end subscript, vertical bar, equals

Concept check: Which of the following parameterizes start color #bc2612, C, start subscript, r, end subscript, end color #bc2612?

Concept check: Using this parameterization, what should we replace start color #bc2612, d, s, end color #bc2612 with in the integral integral, start subscript, start color #bc2612, C, start subscript, r, end subscript, end color #bc2612, end subscript, dots, start color #bc2612, d, s, end color #bc2612?
start color #bc2612, d, s, end color #bc2612, equals
d, t

Concept check: Which of the following gives an outward facing unit normal vector start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f to start color #bc2612, C, start subscript, r, end subscript, end color #bc2612?

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 del, dot, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 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.

In the next article, I'll show how you can do essentially the same thing to define three-dimensional divergence using three-dimensional flux, which involves a surface integral.

## Summary

• Given a fluid flow, divergence tries to capture the idea of "outward flow" at a point. But this doesn't quite make sense, because you can only measure the change in fluid density of a region.
• When talking about a region, the idea of "outward flow" is the same as flux through that region's boundary.
• To adapt the idea of "outward flow in a region" to the idea of "outward flow at a point", start by considering the average outward flow per unit area in a region. This just means dividing the flux integral by the area of the region.
• Next, consider the limit of this outward flow per unit area as the region shrinks around a specific point.
• Putting this all into symbols, we get the following definition of divergence:
\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}

## Want to join the conversation?

• It seems to me like the formula presented here for the formal definition is a little too simple. |A|->0 does not necessarily mean that A is shrinking into a point. If A is a rectangle of width and height 1, |A|->0 when the width remains 1 and the height tends to 0.
• That is correct. In another article the author notes it is important that all dimensions are shrinking and in that article they use the maximum dimension of the changing area. Just saying A shrinks is using a sort of short-hand. But, you are correct.
• Shouldn't the limit be 𝛑r² → 0 since we're observing the limit of |Dr| → 0?
• since pi is a constant it doesn't affect the limit. so we have r^2->0 and if r^2 goes to zero that means r must go to zero r->0 is the same thing

Brilliant article!
• is there somewhere that I can find a mathematical derivation or proof that the limit is equal to nabla dot F? a good place to see the same sort of proof for 2d and 3d curl equaling the 'cross product' nabla X F could be awesome too! great article btw.
• In the simple positive divergence example video, it looks like all the vectors have equal magnitude, implying their partial derivatives are 0, so isn't the divergence also 0?
(1 vote)
• They have various direction so their partial derivatives won't be zero except for the points lying on the x axis and their partial derivative over x (except for the origin) and analogous for the points on the y axis.
(1 vote)
• I cannot read the formal definition of divergence.
(1 vote)
• HELP NEEDED!
In defining the 2d flux integral we had to assume that the density was uniform and equal to 1. Now for the formal proof of divergence we are dividing our flux integral which represents the change in mass per unit time ( represents a mass quantity as the density was equal to 1 so area=mass) by area to get the change in density per unit time. Is this not a contradiction as the change in density would be 0 as we had to assume this to come up with the flux integral in the first place.

Could it be that we are assuming that the density of fluid when it flows out is constant but the density of the region itself is changing?
(1 vote)
• I don't really think you have to assume this. Just keep in mind we're calculating divergence (etc.) "at the beginning of time". When all the density is equal to one. It does not matter that latter on the density of the escaping fluid will change. We're measuring rate of the flow in instantaneous time at the very start of the flow. You could also recognize rate of change of this rate of the flow (change of the density of the flowing fluid in time) but it won't affect the former. It's like speed and acceleration. If a train passing a semaphore is accelerating what is the rate of wagons passing the semaphore in a chosen moment? It's according to its current speed at this moment despite its acceleration. And when you have this rate you could translate it to a rate of disappearing wagons from the area before the semaphore, i.e. wagon density. ;)
Hope this helped.
(1 vote)
• I just want to make sure I understand correctly, if the divergence at a point is positive there is outward flow, but divergence at a point can also be negative for a net negative flow meaning an "inward" flow, right? It just seems repeatedly described as outward flow so I want to make sure that that's just over looked and that I'm not misinterpreting it.
(1 vote)
• Yes you are correct....Negative divergence(negative outward) flow is just "inward flow"
(1 vote)