Finding the potential function for path-independent vector fields

You are given a vector field, say,

F(x, y) = (y cos x + y2, sin x + 2xy - 2y).    

You calculate

$\displaystyle {\frac{{\partial F_2}}{{\partial x}}}$ = $\displaystyle {\frac{{\partial }}{{\partial x}}}$(sin x + 2xy - 2y) = cos x + 2y    
$\displaystyle {\frac{{\partial F_1}}{{\partial y}}}$ = $\displaystyle {\frac{{\partial }}{{\partial y}}}$(y cos x + y2) = cos x + 2y    

so that its curl is zero, i.e.,

$\displaystyle {\frac{{\partial F_2}}{{\partial x}}}$ - $\displaystyle {\frac{{\partial F_1}}{{\partial y}}}$ = 0.    

F is defined on all of R2, so there are no tricks to worry about. The vector field F is path-independent.

Since F is path-independent, we know there exists some potential function f so that $ \nabla$f = F. How do we go about finding f?

Well, $ \nabla$f = F means that

$\displaystyle \left(\vphantom{\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}}\right.$$\displaystyle {\frac{{\partial f}}{{\partial x}}}$,$\displaystyle {\frac{{\partial f}}{{\partial y}}}$$\displaystyle \left.\vphantom{\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}}\right)$ = (F1, F2) = (y cos x + y2, sin x + 2xy - 2y).    

So we need to find a function f (x, y) that satisfies the two conditions

$\displaystyle {\frac{{\partial f}}{{\partial x}}}$(x, y) = y cos x + y2 (1)

and

$\displaystyle {\frac{{\partial f}}{{\partial y}}}$(x, y) = sin x + 2xy - 2y. (2)

Let's take these conditions one by one and see if we can find an f (x, y) that satisfies both of them. (We know this is possible since F is path-independent. If F were path-dependent, the procedure that follows would hit a snag somewhere.)

Let's start with condition (1). We can take the equation

$\displaystyle {\frac{{\partial f}}{{\partial x}}}$(x, y) = y cos x + y2,    

and treat y as though it were a number. In other words, we pretend that the equation is

$\displaystyle {\frac{{\mathrm{d} f}}{{ \mathrm{d} x}}}$(x) = a cos x + a2    

for some number a. We can integrate the equation with respect to x and obtain that

f (x) = a sin x + a2x + C.    

But, then we have to remember that a really was the variable y so that

f (x, y) = y sin x + y2x + C.    

But actually, that's not right yet either. Since we were viewing y as a constant, really C could be a function of y and it wouldn't make a difference. We can replace C with any function of y, say g(y), and condition (1) will be satisfied

f (x, y) = y sin x + y2x + g(y). (3)

If you are still skeptical, try taking the partial derivative with respect to x of f (x, y) defined by equation (3). Since g(y) does not depend on x, we can conclude that $\displaystyle {\frac{{\partial }}{{\partial x}}}$g(y) = 0. Indeed, condition (1) is satisfied for the f (x, y) of equation (3).

Now, we need to satisfy condition (2). We can take the f (x, y) of equation (3) (so we know that condition (1) will be satisfied) and take its partial derivative with respect to y, obtaining

$\displaystyle {\frac{{\partial f}}{{\partial y}}}$(x, y) = $\displaystyle {\frac{{\partial }}{{\partial y}}}$$\displaystyle \left(\vphantom{ y \sin x + y^2x +g(y)}\right.$y sin x + y2x + g(y)$\displaystyle \left.\vphantom{ y \sin x + y^2x +g(y)}\right)$ = sin x + 2yx + $\displaystyle {\frac{{\mathrm{d} g}}{{ \mathrm{d} y}}}$(y).    

Comparing this to condition (2), we are in luck. We can easily make this f (x, y) satisfy condition (2) as long as

$\displaystyle {\frac{{\mathrm{d} g}}{{ \mathrm{d} y}}}$(y) = - 2y.    

(If the vector field F had been path-dependent, we would have found it impossible to satisfy both condition (1) and condition (2), and would have run into trouble at this point.)

If we let

g(y) = - y2 + k    

for some constant k, then

$\displaystyle {\frac{{\partial f}}{{\partial y}}}$(x, y) = sin x + 2yx - 2y,    

and we have satisfied both conditions.

Combining this definition of g(y) with equation (3), we conclude that the function

f (x, y) = y sin x + y2x - y2 + k    

is a potential function for F. You can verify that indeed

$\displaystyle \nabla$f = (y cos x + y2, sin x + 2xy - 2y) = F(x, y).    

With this in hand, calculating the integral

$\displaystyle \int_{{C}}^{}$F . ds    

is simple, no matter what path C is. The integral is simply f (q) - f (p), where p is the beginning point and q is the ending point of C. (For this reason, if C is a closed curve, the integral is zero.)

We might like to give a problem such as find

$\displaystyle \int_{{C}}^{}$F . ds    

where C is the curve given by the following graph.
\includegraphics[width=2.5in]{curveint.eps}

The answer is simply

$\displaystyle \int_{{C}}^{}$F . ds = f ($\displaystyle \pi$/2, -1) - f (- $\displaystyle \pi$, 2)    
  = - sin$\displaystyle \pi$/2 + $\displaystyle {\frac{{\pi}}{{2}}}$ -1 + k - (2 sin(- $\displaystyle \pi$) - 4$\displaystyle \pi$ - 4 + k)    
  = - sin$\displaystyle \pi$/2 + $\displaystyle {\frac{{9\pi}}{{2}}}$ +3 = $\displaystyle {\frac{{9\pi}}{{2}}}$ + 2    

(The constant k is always guaranteed to cancel, so you could just set k = 0.)

If the curve C is complicated, it's a good hint that F is probably path-independent. It's always a good idea to check if F is path-independent before computing its line integral

$\displaystyle \int_{{C}}^{}$F . ds    

You might save yourself a lot of work.



Duane Nykamp
nykamp@math.umn.edu
2005-11-02