# 15.2 Vector Fields

We have studied functions of two and three variables, where the input of such functions is a point (either a point in the plane or in space) and the output is a number.

We could also create functions where the input is a point (again, either in the plane or in space), but the output is a vector. For instance, we could create the following function: $\vec{F}(x,y)=\left\langle x+y,x-y\right\rangle$, where $\vec{F}(2,3)=\left\langle 5,-1\right\rangle$. We are to think of $\vec{F}$ assigning the vector $\left\langle 5,-1\right\rangle$ to the point $(2,3)$; in some sense, the vector $\left\langle 5,-1\right\rangle$ lies at the point $(2,3)$.

Such functions are extremely useful in any context where magnitude and direction are important. For instance, we could create a function $\vec{F}$ that represents the electromagnetic force exerted at a point by a electromagnetic field, or the velocity of air as it moves across an airfoil.

Because these functions are so important, we need to formally define them.

margin: (a) (b) Figure 15.2.1: Demonstrating methods of graphing vector fields. Λ
###### Definition 15.2.1 Vector Field

(a) A vector field in the plane is a function $\vec{F}(x,y)$ whose domain is a subset of $\mathbb{R}^{2}$ and whose output is a two-dimensional vector: $\vec{F}(x,y)=\left\langle M(x,y),N(x,y)\right\rangle.$ (b) A vector field in space is a function $\vec{F}(x,y,z)$ whose domain is a subset of $\mathbb{R}^{3}$ and whose output is a three-dimensional vector: $\vec{F}(x,y,z)=\left\langle M(x,y,z),N(x,y,z),P(x,y,z)\right\rangle.$

This definition may seem odd at first, as a special type of function is called a “field.” However, as the function determines a “field of vectors”, we can say the field is defined by the function, and thus the field is a function.

Visualizing vector fields helps cement this connection. When graphing a vector field in the plane, the general idea is to draw the vector $\vec{F}(x,y)$ at the point $(x,y)$. For instance, using $\vec{F}(x,y)=\left\langle x+y,x-y\right\rangle$ as before, at $(1,1)$ we would draw $\left\langle 2,0\right\rangle$.

In Figure 15.2.1(a), one can see that the vector $\left\langle 2,0\right\rangle$ is drawn starting from the point $(1,1)$. A total of 8 vectors are drawn, with the $x$- and $y$-values of $-1,0,1$. In many ways, the resulting graph is a mess; it is hard to tell what this field “looks like.”

In Figure 15.2.1(b), the same field is redrawn with each vector $\vec{F}(x,y)$ drawn centered on the point $(x,y)$. This makes for a better looking image, though the long vectors can cause confusion: when one vector intersects another, the image looks cluttered.

margin: (a) (b) Figure 15.2.2: Demonstrating methods of graphing vector fields. Λ

A common way to address this problem is limit the length of each arrow, and represent long vectors with thick arrows, as done in Figure 15.2.2(a). Usually we do not use a graph of a vector field to determine exactly the magnitude of a particular vector. Rather, we are more concerned with the relative magnitudes of vectors: which are bigger than others? Thus limiting the length of the vectors is not problematic.

Drawing arrows with variable thickness is best done with technology; search the documentation of your graphing program for terms like “vector fields” or “slope fields” to learn how. Technology obviously allows us to plot many vectors in a vector field nicely; in Figure 15.2.2(b), we see the same vector field drawn with many vectors, and finally get a clear picture of how this vector field behaves. (If this vector field represented the velocity of air moving across a flat surface, we could see that the air tends to move either to the upper-right or lower-left, and moves very slowly near the origin.)

We can similarly plot vector fields in space, as shown in Figure 15.2.3, though it is not often done. The plots get very busy very quickly, as there are lots of arrows drawn in a small amount of space. In Figure 15.2.3 the field $\vec{F}=\left\langle-y,x,z\right\rangle$ is graphed. If one could view the graph from above, one could see the arrows point in a circle about the $z$-axis. One should also note how the arrows far from the origin are larger than those close to the origin.

margin: Figure 15.2.3: Graphing a vector field in space. Λ

It is good practice to try to visualize certain vector fields in one’s head. For instance, consider a point mass at the origin and the vector field that represents the gravitational force exerted by the mass at any point in the room. The field would consist of arrows pointing toward the origin, increasing in size as they near the origin (as the gravitational pull is strongest near the point mass).

## Vector Field Notation and Del Operator

Definition 15.2.1 defines a vector field $\vec{F}$ using the notation

 $\displaystyle\vec{F}(x,y)$ $\displaystyle=\left\langle M(x,y),N(x,y)\right\rangle\quad\text{and}$ $\displaystyle\vec{F}(x,y,z)$ $\displaystyle=\left\langle M(x,y,z),N(x,y,z),P(x,y,z)\right\rangle.$

That is, the components of $\vec{F}$ are each functions of $x$ and $y$ (and also $z$ in space). As done in other contexts, we will drop the “of $x$, $y$ and $z$” portions of the notation and refer to vector fields in the plane and in space as

 $\vec{F}=\left\langle M,N\right\rangle\quad\text{and}\quad\vec{F}=\left\langle M% ,N,P\right\rangle,$

respectively, as this shorthand is quite convenient.

Another item of notation will become useful: the “del operator.” Recall in Section 13.6 how we used the symbol $\nabla$ (pronounced “del”) to represent the gradient of a function of two variables. That is, if $z=f(x,y)$, then “del $f$ ” $=\nabla f=\left\langle f_{x},f_{y}\right\rangle$.

We now define $\nabla$ to be the “del operator.” It is a vector whose components are partial derivative operations.

In the plane, $\displaystyle\nabla=\left\langle\frac{\partial}{\partial x},\frac{\partial}{% \partial y}\right\rangle$; in space, $\displaystyle\nabla=\left\langle\frac{\partial}{\partial x},\frac{\partial}{% \partial y},\frac{\partial}{\partial z}\right\rangle$.

With this definition of $\nabla$, we can better understand the gradient $\nabla f$. As $f$ returns a scalar, the properties of scalar and vector multiplication gives

 $\nabla f=\left\langle\frac{\partial}{\partial x},\frac{\partial}{\partial y}% \right\rangle f=\left\langle\frac{\partial}{\partial x}\,f,\frac{\partial}{% \partial y}\,f\right\rangle=\left\langle f_{x},f_{y}\right\rangle.$

Now apply the del operator $\nabla$ to vector fields. Let $\vec{F}=\left\langle x+\sin y,y^{2}+z,x^{2}\right\rangle$. We can use vector operations and find the dot product of $\nabla$ and $\vec{F}$:

 $\displaystyle\nabla\cdot\vec{F}$ $\displaystyle=\left\langle\frac{\partial}{\partial x},\frac{\partial}{\partial y% },\frac{\partial}{\partial z}\right\rangle\cdot\left\langle x+\sin y,y^{2}+z,x% ^{2}\right\rangle$ $\displaystyle=\frac{\partial}{\partial x}(x+\sin y)+\frac{\partial}{\partial y% }(y^{2}+z)+\frac{\partial}{\partial z}(x^{2})$ $\displaystyle=1+2y.$

We can also compute their cross products:

 $\displaystyle\nabla\times\vec{F}$ $\displaystyle={\left\langle\frac{\partial}{\partial y}\bigl{(}x^{2}\bigr{)}-% \frac{\partial}{\partial z}\bigl{(}y^{2}+z\bigr{)},\frac{\partial}{\partial z}% \bigl{(}x+\sin y\bigr{)}-\frac{\partial}{\partial x}\bigl{(}x^{2}\bigr{)},% \frac{\partial}{\partial x}\bigl{(}y^{2}+z\bigr{)}-\frac{\partial}{\partial y}% \bigl{(}x+\sin y\bigr{)}\right\rangle}$ $\displaystyle=\left\langle-1,-2x,-\cos y\right\rangle.$

We do not yet know why we would want to compute the above. However, as we next learn about properties of vector fields, we will see how these dot and cross products with the del operator are quite useful.

## Divergence and Curl

Two properties of vector fields will prove themselves to be very important: divergence and curl. Each is a special “derivative” of a vector field; that is, each measures an instantaneous rate of change of a vector field.

If the vector field represents the velocity of a fluid or gas, then the divergence of the field is a measure of the “compressibility” of the fluid. If the divergence is negative at a point, it means that the fluid is compressing: more fluid is going into the point than is going out. If the divergence is positive, it means the fluid is expanding: more fluid is going out at that point than going in. A divergence of zero means the same amount of fluid is going in as is going out. If the divergence is zero at all points, we say the field is incompressible.

It turns out that the proper measure of divergence is simply $\nabla\cdot\vec{F}$, as stated in the following definition.

###### Definition 15.2.2 Divergence of a Vector Field

The divergence of a vector field $\vec{F}$ is

 $\operatorname{div}\vec{F}=\nabla\cdot\vec{F}.$
• In the plane, with $\vec{F}=\left\langle M,N\right\rangle$, $\operatorname{div}\vec{F}=M_{x}+N_{y}$.

• In space, with $\vec{F}=\left\langle M,N,P\right\rangle$, $\operatorname{div}\vec{F}=M_{x}+N_{y}+P_{z}$.

Curl is a measure of the spinning action of the field. Let $\vec{F}$ represent the flow of water over a flat surface. If a small round cork were held in place at a point in the water, would the water cause the cork to spin? No spin corresponds to zero curl; counterclockwise spin corresponds to positive curl and clockwise spin corresponds to negative curl.

In space, things are a bit more complicated. Again let $\vec{F}$ represent the flow of water, and imagine suspending a tennis ball in one location in this flow. The water may cause the ball to spin along an axis. If so, the curl of the vector field is a vector (not a scalar, as before), parallel to the axis of rotation, following a right hand rule: when the thumb of one’s right hand points in the direction of the curl, the ball will spin in the direction of the curling fingers of the hand.

In space, it turns out the proper measure of curl is $\nabla\times\vec{F}$, as stated in the following definition. To find the curl of a planar vector field $\vec{F}=\left\langle M,N\right\rangle$, embed it into space as $\vec{F}=\left\langle M,N,0\right\rangle$ and apply the cross product definition. Since $M$ and $N$ are functions of just $x$ and $y$ (and not $z$), all partial derivatives with respect to $z$ become 0 and the result is simply $\left\langle 0,0,N_{x}-M_{y}\right\rangle$. The third component is the measure of curl of a planar vector field.

###### Definition 15.2.3 Curl of a Vector Field

Let $\vec{F}=\left\langle M,N\right\rangle$ be a vector field in the plane. The curl of $\vec{F}$ is $\operatorname{curl}\vec{F}=N_{x}-M_{y}$. Let $\vec{F}=\left\langle M,N,P\right\rangle$ be a vector field in space. The curl of $\vec{F}$ is $\operatorname{curl}\vec{F}=\nabla\times\vec{F}=\left\langle P_{y}-N_{z},M_{z}-% P_{x},N_{x}-M_{y}\right\rangle$.

We adopt the convention of referring to curl as $\nabla\times\vec{F}$, regardless of whether $\vec{F}$ is a vector field in two or three dimensions.

We now practice computing these quantities.

margin: (a) (b) Figure 15.2.4: The vector fields in parts (a) and (b) in Example 15.2.1. Λ
###### Example 15.2.1 Computing divergence and curl of planar vector fields

For each of the planar vector fields given below, view its graph and try to visually determine if its divergence and curl are 0. Then compute the divergence and curl.

1. (a)

$\vec{F}=\left\langle y,0\right\rangle$ (see Figure 15.2.4(a))

2. (b)

$\vec{F}=\left\langle-y,x\right\rangle$ (see Figure 15.2.4(b))

3. (c)

$\vec{F}=\left\langle x,y\right\rangle$ (see Figure 15.2.5(a))

4. (d)

$\vec{F}=\left\langle\cos y,\sin x\right\rangle$ (see Figure 15.2.5(b))

Solution

1. (a)

The arrow sizes are constant along any horizontal line, so if one were to draw a small box anywhere on the graph, it would seem that the same amount of fluid would enter the box as exit. Therefore it seems the divergence is zero; it is, as

 $\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}=\frac{\partial}{% \partial x}(y)+\frac{\partial}{\partial y}(0)=0.$

At any point on the $x$-axis, arrows above it move to the right and arrows below it move to the left, indicating that a cork placed on the axis would spin clockwise. A cork placed anywhere above the $x$-axis would have water above it moving to the right faster than the water below it, also creating a clockwise spin. A clockwise spin also appears to be created at points below the $x$-axis. Thus it seems the curl should be negative (and not zero). Indeed, it is:

 $\operatorname{curl}\vec{F}=\nabla\times\vec{F}=N_{x}-M_{y}=\frac{\partial}{% \partial x}(0)-\frac{\partial}{\partial y}(y)=-1.$
2. (b)

It appears that all vectors that lie on a circle of radius $r$, centered at the origin, have the same length (and indeed this is true). That implies that the divergence should be zero: draw any box on the graph, and any fluid coming in will lie along a circle that takes the same amount of fluid out. Indeed, the divergence is zero, as

 $\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}=\frac{\partial}{% \partial x}(-y)+\frac{\partial}{\partial y}(x)=0.$

Clearly this field moves objects in a circle, but would it induce a cork to spin? It appears that yes, it would: place a cork anywhere in the flow, and the point of the cork closest to the origin would feel less flow than the point on the cork farthest from the origin, which would induce a counterclockwise flow. Indeed, the curl is positive:

 $\operatorname{curl}\vec{F}=\nabla\times\vec{F}=N_{x}-M_{y}=\frac{\partial}{% \partial x}(x)-\frac{\partial}{\partial y}(-y)=1-(-1)=2.$

Since the curl is constant, we conclude the induced spin is the same no matter where one is in this field. margin: (a) (b) Figure 15.2.5: The vector fields in parts (c) and (d) in Example 15.2.1. Λ

3. (c)

At the origin, there are many arrows pointing out but no arrows pointing in. We conclude that at the origin, the divergence must be positive (and not zero). If one were to draw a box anywhere in the field, the edges farther from the origin would have larger arrows passing through them than the edges close to the origin, indicating that more is going from a point than going in. This indicates a positive (and not zero) divergence. This is correct:

 $\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}=\frac{\partial}{% \partial x}(x)+\frac{\partial}{\partial y}(y)=1+1=2.$

One may find this curl to be harder to determine visually than previous examples. One might note that any arrow that induces a clockwise spin on a cork will have an equally sized arrow inducing a counterclockwise spin on the other side, indicating no spin and no curl. This is correct, as

 $\operatorname{curl}\vec{F}=\nabla\times\vec{F}=N_{x}-M_{y}=\frac{\partial}{% \partial x}(y)-\frac{\partial}{\partial y}(x)=0.$
4. (d)

One might find this divergence hard to determine visually as large arrows appear in close proximity to small arrows, each pointing in different directions. Instead of trying to rationalize a guess, we compute the divergence:

 $\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}=\frac{\partial}{% \partial x}(\cos y)+\frac{\partial}{\partial y}(\sin x)=0.$

Perhaps surprisingly, the divergence is 0. With all the loops of different directions in the field, one is apt to reason the curl is variable. Indeed, it is:

 $\operatorname{curl}\vec{F}=\nabla\times\vec{F}=N_{x}-M_{y}=\frac{\partial}{% \partial x}(\sin x)-\frac{\partial}{\partial y}(\cos y)=\cos x+\sin y.$

Depending on the values of $x$ and $y$, the curl may be positive, negative, or zero.

###### Example 15.2.2 Computing divergence and curl of vector fields in space

Compute the divergence and curl of each of the following vector fields.

1. (a)

$\vec{F}=\left\langle x^{2}+y+z,-x-z,x+y\right\rangle$

2. (b)

$\vec{F}=\left\langle e^{xy},\sin(x+z),x^{2}+y\right\rangle$

SolutionWe compute the divergence and curl of each field following the definitions.

1. (a)

$\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}+P_{z}=2x+0+0=2x.$ \begin{aligned} \operatorname{curl}\vec{F}=\nabla\times\vec{F}&=\left\langle P% _{y}-N_{z},M_{z}-P_{x},N_{x}-M_{y}\right\rangle\\ &=\left\langle 1-(-1),1-1,-1-(1)\right\rangle=\left\langle 2,0,-2\right\rangle% .\end{aligned} For this particular field, no matter the location in space, a spin is induced with axis parallel to $\left\langle 2,0,-2\right\rangle.$

2. (b)

$\operatorname{div}\vec{F}=\nabla\cdot\vec{F}=M_{x}+N_{y}+P_{z}=ye^{xy}+0+0=ye^% {xy}.$ \begin{aligned} \operatorname{curl}\vec{F}=\nabla\times\vec{F}&=\left\langle P% _{y}-N_{z},M_{z}-P_{x},N_{x}-M_{y}\right\rangle\\ &=\left\langle 1-\cos(x+z),-2x,\cos(x+z)-xe^{xy}\right\rangle.\end{aligned}

###### Example 15.2.3 Creating a field representing gravitational force

The force of gravity between two objects is inversely proportional to the square of the distance between the objects. Locate a point mass at the origin. Create a vector field $\vec{F}$ that represents the gravitational pull of the point mass at any point $(x,y,z)$. Find the divergence and curl of this field.

SolutionThe point mass pulls toward the origin, so at $(x,y,z)$, the force will pull in the direction of $\left\langle-x,-y,-z\right\rangle$. To get the proper magnitude, it will be useful to find the unit vector in this direction. Dividing by its magnitude, we have

 $\vec{u}=\left\langle\frac{-x}{\sqrt{x^{2}+y^{2}+z^{2}}},\frac{-y}{\sqrt{x^{2}+% y^{2}+z^{2}}},\frac{-z}{\sqrt{x^{2}+y^{2}+z^{2}}}\right\rangle.$

The magnitude of the force is inversely proportional to the square of the distance between the two points. Letting $k$ be the constant of proportionality, we have the magnitude as $\displaystyle\frac{k}{x^{2}+y^{2}+z^{2}}$. Multiplying this magnitude by the unit vector above, we have the desired vector field: margin: Figure 15.2.6: A vector field representing a planar gravitational force. Λ

 $\vec{F}=\left\langle\frac{-kx}{(x^{2}+y^{2}+z^{2})^{3/2}},\frac{-ky}{(x^{2}+y^% {2}+z^{2})^{3/2}},\frac{-kz}{(x^{2}+y^{2}+z^{2})^{3/2}}\right\rangle.$

We leave it to the reader to confirm that $\operatorname{div}\vec{F}=0$ and $\operatorname{curl}\vec{F}=\vec{0}$.

The analogous planar vector field is given in Figure 15.2.6. Note how all arrows point to the origin, and the magnitude gets very small when “far” from the origin.

A function $z=f(x,y)$ naturally induces a vector field, $\vec{F}=\nabla f=\left\langle f_{x},f_{y}\right\rangle$. Given what we learned of the gradient in Section 13.6, we know that the vectors of $\vec{F}$ point in the direction of greatest increase of $f$. Because of this, $f$ is said to be the potential function of $\vec{F}$. Vector fields that are the gradient of potential functions will play an important role in the next section.

margin: (a) (b) Figure 15.2.7: The vector field $\vec{F}=\nabla f$ and a graph of a function $z=f(x,y)$ in Example 15.2.4. Λ
###### Example 15.2.4 A vector field that is the gradient of a potential function

Let $f(x,y)=3-x^{2}-2y^{2}$ and let $\vec{F}=\nabla f$. Graph $\vec{F}$, and find the divergence and curl of $\vec{F}$.

SolutionGiven $f$, we find $\vec{F}=\nabla f=\left\langle-2x,-4y\right\rangle$. A graph of $\vec{F}$ is given in Figure 15.2.7(a). In part (b) of the figure, the vector field is given along with a graph of the surface itself; one can see how each vector is pointing in the direction of “steepest uphill”, which, in this case, is not simply just “toward the origin.”

We leave it to the reader to confirm that $\operatorname{div}\vec{F}=-6$ and $\operatorname{curl}\vec{F}=0$.

There are some important concepts visited in this section that will be revisited in subsequent sections and again at the very end of this chapter. One is: given a vector field $\vec{F}$, both $\operatorname{div}\vec{F}$ and $\operatorname{curl}\vec{F}$ are measures of rates of change of $\vec{F}$. The divergence measures how much the field spreads (diverges) at a point, and the curl measures how much the field twists (curls) at a point. Another important concept is this: given $z=f(x,y)$, the gradient $\nabla f$ is also a measure of a rate of change of $f$. We will see how the integrals of these rates of change produce meaningful results.

This section introduces the concept of a vector field. The next section “applies calculus” to vector fields. A common application is this: let $\vec{F}$ be a vector field representing a force (hence it is called a “force field,” though this name has a decidedly comic-book feel) and let a particle move along a curve $C$ under the influence of this force. What work is performed by the field on this particle? The solution lies in correctly applying the concepts of line integrals in the context of vector fields.

## Exercises 15.2

### Terms and Concepts

1. 1.

Give two quantities that can be represented by a vector field in the plane or in space.

2. 2.

In your own words, describe what it means for a vector field to have a negative divergence at a point.

3. 3.

In your own words, describe what it means for a vector field to have a negative curl at a point.

4. 4.

The divergence of a vector field $\vec{F}$ at a particular point is 0. Does this mean that $\vec{F}$ is incompressible? Why/why not?

### Problems

In Exercises 5–8., sketch the given vector field over the rectangle with opposite corners $(-2,-2)$ and $(2,2)$, sketching one vector for every point with integer coordinates (i.e., at $(0,0)$, $(1,2)$, etc.).

1. 5.

$\vec{F}=\left\langle x,0\right\rangle$

2. 6.

$\vec{F}=\left\langle 0,x\right\rangle$

3. 7.

$\vec{F}=\left\langle 1,-1\right\rangle$

4. 8.

$\vec{F}=\left\langle y^{2},1\right\rangle$

In Exercises 9–18., find the divergence and curl of the given vector field.

1. 9.

$\vec{F}=\left\langle x,y^{2}\right\rangle$

2. 10.

$\vec{F}=\left\langle-y^{2},x\right\rangle$

3. 11.

$\vec{F}=\left\langle\cos(xy),\sin(xy)\right\rangle$

4. 12.

$\displaystyle\vec{F}=\left\langle\frac{-2x}{(x^{2}+y^{2})^{2}},\frac{-2y}{(x^{% 2}+y^{2})^{2}}\right\rangle$

5. 13.

$\displaystyle\vec{F}=\left\langle x+y,y+z,x+z\right\rangle$

6. 14.

$\displaystyle\vec{F}=\left\langle x^{2}+z^{2},x^{2}+y^{2},y^{2}+z^{2}\right\rangle$

7. 15.

$\vec{F}=\nabla f$, where $f(x,y)=\frac{1}{2}x^{2}+\frac{1}{3}y^{3}$.

8. 16.

$\vec{F}=\nabla f$, where $f(x,y)=x^{2}y$.

9. 17.

$\vec{F}=\nabla f$, where $f(x,y,z)=x^{2}y+\sin z$.

10. 18.

$\vec{F}=\nabla f$, where $\displaystyle f(x,y,z)=\frac{1}{x^{2}+y^{2}+z^{2}}$.

In Exercises 19–26., let $\vec{r}(x,y,z)=x\,\vec{\imath}+y\,\vec{\jmath}+z\,\vec{k}$ and $r=\left\lVert\vec{r}\right\rVert$. Prove the given formula.

1. 19.

$\nabla\,(1/r)=-\vec{r}/r^{3}$

2. 20.

$\nabla\cdot(\vec{r}/r^{3})=0$

3. 21.

$\nabla\,(\ln r)=\vec{r}/r^{2}$

4. 22.

$\operatorname{curl}\,(\vec{F}+\vec{G})=\operatorname{curl}\vec{F}+% \operatorname{curl}\vec{G}$

5. 23.

$\operatorname{div}\,(f\,\vec{F})=f\,\operatorname{div}\vec{F}+\vec{F}\cdot\nabla f$

6. 24.

$\operatorname{div}\,(\vec{F}\times\vec{G})=\vec{G}\cdot\operatorname{curl}\vec% {F}-\vec{F}\cdot\operatorname{curl}\vec{G}$

7. 25.

$\operatorname{div}\,(\nabla f\times\nabla g)=0$

8. 26.

$\operatorname{curl}\,(f\,\vec{F})=f\,\operatorname{curl}\vec{F}+(\nabla f\,)% \times\vec{F}$ 