Conservative Vector Fields

A conservative vector field is the gradient of some function f, called a potential function: F = ∇f. For these fields, a line integral depends only on the endpoints, because ∫C ∇f · dr = f(end) − f(start). In the plane, F = ⟨P, Q⟩ is conservative on an open region without holes exactly when ∂P/∂y = ∂Q/∂x.

Before this lesson: Line Integrals, Vector Fields and Partial Derivatives

Why some fields are conservative

In line integrals, the work along a path usually depends on the path you take. Some force fields are special: gravity near the ground does the same work on a falling ball whether it drops straight down or rolls down a twisting ramp. Only the change in height matters.

Fields like this are called conservative because mechanical energy is conserved in them. The function f plays the role of energy, and the work is just the change in f. If you go around a closed loop and come back to the start, the work is 0.

Level curves of f(x, y) = x² + xy + 2y² are drawn as gray curves labeled f = 4, 10, 16 and 23 in the first quadrant. Point A at (1, 1) lies on the curve f = 4 and point B at (3, 2) lies on the curve f = 23. A solid blue straight path and a dashed orange winding path both run from A to B. Each path gives the same work, f(B) − f(A) = 23 − 4 = 19.
For the conservative field F = ⟨2x + y, x + 4y⟩ in Example 5, every path from A to B does the same work: f(B) − f(A) = 19.

Fundamental theorem for line integrals

\int_C \nabla f \cdot d\mathbf{r} = f\big(\mathbf{r}(b)\big) - f\big(\mathbf{r}(a)\big)

This works for any smooth path C from r(a) to r(b). It is the line-integral version of the fundamental theorem of calculus.

Test for a conservative field

\mathbf{F} = \langle P, Q \rangle \text{ is conservative} \iff \dfrac{\partial P}{\partial y} = \dfrac{\partial Q}{\partial x}

The test needs P and Q to have continuous partial derivatives on an open region with no holes (a simply connected region), such as the whole plane. In space, F = ⟨P, Q, R⟩ is conservative when P_y = Q_x, P_z = R_x and Q_z = R_y.

  1. To find a potential function f, integrate P with respect to x: f = ∫ P dx + g(y).
  2. Differentiate that f with respect to y and set it equal to Q.
  3. Solve for g′(y), then integrate to find g(y).
  4. Write f. Any constant can be added; it cancels in f(end) − f(start).

Conservative vector fields examples

Example 1: Test a field and find its potential function

Show that F(x, y) = ⟨2xy + 3, x² − 4y⟩ is conservative and find a potential function.

P_y = \dfrac{\partial}{\partial y}(2xy + 3) = 2x

Differentiate P with respect to y.

Q_x = \dfrac{\partial}{\partial x}(x^2 - 4y) = 2x

Differentiate Q with respect to x.

P_y = Q_x

They match, and F is smooth on the whole plane, so F is conservative.

f = \int (2xy + 3)\,dx = x^2y + 3x + g(y)

Integrate P in x. The “constant” can depend on y.

f_y = x^2 + g'(y)

Differentiate with respect to y.

x^2 + g'(y) = x^2 - 4y

Set f_y equal to Q.

g'(y) = -4y

Subtract x² from both sides.

g(y) = -2y^2

Integrate in y.

f(x, y) = x^2y + 3x - 2y^2

Substitute g(y) into f.

Answer: f(x, y) = x²y + 3x − 2y² (plus any constant). Check: f_x = 2xy + 3 and f_y = x² − 4y.

Example 2: Use the fundamental theorem

For F from Example 1, evaluate \int_C \mathbf{F} \cdot d\mathbf{r}, where C is any path from (1, 0) to (2, 1).

\int_C \mathbf{F} \cdot d\mathbf{r} = f(2, 1) - f(1, 0)

F = ∇f, so apply the fundamental theorem.

f(2, 1) = 4 + 6 - 2 = 8

Substitute x = 2, y = 1 into x²y + 3x − 2y².

f(1, 0) = 0 + 3 - 0 = 3

Substitute x = 1, y = 0.

8 - 3 = 5

Subtract.

Answer: 5, for every path from (1, 0) to (2, 1). No parametrization is needed.

Example 3: A field that is not conservative

Show that F(x, y) = ⟨y, 2x⟩ is not conservative. Then compare ∫C F · dr from (0, 0) to (1, 1) along y = x and along y = x².

P_y = 1, \quad Q_x = 2

Differentiate P = y in y and Q = 2x in x.

P_y \ne Q_x

The test fails, so F is not conservative.

\mathbf{r} = \langle t, t \rangle: \; \int_0^1 (t + 2t)\,dt = \dfrac{3}{2}

Along y = x: F = ⟨t, 2t⟩ and r′ = ⟨1, 1⟩.

\mathbf{r} = \langle t, t^2 \rangle: \; \int_0^1 (t^2 + 2t \cdot 2t)\,dt

Along y = x²: F = ⟨t², 2t⟩ and r′ = ⟨1, 2t⟩.

= \int_0^1 5t^2\,dt = \dfrac{5}{3}

Combine like terms and integrate.

Answer: the two paths give 3/2 and 5/3. The value depends on the path, as expected for a field that is not conservative.

Example 4: A conservative field in space

Show that F(x, y, z) = ⟨2x, z², 2yz + 1⟩ is conservative, find a potential function, and evaluate ∫C F · dr from (0, 0, 0) to (1, 2, 3).

P_y = 0 = Q_x, \quad P_z = 0 = R_x

Check the first two cross-partials.

Q_z = 2z = R_y

Check the third. All three match, so F is conservative.

f = \int 2x\,dx = x^2 + g(y, z)

Integrate P in x.

g_y = z^2 \Rightarrow g = yz^2 + h(z)

Set f_y = Q and integrate in y.

2yz + h'(z) = 2yz + 1 \Rightarrow h(z) = z

Set f_z = R, solve for h′(z) = 1 and integrate.

f = x^2 + yz^2 + z

Combine the pieces.

f(1, 2, 3) - f(0, 0, 0) = (1 + 18 + 3) - 0 = 22

Apply the fundamental theorem.

Answer: f = x² + yz² + z, and the line integral is 22 along any path.

Example 5: Work in a force field

A robot arm moves a part through the force field F(x, y) = ⟨2x + y, x + 4y⟩ newtons, with x and y in meters. It moves from A(1, 1) to B(3, 2) along a winding path. How much work does the field do? How much work does it do on a trip from A to B and back to A?

P_y = 1 = Q_x

Test: F is conservative.

f = \int (2x + y)\,dx = x^2 + xy + g(y)

Integrate P in x.

x + g'(y) = x + 4y \Rightarrow g(y) = 2y^2

Set f_y = Q and integrate g′(y) = 4y.

f = x^2 + xy + 2y^2

Write the potential function.

f(3, 2) = 9 + 6 + 8 = 23

Evaluate at B.

f(1, 1) = 1 + 1 + 2 = 4

Evaluate at A.

W = 23 - 4 = 19

Apply the fundamental theorem.

Answer: the field does 19 J of work, whatever the shape of the path. On a round trip back to A the total work is f(A) − f(A) = 0 J.

Common mistakes

MistakeExample of the errorFix
Comparing the wrong partial derivativesChecking P_x = Q_y for ⟨2xy + 3, x² − 4y⟩The test is P_y = Q_x: differentiate P in y and Q in x.
Forgetting g(y) when integrating PWriting f = x²y + 3x in Example 1The constant of integration in x can depend on y. Find g(y) from Q.
Using f(start) − f(end)Getting 3 − 8 = −5 in Example 2Always end minus start: f(r(b)) − f(r(a)).
Using the shortcut on a field that is not conservativeLooking for f with ∇f = ⟨y, 2x⟩Test first. If P_y ≠ Q_x, parametrize and integrate.
Ignoring holes in the regionAssuming P_y = Q_x proves F is conservative on a region around the origin when F is undefined at the originThe test needs a region without holes. With a hole, check a loop around it.

Related methods

Closed curves

For a conservative field, ∮C F · dr = 0 around every closed curve C. If you find one closed curve with a nonzero result, the field is not conservative. Green’s theorem, the next lesson, connects this to Q_x − P_y.

Finding f by inspection

With practice you can often spot f. For example, ⟨y, x⟩ is ∇(xy) and ⟨x, y⟩ is ∇((x² + y²)/2). Always check by taking the gradient of your answer.

Energy in physics

Physicists write F = −∇U, where U is the potential energy. Then the work done by F from A to B is U(A) − U(B), the drop in potential energy.

Practice problems

  1. Is F = ⟨3x², 2y⟩ conservative? If so, find a potential function.
  2. Is F = ⟨x + y, x − y⟩ conservative? If so, find a potential function.
  3. Is F = ⟨xy, x + y⟩ conservative?
  4. Find a potential function for F = ⟨eʸ, xeʸ + 2y⟩.
  5. Evaluate ∫C ⟨2x, 2y⟩ · dr along any path from (1, 2) to (3, −1).
  6. Evaluate ∫C ⟨y cos x, sin x⟩ · dr along any path from (0, 1) to (π/2, 3).
  7. Evaluate ∮C ⟨2xy, x²⟩ · dr once around the unit circle.
  8. Evaluate ∫C ⟨yz, xz, xy⟩ · dr along any path from (1, 1, 1) to (2, 3, −1).
  9. Show that F = ⟨x, y, z⟩ is conservative and evaluate ∫C F · dr from (1, 0, 0) to (0, 3, 4).
  10. A 5 kg box is carried up a spiral staircase, rising 12 m. Gravity is F = ⟨0, 0, −49⟩ newtons. Find the work done by gravity.
Show answers

1.

P_y = 0 = Q_x

Test: the cross-partials match.

f = \int 3x^2\,dx = x^3 + g(y), \quad g'(y) = 2y

Integrate P, then set f_y = Q.

f = x^3 + y^2

Integrate g′(y).

Answer: yes; f = x³ + y²

2.

P_y = 1 = Q_x

Test: the cross-partials match.

f = \dfrac{x^2}{2} + xy + g(y), \quad x + g'(y) = x - y

Integrate P, then set f_y = Q.

g(y) = -\dfrac{y^2}{2}

Integrate g′(y) = −y.

Answer: yes; f = x²/2 + xy − y²/2

3.

P_y = x, \quad Q_x = 1

Differentiate P = xy in y and Q = x + y in x.

x \ne 1 \text{ in general}

The cross-partials differ (except on the line x = 1).

Answer: no, F is not conservative.

4.

f = \int e^y\,dx = xe^y + g(y)

Integrate P in x.

xe^y + g'(y) = xe^y + 2y \Rightarrow g(y) = y^2

Set f_y = Q and integrate.

Answer: f = xeʸ + y²

5.

f = x^2 + y^2

Find a potential function: ∇f = ⟨2x, 2y⟩.

f(3, -1) - f(1, 2) = 10 - 5 = 5

Apply the fundamental theorem.

Answer: 5

6.

f = y\sin x

Find f: f_x = y cos x and f_y = sin x.

f\Big(\dfrac{\pi}{2}, 3\Big) - f(0, 1) = 3(1) - 1(0) = 3

Apply the fundamental theorem.

Answer: 3

7.

P_y = 2x = Q_x

F = ∇(x²y) is conservative on the whole plane.

\oint_C \mathbf{F} \cdot d\mathbf{r} = 0

A closed curve ends where it starts.

Answer: 0

8.

f = xyz

Check: f_x = yz, f_y = xz, f_z = xy.

f(2, 3, -1) - f(1, 1, 1) = -6 - 1 = -7

Apply the fundamental theorem.

Answer: −7

9.

f = \dfrac{x^2 + y^2 + z^2}{2}

∇f = ⟨x, y, z⟩ = F, so F is conservative.

f(0, 3, 4) - f(1, 0, 0) = \dfrac{25}{2} - \dfrac{1}{2} = 12

Apply the fundamental theorem.

Answer: 12

10.

f = -49z

A potential function: ∇f = ⟨0, 0, −49⟩.

W = -49(12) - (-49)(0) = -588

Apply the fundamental theorem with z from 0 to 12.

Answer: −588 J, the same for any staircase that rises 12 m.

Conservative vector fields FAQ

How do you know if a vector field is conservative?

For F = ⟨P, Q⟩ on a region without holes, check whether ∂P/∂y = ∂Q/∂x. In 3D, check the three pairs P_y = Q_x, P_z = R_x and Q_z = R_y, which is the same as curl F = 0.

What is a potential function?

It is a function f whose gradient is the field: ∇f = F. It is unique up to an added constant.

What does path independence mean?

It means ∫C F · dr has the same value for every path with the same starting and ending points. A field is path independent exactly when it is conservative.

Why is the line integral of a conservative field around a closed curve zero?

By the fundamental theorem for line integrals, the integral equals f(end) − f(start). On a closed curve the end and start are the same point, so the difference is 0.

Summary

  • F is conservative when F = ∇f for a potential function f.
  • Fundamental theorem: ∫C ∇f · dr = f(end) − f(start), for any path.
  • Test in 2D: P_y = Q_x on a region without holes. In 3D: P_y = Q_x, P_z = R_x, Q_z = R_y.
  • Find f by integrating P in x, then matching f_y with Q.
  • Around any closed curve, a conservative field does zero work.

Previous lesson: Line Integrals

Next lesson: Green’s Theorem

Back to the Calculus 3 Index