Skip to content

Conservative Vector Fields

In this lesson you’ll learn what makes a vector field conservative, how to test for it, how to find the potential function, and how the Fundamental Theorem for Line Integrals lets you evaluate work integrals without parametrizing anything.

In the last lesson, computing a line integral required parametrizing the curve, computing derivatives, taking dot products, and integrating. That’s a lot of work. Conservative fields give you a shortcut that skips all of it.

A vector field F is conservative if there exists a scalar function phi (called the potential function) such that

F=φ\mathbf{F} = \nabla \varphi

The symbol phi (written φ\varphi in math notation) means “the function whose gradient produces F.” If you can find such a function, the field is conservative.

The name comes from physics. When a force field is conservative, the work it does moving an object from A to B is the same no matter which path you take. You can’t cheat the system by picking a clever route to squeeze out extra energy. The total mechanical energy (kinetic plus potential) stays constant throughout the motion. Energy is conserved.

That’s the whole idea: a conservative field conserves energy. The work done by the field can be fully stored as potential energy and fully recovered later. No energy is lost to the path itself. Contrast this with friction, which is not conservative. Friction does different amounts of work depending on how far you travel, and the energy it removes turns into heat that you can’t get back.

The Fundamental Theorem for Line Integrals

Section titled “The Fundamental Theorem for Line Integrals”

If F is conservative with potential function phi, and C is any curve from point A to point B, then

CFdr=φ(B)φ(A)\int_C \mathbf{F} \cdot d\mathbf{r} = \varphi(B) - \varphi(A)

That’s it. No parametrization, no dot products, no integration. Just evaluate the potential function at the two endpoints and subtract. This is the multivariable version of the Fundamental Theorem of Calculus, which says abf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)

For a vector field on a simply connected domain (no holes), these three statements are all equivalent:

  1. F is conservative (F = grad phi for some phi)
  2. Line integrals of F are path-independent (the integral depends only on the endpoints)
  3. The line integral of F around every closed curve is zero

If any one of these is true, all three are true. If any one fails, all three fail.

For a 2D field F=P,Q,\mathbf{F} = \langle P, Q \rangle, there’s a quick test. F is conservative if and only if

Py=Qx\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x}

This works on simply connected domains (regions with no holes). If the partials match, the field is conservative and you can find a potential function. If they don’t match, the field is not conservative.

Example 1: Testing and finding the potential function

Is F=2x+y,  x+2y\mathbf{F} = \langle 2x + y,\; x + 2y \rangle conservative? If so, find the potential function.

Apply the cross-partial test with P = 2x + y and Q = x + 2y:

Py=1Qx=1\frac{\partial P}{\partial y} = 1 \qquad \frac{\partial Q}{\partial x} = 1

They’re equal, so F is conservative. Now find φ\varphi such that φ=F\nabla\varphi = \mathbf{F}

Start with φx=2x+y\frac{\partial \varphi}{\partial x} = 2x + y and integrate with respect to x:

φ=x2+xy+g(y)\varphi = x^2 + xy + g(y)

where g(y) is an unknown function of y (the “constant” of integration, but it can depend on y since we only integrated in x).

Now use the other condition φy=x+2y\frac{\partial \varphi}{\partial y} = x + 2y to find g:

y(x2+xy+g(y))=x+g(y)=x+2y\frac{\partial}{\partial y}(x^2 + xy + g(y)) = x + g'(y) = x + 2y

So g(y)=2y,g'(y) = 2y, which gives g(y)=y2+Cg(y) = y^2 + C

The potential function is φ(x,y)=x2+xy+y2\varphi(x, y) = x^2 + xy + y^2 (dropping the constant C since it cancels in any line integral).

Example 2: Path independence with the Fundamental Theorem

Compute the work done by F=2x+y,  x+2y\mathbf{F} = \langle 2x + y,\; x + 2y \rangle along any path from (0, 0) to (1, 1).

Since F is conservative with φ(x,y)=x2+xy+y2,\varphi(x, y) = x^2 + xy + y^2, the Fundamental Theorem gives

CFdr=φ(1,1)φ(0,0)\int_C \mathbf{F} \cdot d\mathbf{r} = \varphi(1, 1) - \varphi(0, 0) =(1+1+1)(0+0+0)=3= (1 + 1 + 1) - (0 + 0 + 0) = 3

The work is 3 regardless of which path you take. The dashed blue diagonal and the solid green L-shaped path both give the same answer. You could take any crazy winding path from A to B and still get 3.

Example 3: Closed loops give zero work

For the same field F=2x+y,  x+2y,\mathbf{F} = \langle 2x + y,\; x + 2y \rangle, compute the work around any closed loop.

A closed loop starts and ends at the same point, so A = B. The Fundamental Theorem gives

CFdr=φ(A)φ(A)=0\oint_C \mathbf{F} \cdot d\mathbf{r} = \varphi(A) - \varphi(A) = 0

The circle on the integral sign means “closed loop.” For any conservative field, the work around any closed curve is always zero. This is the mathematical reason why gravity doesn’t give you free energy: if you go up and come back down to the same height, the net work is zero.

Example 4: A non-conservative field

Is F=y,  x\mathbf{F} = \langle -y,\; x \rangle conservative?

Apply the cross-partial test with P = -y and Q = x:

Py=1Qx=1\frac{\partial P}{\partial y} = -1 \qquad \frac{\partial Q}{\partial x} = 1

They’re not equal (-1 does not equal 1), so F is not conservative. This is the rotational field from Lessons 13 and 14. We already showed that the work along the upper semicircle is pi, which means the integral depends on the path. No potential function exists for this field.

Conservative fields show up whenever energy is conserved:

  • Gravity is conservative. The work done by gravity depends only on the height difference, not the path. That’s why a ball rolling down a ramp and a ball falling straight down from the same height reach the bottom with the same speed.
  • Electric fields from stationary charges are conservative. The voltage difference between two points is path-independent, which is why circuits work.
  • Game engines model gravity and spring forces as conservative fields. The potential function gives the potential energy at each point, and the work-energy theorem connects force, work, and kinetic energy.
  • Friction is not conservative. The work done by friction depends on the path length, which is why friction generates heat and you can’t recover the energy.
A vector field F is conservative if
For $\mathbf{F} = \langle 2x + y, x + 2y \rangle$, the cross-partial test gives
The Fundamental Theorem for Line Integrals says the work equals
The line integral of a conservative field around a closed loop equals
The rotational field $\mathbf{F} = \langle -y, x \rangle$ is