banner

Divergence of a Vector Field – Definition, Formula, and Examples

The divergence of a vector field helps us understand how a vector field behaves. Knowing how to evaluate the divergence of a vector field is important when studying quantities defined by vector fields such as the gravitational and force fields.

The divergence of a vector field allows us to return a scalar value from a given vector field by differentiating the vector field.        

In this article, we’ll cover the fundamental definitions of divergence. We’ll also show you how to calculate the divergence of vector fields in three coordinate systems: the Cartesian, cylindrical, and spherical forms.

What Is the Divergence of a Vector Field?

The divergence of the vector field, $\textbf{F}$, is a scalar-valued vector geometrically defined by the equation shown below.

\begin{aligned}\text{div }\textbf{F} (x, y, z) &= \lim_{\Delta V \rightarrow 0} \dfrac{\oint \textbf{A} \cdot dS }{\Delta V}\end{aligned}

For this geometric definition, $S$ represents a sphere that is centered at $(x,y,z)$ that is oriented outward. As $\Delta V \rightarrow 0$, the sphere becomes smaller and contracts towards $(x, y,z)$. We can interpret the divergence of the vector field as the flux that is diverging from a unit volume per second at the point as it approaches zero. Now, let’s take a look at the divergence of vector fields as the scalar function resulting from the equation below.     

\begin{aligned}\text{div }\textbf{F} (x, y, z) &= \nabla \cdot \textbf{F}\end{aligned}

Through this definition of the vector field’s divergence, we can see how the divergence of $\textbf{F}$ is simply the dot product of the nabla operator ($\nabla$) and the vector field:

\begin{aligned}\text{div }\textbf{F} (x, y, z) &= \nabla \cdot \textbf{F}\end{aligned}

This means that when $\textbf{F}(x, y, z) = [P(x, y, z), Q(x, y,z), R(x, y, z)]$, we can write $\text{div }\textbf{F}$ as the sum of the partial derivatives of $P$, $Q$, and $R$ with respect to $x$, $y$, and $z$, respectively.

\begin{aligned}\textbf{Rectangular Coordinate:}\\\text{div }\textbf{F} (x, y, z) &= \dfrac{\partial}{\partial x} P(x, y,z) +  \dfrac{\partial}{\partial y} Q(x, y,z) + \dfrac{\partial}{\partial z} R(x, y,z)\end{aligned}

We can extend this definition of divergence to vector fields in the spherical and cylindrical coordinate systems as well.

\begin{aligned}\textbf{Cylindrical Coordinate}&: \textbf{F}(\rho, \phi, z) = [P(\rho, \phi, z), Q(\rho, \phi, z), R(\rho, \phi, z)]\\\text{div }\textbf{F} (\rho, \phi, z) &= \dfrac{1}{\rho}\dfrac{\partial}{\partial \rho} P +  \dfrac{1}{\rho}\dfrac{\partial}{\partial \phi} Q+ \dfrac{\partial}{\partial z} R\\\\\textbf{Spherical Coordinate}&: \textbf{F}(r, \theta, \phi) = [P(r, \theta, \phi), Q(r, \theta, \phi), R(r, \theta, \phi)]\\\text{div }\textbf{F} (r, \theta, \phi) &= \dfrac{1}{r^2}\dfrac{\partial}{\partial r} r^2P +  \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \theta} Q\sin \theta + \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \phi} R\end{aligned}

Now that we’ve established the fundamental definition of the divergence, let’s go ahead and learn how we can evaluate $\nabla \cdot \textbf{F}$ to find the divergence of a vector field.

How To Find the Divergence of a Vector Field?

We can find the divergence of a vector field by taking the dot product of the nabla operator and the vector field. Here are some guidelines to remember when finding the value of $\textbf{div } \textbf{F}$ in either rectangular, cylindrical, or spherical coordinate system:

  • Observe the expression of $\textbf{F}$ and identify whether it is rectangular, cylindrical, or spherical:
    • When the vector reflects no angles, we are sure that the vector is rectangular form.
    • When the vector is defined by one angle, we’re working with $\textbf{F}$ in cylindrical form.
    • When the vector is defined by two angles, $\theta$, and $\phi$, the vector field is in spherical form.
  • Write down the three components of the vector field then take their partial derivatives with respect to the input values.
  • Apply the appropriate divergence formula then simplify the expression, $\nabla \cdot \textbf{F}$.

Let’s start with the simplest coordinate system: the rectangular coordinate system. Suppose that we have $\textbf{F}(x, y, z) = 4x \textbf{i} – 6y \textbf{j} + 8z\textbf{k}$, we can take the divergence of $\textbf{F}$ by taking the partial derivatives of the following: $4x$ with respect to $x$, $-6y$ with respect to $y$, and $8z$ with respect to $z$. Add the resulting expressions to find $\nabla \cdot \textbf{F} $.

\begin{aligned}\dfrac{\partial}{\partial x} (4x) = 4\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial y} (-6y) = -6\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial z} (8z) = 8\end{aligned}

\begin{aligned} \nabla \cdot \textbf{F} &= \dfrac{\partial}{\partial x}(4x) +\dfrac{\partial}{\partial y}(-6y)+ \dfrac{\partial}{\partial z}(8z)\\&= 4 + (-6) + 8\\&= 6\end{aligned}

This means that the divergence of $\textbf{F}(x, y, z) = 4x \textbf{i} – 6y \textbf{j} + 8z\textbf{k}$ is equal to $6$. Yes, evaluating divergences of different vector fields is straightforward. With a few more drills, you’ll know the three divergence formulas by heart and this is why we’ve prepared more sample problems for you to work on!

Example 1

Find the divergence of the vector field, $\textbf{F} = \cos (4xy) \textbf{i} + \sin (2x^2y) \textbf{j}$.

Solution

We’re working with a two-component vector field in Cartesian form, so let’s take the partial derivatives of $\cos (4xy)$ and $\sin (2x^2y)$ with respect to $x$ and $y$, respectively.

\begin{aligned}\dfrac{\partial}{\partial x} \cos (4xy) &= y\dfrac{\partial}{\partial x} \cos(4x)\\&= y \left(4 \cdot -\sin x \right )\\&= -4y\sin x\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial y} \sin (2x^2y) &= \cos (2x^2y) \dfrac{\partial }{\partial y}(2x^2y)\\&=\cos (2x^2y) \cdot 2x^2\\&= 2x^2\cos(2x^2y) \end{aligned}

\begin{aligned} \nabla \cdot \textbf{F} &= \dfrac{\partial}{\partial x} \cos(4xy) +\dfrac{\partial}{\partial y} \sin(2x^2y)  \\&= -4y\sin x + 2x^2\cos(2x^2y)\\&=2x^2\cos(2x^2y) -4y\sin x\end{aligned}

This means that the divergence of $\textbf{F} = \cos (4xy) \textbf{i} + \sin (2x^2y) \textbf{j}$ is equal to $2x^2\cos(2x^2y) -4y\sin x$.

Example 2

Find the divergence of the vector field, $\textbf{F} =<2\rho^2 \cos \theta, \sin \theta, 4z^2 \sin \theta>$.

Solution

The vector only exhibit one angle ($\theta$), so this tells us that we’re working with a vector field in cylindrical coordinate system.  This means that for us to find the divergence of the vector field, we’ll have to use the formula shown below.

\begin{aligned}\textbf{Cylindrical Coordinate}&: \textbf{F}(\rho, \phi, z) = [P(\rho, \phi, z), Q(\rho, \phi, z), R(\rho, \phi, z)]\\\text{div }\textbf{F} (\rho, \phi, z) &= \dfrac{1}{\rho}\dfrac{\partial}{\partial \rho} P +  \dfrac{1}{\rho}\dfrac{\partial}{\partial \phi} Q+ \dfrac{\partial}{\partial z} R\end{aligned}

For our example, we have $P = 2r^2 \cos \theta$, $Q = \sin \theta$, and $R = 4z^2 \sin \theta$. Let’s take the partial derivatives of $P$, $Q$, and $R$ with respect to $\rho$, $\phi$, and $z$, respectively. Apply the divergence formula and use the resulting partial derivatives to find the divergence of the vector field.

\begin{aligned}\dfrac{\partial}{\partial \rho} 2\rho^2 \cos \theta &= 2\cos \theta\dfrac{\partial}{\partial \rho}\rho^2 \\&= 2\cos \theta (2\rho)\\&= 4\rho \cos \theta\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial \theta} \sin \theta &= \cos \theta\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial z} 4z^2 \sin \theta &= 4\sin \theta \dfrac{\partial}{\partial z}z^2\\&= (4\sin \theta)(2z)\\&= 8z\sin \theta\end{aligned}

\begin{aligned} \nabla \cdot \textbf{F} &=\dfrac{1}{\rho}\dfrac{\partial}{\partial \rho} P +  \dfrac{1}{\rho}\dfrac{\partial}{\partial \phi} Q+ \dfrac{\partial}{\partial z} R\\&= \dfrac{1}{\rho}(4\rho \cos \theta) + \dfrac{1}{\rho}\cos \theta + 8z\sin \theta\\&= 4\cos\theta + \dfrac{1}{\rho} \cos \theta + 8z\sin \theta \end{aligned}

This shows that the divergence of the vector field, $\textbf{F}=<2\rho^2 \cos \theta, \sin \theta, 4z^2 \sin \theta>$ , in cylindrical form is equal to $4\cos\theta + \dfrac{1}{\rho} \cos \theta + 8z\sin \theta$.

Example 3

Find the divergence of the vector field, $\textbf{F} =<r^3 \cos \theta, r\theta, 2\sin \phi\cos \theta>$.

Solution

Since the vector field contains two angles, $\theta$, and $\phi$, we know that we’re working with the vector field in a spherical coordinate. This means that we’ll use the divergence formula for spherical coordinates:

\begin{aligned}\textbf{Spherical Coordinate}&: \textbf{F}(r, \theta, \phi) = [P(r, \theta, \phi), Q(r, \theta, \phi), R(r, \theta, \phi)]\\\text{div }\textbf{F} (r, \theta, \phi) &= \dfrac{1}{r^2}\dfrac{\partial}{\partial r} r^2P +  \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \theta} Q\sin \theta + \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \phi} R\end{aligned}

For our case, we have $P = r^3 \cos \theta$, $Q = r\theta$, and $R = 2\sin \phi \cos \theta$. Take the partial derivatives of $r^2P$, $Q\sin \theta$, and $R$, with respect to $r$, $\theta$, and $\phi$, respectively. Use the result and the formula to find the value of $\textbf{div }\textbf{F}$.

\begin{aligned}\dfrac{\partial}{\partial r} r^2(r^3 \cos \theta) &= \cos \theta\dfrac{\partial}{\partial r}r^5 \\&= \cos \theta (5r^4)\\&= 5r^4 \cos \theta\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial \theta} (r\theta)\sin \theta &= r \dfrac{\partial}{\partial \theta} (\theta \sin \theta) \\&= r(\sin \theta + \theta\cos \theta)\\&= r\sin\theta + r\theta\cos \theta\end{aligned}

\begin{aligned}\dfrac{\partial}{\partial \phi} 2\sin \phi \cos \theta&= 2\cos \theta \dfrac{\partial}{\partial \phi} \sin \phi\\&= 2\cos \theta \cos \phi\end{aligned}

\begin{aligned} \nabla \cdot \textbf{F} &=\dfrac{1}{r^2}\dfrac{\partial}{\partial r} r^2P +  \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \phi} Q\sin \theta + \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \phi} R\\&= \dfrac{1}{r^2}(5r^4 \cos \theta) +  \dfrac{1}{r\sin \theta}(r\sin\theta + r\theta\cos \theta) + \dfrac{1}{r\sin \theta}\dfrac{\partial}{\partial \phi} (2\cos \theta \cos \phi)\\&= 5r^2 \cos\theta + \left(1 + \theta \cot \theta\right) + \dfrac{2}{r} \cot \theta\cos \phi\\&= 5r^2 \cos \theta +\cot\theta\left(\theta + \dfrac{2}{r}\cos \phi\right) + 1 \end{aligned}

Hence, we’ve shown that the divergence of $\textbf{F} =<r^3 \cos \theta, r\theta, 2\sin \phi\cos \theta>$ is equal to $5r^2 \cos \theta +\cot\theta\left(\theta + \dfrac{2}{r}\cos \phi\right) + 1$.

Practice Questions

1. Find the divergence of the vector field, $\textbf{F} = <3x^2yz, 4xy^2z, -4xyz^2>$.
2. Find the divergence of the vector field, $\textbf{F} = <4\rho^2 \cos\theta, 2\cos \theta, z^2\sin \theta>$.
3. Find the divergence of the vector field, $\textbf{F} = <r^2 \cos 2\theta, 3r\theta, -\cos^2 \phi\cos \theta>$.

Answer  Key

1. $\nabla \cdot \textbf{F} = 6xyz$
2. $\nabla \cdot \textbf{F} = 8 \cos \theta+ 2\sin \theta \left(z – \dfrac{1}{\rho}\right)$
3. $\nabla \cdot \textbf{F} = \dfrac{1}{r}[(3\cot \theta)(3\theta r + \sin 2\phi) ] + 4r\cos(2\theta) + 3$