Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 39 · Line and Surface Integrals

Conservative Fields and Potential Functions

Decide whether a vector field is conservative, find its potential function, and use the fundamental theorem for line integrals to compute work from endpoints.

The last lesson ended with a puzzle. For the field F = ⟨-y, x⟩, work between two points depends on the path. For F = ⟨y, x⟩, it seemed not to. What makes the second field special?

The answer is the idea of a potential function, and it brings back the fundamental theorem of calculus in a new form.

Conservative fields

A vector field F is conservative if it is the gradient of some scalar function f:

Text
F = ∇f

The function f is called a potential function for F. (Physicists often use -f instead and call it potential energy; the sign is a convention.)

Example: f(x, y) = x²y + y³ gives

Text
∇f = ⟨2xy, x² + 3y²⟩

so F = ⟨2xy, x² + 3y²⟩ is conservative with potential f.

The fundamental theorem for line integrals

If F = ∇f and C is a smooth curve from point A to point B, then

Text
∫_C ∇f · dr = f(B) - f(A)

Why? Along the curve, d/dt f(r(t)) = ∇f(r(t)) · r'(t) by the chain rule. Integrating that from t = a to t = b gives f(r(b)) - f(r(a)).

Three consequences follow at once:

  1. The integral depends only on the endpoints, not on the path (path independence).
  2. The integral around any closed curve is zero.
  3. You can compute the work by evaluating f at two points, with no parametrization at all.

Example. For F = ⟨2xy, x² + 3y²⟩ and any path from (0, 0) to (1, 2), the work is f(1, 2) - f(0, 0) = (2 + 8) - 0 = 10.

How to test for conservativeness

Look at F = ⟨P, Q⟩ in the plane. If F = ∇f, then P = fx and Q = fy, so the mixed partials of f must agree:

Text
∂P/∂y = ∂Q/∂x

This is a necessary condition for smooth fields. For ⟨2xy, x² + 3y²⟩, ∂P/∂y = 2x = ∂Q/∂x. For ⟨-y, x⟩, ∂P/∂y = -1 but ∂Q/∂x = 1, so the field is not conservative, which is why path dependence appeared earlier.

The condition is also sufficient when the field is defined on a region with no holes, such as the whole plane or a disk (a simply connected domain). A famous warning: F = ⟨-y, x⟩ / (x² + y²) satisfies ∂P/∂y = ∂Q/∂x everywhere except the origin, yet its integral around the unit circle is 2π, not zero. The hole at the origin breaks the sufficiency.

In three dimensions, the test for F = ⟨P, Q, R⟩ is

Text
∂R/∂y = ∂Q/∂z,   ∂P/∂z = ∂R/∂x,   ∂Q/∂x = ∂P/∂y

which says curl F = 0 (more on curl later).

Python Test whether a field is conservative

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finding a potential function

Given F = ⟨P, Q⟩ with ∂P/∂y = ∂Q/∂x, find f with fx = P and fy = Q:

  1. Integrate P with respect to x: f = ∫ P dx + g(y). The "constant of integration" may depend on y.
  2. Differentiate with respect to y and set equal to Q. This determines g'(y).
  3. Integrate to find g(y).

Example. F = ⟨2xy, x² + 3y²⟩.

  1. f = ∫ 2xy dx = x²y + g(y).
  2. fy = x² + g'(y) must equal x² + 3y², so g'(y) = 3y².
  3. g(y) = y³.

So f = x²y + y³ + C. Check: fx = 2xy, fy = x² + 3y². Correct.

Python Find the potential and compute work from endpoints

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Path independence in action

You can check path independence numerically. Take the conservative field F = ⟨2xy, x² + 3y²⟩ and two very different paths from (0, 0) to (1, 2). Both should give 10. For the non-conservative ⟨-y, x⟩, the results differ.

Python Two paths, same endpoints

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The conservative field should give about 10 on both paths; the rotational field gives different answers.

Physical meaning

Gravity near Earth, the electrostatic field of a fixed charge and the spring force are conservative. The work they do depends only on where you start and end, which is why we can define potential energy. Friction is not conservative: a longer path costs more energy.

Conservative does not mean "constant". It means the field comes from a potential, so closed-loop work is zero.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. A vector field F is conservative if:

    That is the definition; f is called a potential function.
  2. 2. If F = ∇f, the integral of F along a curve from A to B equals:

    This is the fundamental theorem for line integrals; only the endpoints matter.
  3. 3. Which test shows F = ⟨P, Q⟩ is NOT conservative?

    For a smooth conservative field the mixed partials of the potential agree, so any mismatch rules it out.
  4. 4. For F = ⟨2xy, x² + 3y²⟩, the work from (0, 0) to (1, 2) is:

    With f = x²y + y³, f(1, 2) = 2 + 8 = 10 and f(0, 0) = 0.

Summary

  • F is conservative if F = ∇f; f is a potential function.
  • Then ∫_C F · dr = f(B) - f(A): path independent, and zero around closed loops.
  • In the plane, ∂P/∂y = ∂Q/∂x is the test (sufficient on simply connected domains).
  • To find f, integrate P in x, add g(y), and match fy = Q.
  • Fields such as ⟨-y, x⟩ fail the test and have path-dependent work.

Next: Surface Integrals and Flux