Skip to main content
Logo image

Section 3.5 Divergence and Curl of Vector Fields

In Section 3.4 we reviewed the gradient of scalar field along with the del operator \(\grad\text{.}\) The gradient, and the del operator in particular, is the tool we use to make sense of how scalar fields \(f(x, y, z)\) change. On the other hand, \(\grad\) cannot be applied directly to vector fields since we haven't defined how to multiply vectors. However, we do have the notions of dot products and cross products that will allow us to combine \(\del\) with vector fields \(\FF\text{.}\)

Subsection Divergence

Let \(\FF(x, y) = \mqty[P(x, y) & Q(x, y)]\) denote a vector field in \(\RR^2\) and suppose it measures some changing quantity like fluid flow. We would like to measure how the fluid flow is changing at a given point. This can be done using the divergence of the vector field.

Definition 3.5.1. Divergence.

Let \(\FF(x, y) = \mqty[P(x, y) & Q(x, y)]\) be a vector field in \(\RR^2\) and suppose that its component functions \(P\) and \(Q\) are continuously differentiable. The divergence of \(\FF\) is the scalar quantity
\begin{equation*} \divt\FF = \div\FF = \pdv{P}{x} + \pdv{Q}{y}\text{.} \end{equation*}
The divergence of a vector field provides a measure of how the “flow density” of the field changes at a certain point. In particular, if \(\div\FF\) corresponds to the difference between the outflow and the inflow. If the divergence is positive then the vector field tends to flow out of the given point, and if the divergence is negative the vector field tends to flow into the given point. Any point at which the divergence is positive is called a source, and any point at which the divergence is negative is called a sink.

Example 3.5.2. Estimating Divergence From a Graph.

Estimate the divergence of the vector field \(\FF\) at the point \((-1, 0)\) in the figure below.
A vector field \(\FF\text{.}\)
Figure 3.5.3. A vector field \(\FF\text{.}\)

Example 3.5.4. Computing the Divergence.

Let \(\FF = \mqty[xy & -\sin(x^2)]\text{.}\) Find \(\div\FF\) and any sources and sinks of \(\FF\text{.}\)
Solution.
\begin{equation*} \div\FF = y\text{.} \end{equation*}
Therefore any point above the \(x\)-axis is a source in the vector field and any point below the \(x\)-axis is a sink.
The vector field \(\FF = \mqty[xy & -\sin(x^2)]\text{.}\)
Figure 3.5.5. The vector field \(\FF = \mqty[xy & -\sin(x^2)]\text{.}\)
A vector field \(\FF\) is said to be incompressible, solenoidal or divergence-free if its divergence is \(0\) at all points. This assumption can often be made about slow moving fluid flows.

Example 3.5.6. Determining if a Vector Field Is Incompressible.

Let \(\FF = \mqty[y & -x]\text{.}\) Is \(\FF\) an incompressible flow?
Solution.
We just need to take the divergence of \(\FF\text{,}\) which is easily seen to be \(0\text{.}\) Therefore the flow is incompressible.
Although the previous examples only computed divergences in \(\RR^2\text{,}\) the formula \(\divt\FF = \div\FF\) also works in \(\RR^3\text{.}\)

Example 3.5.7. Finding a Divergence in \(\RR^3\).

Find the divergence of \(\FF = x\ii - z\jj + e^{xy}\kk\text{.}\)
Solution.
The divergence is
\begin{equation*} \div\FF = \pdv{x}(x) + \pdv{y}(-z) + \pdv{z}(e^{xy}) = 1\text{.} \end{equation*}
Note that since the divergence is positive, every point in \(\RR^3\) is a source in this field.
Sage can also handle simple computations involving divergence using the .div() method. When using this method, the order of the variables that are being differentiated must be specified. For us, this is usually done by calling .div([x, y]) in the two-dimensional case and .div([x, y, z]) in the three-dimensional case. As an example, the Sage cell below computes the divergence of \(\FF = \mqty[xe^{xyz} & 2x^2 + y & z^2 - \frac{1}{zx^2 - \cos(z)}]\text{.}\)

Subsection Curl

Just as the divergence of a vector field was defined using \(\del\) and the dot product, we can define another type of derivative known as the curl by combining \(\del\) with the cross product. Since the cross product only exists in \(\RR^3\) it follows that the curl of a vector field only exists for three-dimensional fields, though there is a two-dimensional analogue that can be useful (see the comment before Example 3.4.9 at the end of Section 3.4). This is in stark contrast to the divergence, which is defined in any \(\RR^n\text{.}\)

Definition 3.5.8. Curl of a Vector Field.

Let \(\FF(x, y, z) = \mqty[P(x, y, z) & Q(x, y, z) & R(x, y, z)]\) be a vector field in \(\RR^3\) with continuously differentiable component functions \(P, Q\) and \(R\text{.}\) The curl of \(\FF\) is the vector field \(\curlt\FF\text{,}\) or \(\curl\FF\text{,}\) given by
\begin{equation*} \curlt\FF = \curl\FF = \mqty[\pdv{R}{y} - \pdv{Q}{z} & \pdv{P}{z} - \pdv{R}{x} & \pdv{Q}{x} - \pdv{P}{y}]\text{.} \end{equation*}
The quantity \(\curl\FF\) that appears in Definition 3.5.8 can also be computed by setting up an appropriate \(3\times3\) determinant:
\begin{equation*} \curl\FF = \mqty|\ii & \jj & \kk \\ \pdv{x} & \pdv{y} & \pdv{z} \\ P & Q & R|\text{.} \end{equation*}
Despite the abuse of notation, this approach is usually preferable to memorizing the formula in the definition.

Example 3.5.9. Computing a Curl.

Let \(\FF = \mqty[xy \amp 3 + 2z \amp z]\text{.}\) Find \(\curlt\FF\text{.}\)
Solution.
Using the determinant formulation of the curl, we get
\begin{equation*} \curlt\FF = \curl\FF = \mqty|\ii & \jj & \kk \\ \pdv{x} & \pdv{y} & \pdv{z} \\ xy & 3 + 2z & z| \end{equation*}
which simplifies to \(\curlt\FF = \mqty[-2 & 0 & -x]\text{.}\)
Just as the divergence of a vector field can be interpreted as a measure of the flow through or across a point in a vector field, the curl can be interpreted as a measure of the flow around a point in a vector field. In particular, if \(\FF\) is a vector field in \(\RR^3\) then \(\curl\FF\) gives the axis of rotation around which \(\FF\) tends to flow counterclockwise when viewed from above. The magnitude \(\norm{\curlt\FF}\) measures the amount of rotation.
For example, consider the vector field \(\FF = \mqty[xy & 3 + 2z & z]\) from Example 3.5.9. At \((0, 0, -1)\) its corresponding curl is \(\mqty[-2 & 0 & 0]\text{.}\) Therefore the vector field \(\FF\) tends to rotate counterclockwise around the point \((0, 0, -1)\) when viewed head-on from the direction of \(\mqty[-2 & 0 & 0]\text{,}\) i.e., from the direction of the negative \(x\)-axis. See the figure below produced using Sage. Be sure to rotate the figure so that you're viewing it from the direction of the negative \(x\)-axis!
Sage is also capable of computing curls and divergences of arbitrary vector fields using the function command. This tells Sage to treat a variable as a function of specified variables.

Example 3.5.10. Computing the Divergence of a Curl.

Let \(\FF = \mqty[P \amp Q \amp R]\) and assume that its component functions are continuously differentiable. Compute \(\div(\curl\FF)\) by completing the code cell below.