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 8: Divergence theorem (articles)

# 2D divergence theorem

This is the analog of Green's theorem, but for divergence instead of curl.

## Background

Not strictly required, but helpful for a deeper understanding:

## What we're building to

• The 2D divergence theorem is to divergence what Green's theorem is to curl. It relates the divergence of a vector field within a region to the flux of that vector field through the boundary of the region.
• Setup:
• $\mathbf{\text{F}}\left(x,y\right)$ is a two-dimensional vector field.
• $R$ is some region in the $xy$-plane.
• $C$ is the boundary of $R$.
• $\stackrel{^}{\mathbf{\text{n}}}$ is a function which gives outward-facing unit normal vectors to $C$.
• The 2D divergence theorem says that the flux of $\mathbf{\text{F}}$ through the boundary curve $C$ is the same as the double integral of $\text{div}\phantom{\rule{0.167em}{0ex}}\mathbf{\text{F}}$ over the full region $R$.
$\underset{\text{Flux integral}}{\underset{⏟}{{\int }_{C}\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds}}={\iint }_{R}\text{div}\phantom{\rule{0.167em}{0ex}}\mathbf{\text{F}}\phantom{\rule{0.167em}{0ex}}dA$
• The intuition here is that if $\mathbf{\text{F}}$ represents a fluid flow, the total outward flow rate from $R$, as measured by the flux integral, equals the sum over all the little bits of outward flow at each point, as measured by divergence.
• Often the component functions of $\mathbf{\text{F}}\left(x,y\right)$ are given as $P\left(x,y\right)$ and $Q\left(x,y\right)$:
$\mathbf{\text{F}}\left(x,y\right)=\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]$
In this case, once you write both integrals in terms of $P$ and $Q$, the 2D divergence theorem looks like this:
${\oint }_{C}P\phantom{\rule{0.167em}{0ex}}dy-Q\phantom{\rule{0.167em}{0ex}}dx={\iint }_{R}\frac{\partial P}{\partial x}+\frac{\partial Q}{\partial y}$
• Written in this form, it's easier to see that the 2D divergence theorem is secretly just saying the same thing as Green's theorem.

## Intuition: Connecting two outward flow measures

#### The global view: Flux

Here, I am assuming you have already learned about two-dimensional flux, and what it represents. Namely, it gives the rate at which a flowing fluid passes through a curve, such as $C$. When that curve encloses some region, such as $R$, the flux is a measure of the rate at which fluid is exiting that region.
Given a vector field $\mathbf{\text{F}}\left(x,y\right)$, representing the velocity vector field of the fluid, the flux of $\mathbf{\text{F}}\left(x,y\right)$ through $C$ is measured with the following integral:
$\underset{\text{Flux integral}}{\underset{⏟}{{\int }_{C}\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds}}$
This integral walks over each point on the boundary $C$, and picks up the component of the vector from $\mathbf{\text{F}}$ which is in the direction of the outward-facing unit normal vector $\stackrel{^}{\mathbf{\text{n}}}$. The larger that value is, the faster fluid is flowing out of $R$ at that point; the more negative it is, the more fluid is flowing in at that point.

#### The local view: Divergence

I am also assuming you have learned about a different measure of "outward flow" in fluid movements: Divergence. The divergence of $\mathbf{\text{F}}\left(x,y\right)$ is a function that tells you how much the fluid tends to diverge away from each point $\left(x,y\right)$.
The 2D divergence theorem connects these two ideas:

## Want a deeper understanding?

This intuition should feel very similar to the one behind Green's theorem, in which the total fluid rotation in a region equals the sum of all the little bits of rotation represented by $\text{2d-curl}\phantom{\rule{0.167em}{0ex}}\mathbf{\text{F}}$:
However, for both Green's theorem and the 2D divergence theorem, talking about adding up little bits of rotation or outward flow is pretty vague. Although each provides a great intuition, they are not exactly rigorous math, are they?
In the article on Green's theorem, I stepped through a more precise line of reasoning for where the double integral of curl comes into play. This involved chopping up the region $R$, and seeing how certain line integrals canceled each other out along the slices through $R$.
An almost identical line of reasoning can be used to demonstrate the 2D divergence theorem. For anyone wishing to gain deeper insight, a good exercise would be to go back and walk through that same line of reasoning, but replace the line integral ${\oint }_{C}\mathbf{\text{F}}\cdot d\mathbf{\text{r}}$, which measures flow around $R$, with the flux integral ${\oint }_{C}\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds$, which measures flow out of $R$.
And if this deeper understanding is what you seek, I would also recommend going in armed with knowledge of the formal definition of divergence.

## Proof: Flux integrals + Unit normal vector + Green's theorem

This exercise in deeper understanding is not necessary to prove the 2D divergence theorem. In fact, when you start spelling out how each integral is actually computed, you'll find that this theorem is really just saying the same thing as Green's theorem.
Start by writing out $\mathbf{\text{F}}$ in terms of the component functions $P\left(x,y\right)$ and $Q\left(x,y\right)$:
$\mathbf{\text{F}}\left(x,y\right)=\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]$
Applying the formula for a unit normal vector to the flux integral, here's another way to represent that flux integral.
${\int }_{C}\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds={\int }_{C}\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds$
Next, let's write out the unit normal vector explicitly.
Concept check: If we think of the vector $\left[\begin{array}{c}dx\\ dy\end{array}\right]$ as representing a tiny step in the counterclockwise direction around the curve $C$, with $ds=\sqrt{d{x}^{2}+d{y}^{2}}$ as its magnitude, which of the following represents an outward facing unit normal vector?

Plugging this into our flux integral and simplifying, here's what we get:
$\begin{array}{rl}{\int }_{C}\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.167em}{0ex}}ds& ={\int }_{C}\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]\cdot \left(\frac{1}{\overline{)ds}}\left[\begin{array}{c}dy\\ -dx\end{array}\right]\right)\phantom{\rule{0.167em}{0ex}}\overline{)ds}\\ \\ & ={\int }_{C}P\phantom{\rule{0.167em}{0ex}}dy-Q\phantom{\rule{0.167em}{0ex}}dx\end{array}$
Written in this form, we can directly apply Green's theorem.
Concept check: Which of the following is Green's theorem, where $C$ represents a closed curve encompassing region $R$?

Concept check: What do you get when you apply Green's theorem to the flux integral ${\int }_{C}P\phantom{\rule{0.167em}{0ex}}dy-Q\phantom{\rule{0.167em}{0ex}}dx$?

Notice, the expression inside the double integral of the answer to the last question is indeed the divergence of $\mathbf{\text{F}}$:
$\text{div}\phantom{\rule{0.167em}{0ex}}\mathbf{\text{F}}=\text{div}\phantom{\rule{0.167em}{0ex}}\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]=\frac{\partial P}{\partial x}+\frac{\partial Q}{\partial y}$

## Using the 2D divergence theorem?

When it comes to translating between line integrals and double integrals, the 2D divergence theorem is saying basically the same thing as Green's theorem. So any of the actual computations in an example using this theorem would be indistinguishable from an example using Green's theorem (such as those in this article on Green's theorem examples).
However, the usefulness of learning the 2D divergence theorem is two-fold:
• Conceptual benefit: It's a great way to deepen your understanding of flux, divergence, and Green's theorem.
• Strategic benefit: Sometimes an example where Green's theorem is used lends itself more naturally to a divergence-based description. For example, if the line integral you want to compute begins its life as a flux integral, rather than expanding out this line integral to make it look like $\int P\phantom{\rule{0.167em}{0ex}}dx+Q\phantom{\rule{0.167em}{0ex}}dy$ and applying Green's theorem, you could recognize immediately that it's the same as doubly integrating divergence.

## Summary

• The 2D divergence theorem relates two-dimensional flux and the double integral of divergence through a region.
• Often the vector field $\mathbf{\text{F}}\left(x,y\right)$ is expressed component-wise:
$\mathbf{\text{F}}\left(x,y\right)=\left[\begin{array}{c}P\left(x,y\right)\\ Q\left(x,y\right)\end{array}\right]$
In this case, here's how the 2D divergence theorem looks:
${\oint }_{C}P\phantom{\rule{0.167em}{0ex}}dy-Q\phantom{\rule{0.167em}{0ex}}dx={\iint }_{R}\left(\frac{\partial P}{\partial x}+\frac{\partial Q}{\partial y}\right)dA$
• In this form, it is easier to see that the 2D divergence theorem really just states the same thing as Green's theorem.