# The Divergence of a Vector Field Examples 1

Recall from The Divergence of a Vector Field page that if $\mathbf{F}(x, y, z) = P(x, y, z) \vec{i} + Q(x, y, z) \vec{j} + R(x, y, z) \vec{k}$ is a vector field on $\mathbb{R}^3$ and if $\frac{\partial P}{\partial x}$, $\frac{\partial Q}{\partial y}$, and $\frac{\partial R}{\partial z}$ all exist, then the divergence of $\mathbf{F}$ is given by the following formula:

(1)Let's look at some examples of computing the divergence of a vector field.

## Example 1

**Compute the divergence of the vector field $\mathbf{F} (x, y, z) = 2xe^xy \vec{i} + xy^2 \cos z \vec{j} - (y + z) \vec{k}$.**

We first need to calculate the necessary partial derivatives. $\frac{\partial P}{\partial x} = 2y(xe^x + e^x)$, $\frac{\partial Q}{\partial y} = 2xy$, and $\frac{\partial R}{\partial z} = -1$. Therefore we apply the formula above directly and we have that:

(2)## Example 2

**Compute the divergence of the vector field $\mathbf{F} (x, y, z) = \sin ( \cos (xy)) \vec{i} + e^{xz} \vec{j} + 2^z \vec{k}$.**

We first need to calculate the necessary partial derivatives. $\frac{\partial P}{\partial x} = -y \sin (xy)\cos ( \cos (xy))$, $\frac{\partial Q}{\partial y} = 0$, and $\frac{\partial R}{\partial z} = \ln (2) 2^z$. Therefore we apply the formula above directly and we have that:

(3)## Example 3

**Compute the divergence of the vector field $\mathbf{F} (x, y, z) = x^2 \vec{i} + y \vec{j} + z^2 \vec{k}$. At what points in $\mathbb{R}^3$ is $\mathbf{F}$ incompressible/solenoidal?**

We first need to calculate the necessary partial derivatives. $\frac{\partial P}{\partial x} = 2x$, $\frac{\partial Q}{\partial y} = 1$, and $\frac{\partial R}{\partial z} = 2z$. Therefore we apply the formula above directly and we have that:

(4)Now $\mathbf{F}$ is incompressible/solenoidal when $\mathrm{div} (\mathbf{F}) = 0$, and so $\mathbf{F}$ is incompressible/solenoidal if $2x + 1 + 2z = 0$, that is on all points $(x, y, z) \in \mathbb{R}^3$ that lie on the plane $2x + 1 + 2z = 0$