How to find a potential function for a conservative vector field

If a vector field comes from the gradient of a function, how do we work backward to find that function? We’ll integrate one component first, then use the other component to finish the potential.

The video works on the whole plane. When using zero curl to check another field, the same shortcut applies if the components have continuous first partial derivatives on an open, simply connected domain.

Write the two partial derivatives of the potential

Let F=(P,Q) be a vector field in the plane. If F=∇f, then f is a potential function for F. The first component of the gradient is the derivative with respect to x, and the second is the derivative with respect to y.

fx=Pfy=Q

Check the cross partials

If P and Q have continuous first partial derivatives on an open, simply connected domain, then Py=Qx guarantees a potential exists. The scalar curl in the plane is Qx-Py, so checking these derivatives is the same as checking that the scalar curl is zero.

For the example, let P=yex+siny and Q=ex+xcosy. Both components are smooth on the whole plane, which is open and simply connected. The cross partials agree.

Py=ex+cosyQx=ex+cosy

Integrate one component and keep the function of y

We know fx=yex+siny. Integrate with respect to x, holding y fixed. Both y and siny are constant with respect to x.

f(x,y)=yex+xsiny+g(y)

Any function g(y) has an x derivative of zero. So the first component tells us the x-dependent part of f, and the second component will tell us what belongs in g(y).

Use the other component to find g(y)

Take the y derivative of the expression we just found, then set it equal to Q.

fy=ex+xcosy+g′(y)Q=ex+xcosy

Because fy=Q, we get g′(y)=0. So g(y) can be any constant K, and the potential is

f(x,y)=yex+xsiny+K

Differentiating this with respect to x gives yex+siny. Differentiating with respect to y gives ex+xcosy. Those are exactly the components of F, so we’ve checked the potential.

Use the potential to evaluate a line integral

If a curve stays in the field’s domain and starts at (x1,y1) and ends at (x2,y2), the fundamental theorem for line integrals gives

∫CF⋅dr=f(x2,y2)-f(x1,y1)

For example, from (0,0) to (0,1), the ending value is 1+K and the starting value is K, so the integral is 1. The constant cancels for any pair of endpoints.

To see why the same endpoint calculation works along different paths, read how path independence works.