Paul's Online Notes
Home / Calculus III / Line Integrals / Conservative Vector Fields
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width.

### Section 5-6 : Conservative Vector Fields

In the previous section we saw that if we knew that the vector field $$\vec F$$ was conservative then $$\int\limits_{C}{{\vec F\centerdot d\,\vec r}}$$ was independent of path. This in turn means that we can easily evaluate this line integral provided we can find a potential function for $$\vec F$$.

In this section we want to look at two questions. First, given a vector field $$\vec F$$ is there any way of determining if it is a conservative vector field? Secondly, if we know that $$\vec F$$ is a conservative vector field how do we go about finding a potential function for the vector field?

The first question is easy to answer at this point if we have a two-dimensional vector field. For higher dimensional vector fields we’ll need to wait until the final section in this chapter to answer this question. With that being said let’s see how we do it for two-dimensional vector fields.

#### Theorem

Let $$\vec F = P\,\vec i + Q\,\vec j$$ be a vector field on an open and simply-connected region $$D$$. Then if $$P$$ and $$Q$$ have continuous first order partial derivatives in $$D$$ and

$\frac{{\partial P}}{{\partial y}} = \frac{{\partial Q}}{{\partial x}}$

the vector field $$\vec F$$ is conservative.

Let’s take a look at a couple of examples.

Example 1 Determine if the following vector fields are conservative or not.
1. $$\vec F\left( {x,y} \right) = \left( {{x^2} - yx} \right)\vec i + \left( {{y^2} - xy} \right)\vec j$$
2. $$\vec F\left( {x,y} \right) = \left( {2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}} \right)\vec i + \left( {{x^3}{{\bf{e}}^{xy}} + 2y} \right)\vec j$$
Show All Solutions Hide All Solutions
Show Discussion

Okay, there really isn’t too much to these. All we do is identify $$P$$ and $$Q$$ then take a couple of derivatives and compare the results.

a $$\vec F\left( {x,y} \right) = \left( {{x^2} - yx} \right)\vec i + \left( {{y^2} - xy} \right)\vec j$$ Show Solution

In this case here is $$P$$ and $$Q$$ and the appropriate partial derivatives.

\begin{align*}P & = {x^2} - yx\hspace{0.5in}\frac{{\partial P}}{{\partial y}} = - x\\ Q & = {y^2} - xy\hspace{0.5in}\frac{{\partial Q}}{{\partial x}} = - y\end{align*}

So, since the two partial derivatives are not the same this vector field is NOT conservative.

b $$\vec F\left( {x,y} \right) = \left( {2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}} \right)\vec i + \left( {{x^3}{{\bf{e}}^{xy}} + 2y} \right)\vec j$$ Show Solution

Here is $$P$$ and $$Q$$ as well as the appropriate derivatives.

\begin{align*}P & = 2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}\hspace{0.5in}\frac{{\partial P}}{{\partial y}} = 2{x^2}{{\bf{e}}^{xy}} + {x^2}{{\bf{e}}^{xy}} + {x^3}y{{\bf{e}}^{xy}} = 3{x^2}{{\bf{e}}^{xy}} + {x^3}y{{\bf{e}}^{xy}}\\ Q & = {x^3}{{\bf{e}}^{xy}} + 2y\hspace{0.5in}\hspace{0.25in}\frac{{\partial Q}}{{\partial x}} = 3{x^2}{{\bf{e}}^{xy}} + {x^3}y{{\bf{e}}^{xy}}\end{align*}

The two partial derivatives are equal and so this is a conservative vector field.

Now that we know how to identify if a two-dimensional vector field is conservative we need to address how to find a potential function for the vector field. This is actually a fairly simple process. First, let’s assume that the vector field is conservative and so we know that a potential function, $$f\left( {x,y} \right)$$ exists. We can then say that,

$\nabla f = \frac{{\partial f}}{{\partial x}}\,\vec i + \frac{{\partial f}}{{\partial y}}\,\vec j = P\,\vec i + Q\,\vec j = \vec F$

Or by setting components equal we have,

$\frac{{\partial f}}{{\partial x}} = P\hspace{0.5in}{\mbox{and}}\hspace{0.5in}\frac{{\partial f}}{{\partial y}} = Q$

By integrating each of these with respect to the appropriate variable we can arrive at the following two equations.

$f\left( {x,y} \right) = \int{{P\left( {x,y} \right)\,dx}}\hspace{0.5in}{\mbox{or}}\hspace{0.5in}f\left( {x,y} \right) = \int{{Q\left( {x,y} \right)\,dy}}$

We saw this kind of integral briefly at the end of the section on iterated integrals in the previous chapter.

It is usually best to see how we use these two facts to find a potential function in an example or two.

Example 2 Determine if the following vector fields are conservative and find a potential function for the vector field if it is conservative.
1. $$\vec F = \left( {2{x^3}{y^4} + x} \right)\vec i + \left( {2{x^4}{y^3} + y} \right)\vec j$$
2. $$\vec F\left( {x,y} \right) = \left( {2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}} \right)\vec i + \left( {{x^3}{{\bf{e}}^{xy}} + 2y} \right)\vec j$$
Show All Solutions Hide All Solutions
a $$\vec F = \left( {2{x^3}{y^4} + x} \right)\vec i + \left( {2{x^4}{y^3} + y} \right)\vec j$$ Show Solution

Let’s first identify $$P$$ and $$Q$$ and then check that the vector field is conservative.

\begin{align*}P & = 2{x^3}{y^4} + x &\hspace{0.5in}\frac{{\partial P}}{{\partial y}} & = 8{x^3}{y^3}\\ Q & = 2{x^4}{y^3} + y & \hspace{0.5in}\frac{{\partial Q}}{{\partial x}} & = 8{x^3}{y^3}\end{align*}

So, the vector field is conservative. Now let’s find the potential function. From the first fact above we know that,

$\frac{{\partial f}}{{\partial x}} = 2{x^3}{y^4} + x\hspace{0.5in}\frac{{\partial f}}{{\partial y}} = 2{x^4}{y^3} + y$

From these we can see that

$f\left( {x,y} \right) = \int{{2{x^3}{y^4} + x\,dx}}\hspace{0.25in}{\mbox{or}}\hspace{0.25in}\,\,\,\,f\left( {x,y} \right) = \int{{2{x^4}{y^3} + y\,dy}}$

We can use either of these to get the process started. Recall that we are going to have to be careful with the “constant of integration” which ever integral we choose to use. For this example let’s work with the first integral and so that means that we are asking what function did we differentiate with respect to $$x$$ to get the integrand. This means that the “constant of integration” is going to have to be a function of $$y$$ since any function consisting only of $$y$$ and/or constants will differentiate to zero when taking the partial derivative with respect to $$x$$.

Here is the first integral.

\begin{align*}f\left( {x,y} \right) & = \int{{2{x^3}{y^4} + x\,dx}}\\ & = \frac{1}{2}{x^4}{y^4} + \frac{1}{2}{x^2} + h\left( y \right)\end{align*}

where $$h\left( y \right)$$ is the “constant of integration”.

We now need to determine $$h\left( y \right)$$. This is easier than it might at first appear to be. To get to this point we’ve used the fact that we knew $$P$$, but we will also need to use the fact that we know $$Q$$ to complete the problem. Recall that $$Q$$ is really the derivative of $$f$$ with respect to $$y$$. So, if we differentiate our function with respect to $$y$$ we know what it should be.

So, let’s differentiate $$f$$ (including the $$h\left( y \right)$$) with respect to $$y$$ and set it equal to $$Q$$ since that is what the derivative is supposed to be.

$\frac{{\partial f}}{{\partial y}} = 2{x^4}{y^3} + h'\left( y \right) = 2{x^4}{y^3} + y = Q$

From this we can see that,

$h'\left( y \right) = y$

Notice that since $$h'\left( y \right)$$ is a function only of $$y$$ so if there are any $$x$$’s in the equation at this point we will know that we’ve made a mistake. At this point finding $$h\left( y \right)$$ is simple.

$h\left( y \right) = \int{{h'\left( y \right)\,dy}} = \int{{y\,dy}} = \frac{1}{2}{y^2} + c$

So, putting this all together we can see that a potential function for the vector field is,

$f\left( {x,y} \right) = \frac{1}{2}{x^4}{y^4} + \frac{1}{2}{x^2} + \frac{1}{2}{y^2} + c$

Note that we can always check our work by verifying that $$\nabla f = \vec F$$. Also note that because the $$c$$ can be anything there are an infinite number of possible potential functions, although they will only vary by an additive constant.

b $$\vec F\left( {x,y} \right) = \left( {2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}} \right)\vec i + \left( {{x^3}{{\bf{e}}^{xy}} + 2y} \right)\vec j$$ Show Solution

Okay, this one will go a lot faster since we don’t need to go through as much explanation. We’ve already verified that this vector field is conservative in the first set of examples so we won’t bother redoing that.

$\frac{{\partial f}}{{\partial x}} = 2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}\hspace{0.5in}\frac{{\partial f}}{{\partial y}} = {x^3}{{\bf{e}}^{xy}} + 2y$

This means that we can do either of the following integrals,

$f\left( {x,y} \right) = \int{{2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}}\,dx}}\hspace{0.25in}{\mbox{or}}\hspace{0.25in}f\left( {x,y} \right) = \int{{{x^3}{{\bf{e}}^{xy}} + 2y\,dy}}$

While we can do either of these the first integral would be somewhat unpleasant as we would need to do integration by parts on each portion. On the other hand, the second integral is fairly simple since the second term only involves $$y$$’s and the first term can be done with the substitution $$u = xy$$. So, from the second integral we get,

$f\left( {x,y} \right) = {x^2}{{\bf{e}}^{xy}} + {y^2} + h\left( x \right)$

Notice that this time the “constant of integration” will be a function of $$x$$. If we differentiate this with respect to $$x$$ and set equal to $$P$$ we get,

$\frac{{\partial f}}{{\partial x}} = 2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}} + h'\left( x \right) = 2x{{\bf{e}}^{xy}} + {x^2}y{{\bf{e}}^{xy}} = P$

So, in this case it looks like,

$h'\left( x \right) = 0\hspace{0.25in} \Rightarrow \hspace{0.25in}h\left( x \right) = c$

So, in this case the “constant of integration” really was a constant. Sometimes this will happen and sometimes it won’t.

Here is the potential function for this vector field.

$f\left( {x,y} \right) = {x^2}{{\bf{e}}^{xy}} + {y^2} + c$

Now, as noted above we don’t have a way (yet) of determining if a three-dimensional vector field is conservative or not. However, if we are given that a three-dimensional vector field is conservative finding a potential function is similar to the above process, although the work will be a little more involved.

In this case we will use the fact that,

$\nabla f = \frac{{\partial f}}{{\partial x}}\,\vec i + \frac{{\partial f}}{{\partial y}}\,\vec j + \frac{{\partial f}}{{\partial z}}\,\vec k = P\,\vec i + Q\,\vec j + R\,\vec k = \vec F$

Let’s take a quick look at an example.

Example 3 Find a potential function for the vector field,

$\vec F = 2x{y^3}{z^4}\,\vec i + 3{x^2}{y^2}{z^4}\,\vec j + 4{x^2}{y^3}{z^3}\,\vec k$
Show Solution

Okay, we’ll start off with the following equalities.

$\frac{{\partial f}}{{\partial x}} = 2x{y^3}{z^4}\,\hspace{0.5in}\frac{{\partial f}}{{\partial y}} = 3{x^2}{y^2}{z^4}\hspace{0.5in}\frac{{\partial f}}{{\partial z}} = 4{x^2}{y^3}{z^3}$

To get started we can integrate the first one with respect to $$x$$, the second one with respect to $$y$$, or the third one with respect to $$z$$. Let’s integrate the first one with respect to $$x$$.

$f\left( {x,y,z} \right) = \int{{2x{y^3}{z^4}\,dx}} = {x^2}{y^3}{z^4} + g\left( {y,z} \right)$

Note that this time the “constant of integration” will be a function of both $$y$$ and $$z$$ since differentiating anything of that form with respect to $$x$$ will differentiate to zero.

Now, we can differentiate this with respect to $$y$$ and set it equal to $$Q$$. Doing this gives,

$\frac{{\partial f}}{{\partial y}} = 3{x^2}{y^2}{z^4} + {g_y}\left( {y,z} \right) = 3{x^2}{y^2}{z^4} = Q$

Of course we’ll need to take the partial derivative of the constant of integration since it is a function of two variables. It looks like we’ve now got the following,

${g_y}\left( {y,z} \right) = 0\hspace{0.5in} \Rightarrow \hspace{0.5in}g\left( {y,z} \right) = h\left( z \right)$

Since differentiating $$g\left( {y,z} \right)$$ with respect to $$y$$ gives zero then $$g\left( {y,z} \right)$$ could at most be a function of $$z$$. This means that we now know the potential function must be in the following form.

$f\left( {x,y,z} \right) = {x^2}{y^3}{z^4} + h\left( z \right)$

To finish this out all we need to do is differentiate with respect to $$z$$ and set the result equal to $$R$$.

$\frac{{\partial f}}{{\partial z}} = 4{x^2}{y^3}{z^3} + h'\left( z \right) = 4{x^2}{y^3}{z^3} = R$

So,

$h'\left( z \right) = 0\hspace{0.25in} \Rightarrow \hspace{0.25in}\,\,\,h\left( z \right) = c$

The potential function for this vector field is then,

$f\left( {x,y,z} \right) = {x^2}{y^3}{z^4} + c$

Note that to keep the work to a minimum we used a fairly simple potential function for this example. It might have been possible to guess what the potential function was based simply on the vector field. However, we should be careful to remember that this usually won’t be the case and often this process is required.

Also, there were several other paths that we could have taken to find the potential function. Each would have gotten us the same result.

Let’s work one more slightly (and only slightly) more complicated example.

Example 4 Find a potential function for the vector field,

$\vec F = \left( {2x\cos \left( y \right) - 2{z^3}} \right)\,\vec i + \left( {3 + 2y{{\bf{e}}^{\,z}} - {x^2}\sin \left( y \right)} \right)\,\vec j + \left( {{y^2}{{\bf{e}}^{\,z}} - 6x{z^2}} \right)\,\vec k$
Show Solution

Here are the equalities for this vector field.

$\frac{{\partial f}}{{\partial x}} = 2x\cos \left( y \right) - 2{z^3}\,\hspace{0.5in}\frac{{\partial f}}{{\partial y}} = 3 + 2y{{\bf{e}}^{\,z}} - {x^2}\sin \left( y \right)\hspace{0.5in}\frac{{\partial f}}{{\partial z}} = {y^2}{{\bf{e}}^{\,z}} - 6x{z^2}$

For this example let’s integrate the third one with respect to $$z$$.

$f\left( {x,y,z} \right) = \int{{{y^2}{{\bf{e}}^{\,z}} - 6x{z^2}\,dz}} = {y^2}{{\bf{e}}^{\,z}} - 2x{z^3} + g\left( {x,y} \right)$

The “constant of integration” for this integration will be a function of both $$x$$ and $$y$$.

Now, we can differentiate this with respect to $$x$$ and set it equal to $$P$$. Doing this gives,

$\frac{{\partial f}}{{\partial x}} = - 2{z^3} + {g_x}\left( {x,y} \right) = 2x\cos \left( y \right) - 2{z^3} = P$

So, it looks like we’ve now got the following,

${g_x}\left( {x,y} \right) = 2x\cos \left( y \right)\hspace{0.5in} \Rightarrow \hspace{0.5in}g\left( {x,y} \right) = {x^2}\cos \left( y \right) + h\left( y \right)$

The potential function for this problem is then,

$f\left( {x,y,z} \right) = {y^2}{{\bf{e}}^{\,z}} - 2x{z^3} + {x^2}\cos \left( y \right) + h\left( y \right)$

To finish this out all we need to do is differentiate with respect to $$y$$ and set the result equal to $$Q$$.

$\frac{{\partial f}}{{\partial y}} = 2y{{\bf{e}}^{\,z}} - {x^2}\sin \left( y \right) + h'\left( y \right) = 3 + 2y{{\bf{e}}^{\,z}} - {x^2}\sin \left( y \right) = Q$

So,

$h'\left( y \right) = 3\hspace{0.25in} \Rightarrow \hspace{0.25in}\,\,\,h\left( y \right) = 3y + c$

The potential function for this vector field is then,

$f\left( {x,y,z} \right) = {y^2}{{\bf{e}}^{\,z}} - 2x{z^3} + {x^2}\cos \left( y \right) + 3y + c$

So, a little more complicated than the others and there are again many different paths that we could have taken to get the answer.

We need to work one final example in this section.

Example 5 Evaluate $$\displaystyle \int\limits_{C}{{\vec F\centerdot d\,\vec r}}$$ where $$\vec F = \left( {2{x^3}{y^4} + x} \right)\vec i + \left( {2{x^4}{y^3} + y} \right)\vec j$$ and $$C$$ is given by $$\vec r\left( t \right) = \left( {t\cos \left( {\pi \,t} \right) - 1} \right)\vec i + \sin \left( {\frac{{\pi \,t}}{2}} \right)\vec j$$, $$0 \le t \le 1$$.
Show Solution

Now, we could use the techniques we discussed when we first looked at line integrals of vector fields however that would be particularly unpleasant solution.

Instead, let’s take advantage of the fact that we know from Example 2a above this vector field is conservative and that a potential function for the vector field is,

$f\left( {x,y} \right) = \frac{1}{2}{x^4}{y^4} + \frac{1}{2}{x^2} + \frac{1}{2}{y^2} + c$

Using this we know that integral must be independent of path and so all we need to do is use the theorem from the previous section to do the evaluation.

$\int\limits_{C}{{\vec F\centerdot d\,\vec r}} = \int\limits_{C}{{\nabla f\centerdot d\,\vec r}} = f\left( {\vec r\left( 1 \right)} \right) - f\left( {\vec r\left( 0 \right)} \right)$

where,

$\vec r\left( 1 \right) = \left\langle { - 2,1} \right\rangle \hspace{0.5in}\vec r\left( 0 \right) = \left\langle { - 1,0} \right\rangle$

So, the integral is,

\begin{align*}\int\limits_{C}{{\vec F\centerdot d\,\vec r}} & = f\left( { - 2,1} \right) - f\left( { - 1,0} \right)\\ & = \left( {\frac{{21}}{2} + c} \right) - \left( {\frac{1}{2} + c} \right)\\ & = 10\end{align*}