Divergence

Learning Objectives

  • Determine divergence from the formula for a given vector field.

Divergence is an operation on a vector field that tells us how the field behaves toward or away from a point. Locally, the divergence of a vector field [latex]{\bf{F}}[/latex] in [latex]\mathbb{R}^2[/latex] or [latex]\mathbb{R}^3[/latex] at a particular point [latex]P[/latex] is a measure of the “outflowing-ness” of the vector field at [latex]P[/latex]. If [latex]{\bf{F}}[/latex] represents the velocity of a fluid, then the divergence of [latex]{\bf{F}}[/latex] at [latex]P[/latex] measures the net rate of change with respect to time of the amount of fluid flowing away from [latex]P[/latex] (the tendency of the fluid to flow “out of” [latex]P[/latex]). In particular, if the amount of fluid flowing into P is the same as the amount flowing out, then the divergence at [latex]P[/latex] is zero.

definition


If [latex]{\bf{F}}\langle{P},Q,R\rangle[/latex] is a vector field in [latex]\mathbb{R}^3[/latex] and [latex]P_x[/latex], [latex]Q_y[/latex], and [latex]R_z[/latex] all exist, then the divergence of [latex]{\bf{F}}[/latex] is defined by

[latex]\large{\text{div }{\bf{F}}=P_x+Q_y+R_z=\frac{\partial{P}}{\partial{x}}+\frac{\partial{Q}}{\partial{y}}+\frac{\partial{R}}{\partial{z}}}[/latex].

Note the divergence of a vector field is not a vector field, but a scalar function. In terms of the gradient operator [latex]\nabla=\left\langle\frac{\partial}{\partial{x}},\frac{\partial}{\partial{y}},\frac{\partial}{\partial{z}}\right\rangle[/latex], divergence can be written symbolically as the dot product

[latex]\large{\text{div }{\bf{F}}=\nabla\cdot{\bf{F}}}[/latex].

Note this is merely helpful notation, because the dot product of a vector of operators and a vector of functions is not meaningfully defined given our current definition of dot product.

If [latex]{\bf{F}}\langle{P},Q\rangle[/latex] is a vector field in [latex]\mathbb{R}^2[/latex], and [latex]P_x[/latex] and [latex]Q_y[/latex] both exist, then the divergence of [latex]{\bf{F}}[/latex] is defined similarly as

[latex]\large{\text{div }{\bf{F}}=P_x+Q_y=\frac{\partial{P}}{\partial{x}}+\frac{\partial{Q}}{\partial{y}}=\nabla\cdot{\bf{F}}}[/latex].

To illustrate this point, consider the two vector fields in Figure 1. At any particular point, the amount flowing in is the same as the amount flowing out, so at every point the “outflowing-ness” of the field is zero. Therefore, we expect the divergence of both fields to be zero, and this is indeed the case, as

[latex]\large{\text{div }(\langle1,2\rangle)=\frac{\partial}{\partial{x}}(1)+\frac{\partial}{\partial{y}}(2)=0\text{ and div}(\langle-y,x\rangle)=\frac{\partial}{\partial{x}}(-y)+\frac{\partial}{\partial{y}}(x)=0}[/latex].

<img src="/apps/archive/20220422.171947/resources/52108a91d94bdbb0791e0c04baae71a55a6f9b3d" data-media-type="image/jpeg" alt="Two images of vector fields A and B in two dimensions. Vector field A has arrows pointing up and to the right. They do not change in size or direction. It has zero divergence. Vector field B has arrows surrounding the origin in a counterclockwise direction. The arrows are larger the closer they are to the origin. It also has zero divergence." id="3">

Figure 1. (a) Vector field [latex]\langle1,2\rangle[/latex] has zero divergence. (b) Vector field [latex]\langle-y,x\rangle[/latex] also has zero divergence.

By contrast, consider radial vector field [latex]{\bf{R}}(x,y)=\langle-x,-y\rangle[/latex] in Figure 2. At any given point, more fluid is flowing in than is flowing out, and therefore the “outgoingness” of the field is negative. We expect the divergence of this field to be negative, and this is indeed the case, as [latex]\text{div }({\bf{R}})=\frac{\partial}{\partial{x}}(-x)+\frac{\partial}{\partial{y}}(-y)=-2[/latex].
<img src="/apps/archive/20220422.171947/resources/f8745ea1aed0b6e1cf0169f5f882642308e3c174" data-media-type="image/jpeg" alt="A vector field in two dimensions with negative divergence. The arrows point in towards the origin in a radial pattern. The closer the arrows are to the origin, the larger they are." id="4">

Figure 2. This vector field has negative divergence.

To get a global sense of what divergence is telling us, suppose that a vector field in [latex]\mathbb{R}^2[/latex] represents the velocity of a fluid. Imagine taking an elastic circle (a circle with a shape that can be changed by the vector field) and dropping it into a fluid. If the circle maintains its exact area as it flows through the fluid, then the divergence is zero. This would occur for both vector fields in Figure 1. On the other hand, if the circle’s shape is distorted so that its area shrinks or expands, then the divergence is not zero. Imagine dropping such an elastic circle into the radial vector field in Figure 2 so that the center of the circle lands at point [latex](3, 3)[/latex]. The circle would flow toward the origin, and as it did so the front of the circle would travel more slowly than the back, causing the circle to “scrunch” and lose area. This is how you can see a negative divergence.

Example: calculating divergence at a Point

If [latex]{\bf{F}}(x,y,z)=e^x{\bf{i}}+yz{\bf{j}}-y^2{\bf{k}}[/latex], then find the divergence of [latex]{\bf{F}}[/latex] at [latex](0, 2, -1)[/latex].

try it

Find [latex]\text{div }{\bf{F}}[/latex] for [latex]{\bf{F}}(x,y,z)=\langle{x}y,5-z^2y,x^2+y^2\rangle[/latex].

Watch the following video to see the worked solution to the above Try It

You can view the transcript for “CP 6.40” here (opens in new window).
One application for divergence occurs in physics, when working with magnetic fields. A magnetic field is a vector field that models the influence of electric currents and magnetic materials. Physicists use divergence in Gauss’s law for magnetism, which states that if [latex]{\bf{B}}[/latex] is a magnetic field, then [latex]\nabla\cdot{\bf{B}}=0[/latex]; in other words, the divergence of a magnetic field is zero.

Example: determining whether a field is magnetic

Is it possible for [latex]{\bf{F}}(x,y)=\langle{x}^2y,y-xy^2\rangle[/latex] to be a magnetic field?

Another application for divergence is detecting whether a field is source free. Recall that a source-free field is a vector field that has a stream function; equivalently, a source-free field is a field with a flux that is zero along any closed curve. The next two theorems say that, under certain conditions, source-free vector fields are precisely the vector fields with zero divergence.

theorem: divergence of a source-free vector field


If [latex]{\bf{F}}=\langle{P},Q\rangle[/latex] is a source-free continuous vector field with differentiable component functions, then [latex]\text{div }{\bf{F}}=0[/latex].

Proof

Since [latex]{\bf{F}}[/latex] is source free, there is a function [latex]g(x, y)[/latex] with [latex]g_y=P[/latex] and [latex]-g_x=Q[/latex]. Therefore, [latex]{\bf{F}}=\langle{g}_y,-g_x\rangle[/latex] and [latex]\text{div }{\bf{F}}=g_{yx}-g_{xy}=0[/latex] by Clairaut’s theorem.

[latex]_\blacksquare[/latex]

The converse of Divergence of a Source-Free Vector Field Theorem is true on simply connected regions, but the proof is too technical to include here. Thus, we have the following theorem, which can test whether a vector field in [latex]\mathbb{R}^2[/latex] is source free.

Theorem: divergence test for source-free vector fields


Let [latex]{\bf{F}}=\langle{P},Q\rangle[/latex] be a continuous vector field with differentiable component functions with a domain that is simply connected. Then, [latex]\text{div }{\bf{F}}=0[/latex] if and only if [latex]{\bf{F}}[/latex] is source free.

Example: determining whether a field is Source free

Is field [latex]{\bf{F}}(x,t)=\langle{x}^2y,5-xy^2\rangle[/latex] source free?

try it

Let [latex]{\bf{F}}(x,y)=\langle-ay,bx\rangle[/latex] be a rotational field where [latex]a[/latex] and [latex]b[/latex] are positive constants. Is [latex]{\bf{F}}[/latex] source free?

Recall that the flux form of Green’s theorem says that

[latex]\large{\displaystyle\oint_C{\bf{F}}\cdot{\bf{N}}ds=\displaystyle\iint_DP_x+Q_ydA}[/latex],

where [latex]C[/latex] is a simple closed curve and [latex]D[/latex] is the region enclosed by [latex]C[/latex]. Since [latex]P_x+Q_y=\text{div }{\bf{F}}[/latex], Green’s theorem is sometimes written as

[latex]\large{\displaystyle\oint_C{\bf{F}}\cdot{\bf{N}}ds=\displaystyle\iint_D\text{div }{\bf{F}}dA}[/latex].

Therefore, Green’s theorem can be written in terms of divergence. If we think of divergence as a derivative of sorts, then Green’s theorem says the “derivative” of [latex]{\bf{F}}[/latex] on a region can be translated into a line integral of [latex]{\bf{F}}[/latex] along the boundary of the region. This is analogous to the Fundamental Theorem of Calculus, in which the derivative of a function [latex]f[/latex] on a line segment [latex][a,b][/latex] can be translated into a statement about [latex]f[/latex] on the boundary of [latex][a,b][/latex]. Using divergence, we can see that Green’s theorem is a higher-dimensional analog of the Fundamental Theorem of Calculus.

We can use all of what we have learned in the application of divergence. Let [latex]{\bf{v}}[/latex] be a vector field modeling the velocity of a fluid. Since the divergence of[latex]{\bf{v}}[/latex] at point [latex]P[/latex] measures the “outflowing-ness” of the fluid at [latex]P[/latex], [latex]\text{div }{\bf{v}}(P)>0[/latex] implies that more fluid is flowing out of [latex]P[/latex] than flowing in. Similarly, [latex]\text{div }{\bf{v}}(P)<0[/latex] implies the more fluid is flowing in to [latex]P[/latex] than is flowing out, and [latex]\text{div }{\bf{v}}(P)=0[/latex] implies the same amount of fluid is flowing in as flowing out.

Example: determining the flow of a fluid

Suppose [latex]{\bf{v}}(x,y)=\langle-xy,y\rangle[/latex], [latex]y>0[/latex] models the flow of a fluid. Is more fluid flowing into point [latex](1, 4)[/latex] than flowing out?

try it

For vector field [latex]{\bf{v}}(x,y)=\langle-xy,y\rangle[/latex], [latex]y>0[/latex] find all points [latex]P[/latex] such that the amount of fluid flowing in to [latex]P[/latex] equals the amount of fluid flowing out of [latex]P[/latex].