Calculus 4Line Integrals

Finding a Potential Function

Integrate one component and match the others.

Not started Jump to practice

Once a field passes the test for conservative fields, you can find a potential $f$ with $\nabla f = \mathbf{F}$ by integrating one variable at a time. The only subtle point is the "constant" of integration: when you integrate with respect to $x$, anything that does not depend on $x$ acts like a constant.

Key idea

To find $f$ with $\nabla f = \langle P, Q \rangle$:
  • Integrate $P$ with respect to $x$: $f = \int P\,dx + g(y)$, where $g$ is an unknown function of $y$.
  • Differentiate that with respect to $y$ and set it equal to $Q$. This gives $g'(y)$.
  • Integrate to get $g(y)$ (up to a constant) and put it back. Check by computing $\nabla f$.
  • In space, the unknown after the first step is $g(y, z)$; use $Q$ to find how it depends on $y$ (up to a function $h(z)$), then $R$ to find $h$.

Why it works

Why $g$ depends on $y$: $\frac{\partial}{\partial x} g(y) = 0$, so adding any function of $y$ does not change $f_x$.
Why step 2 always works for a conservative field: $g'(y) = Q - \frac{\partial}{\partial y}\int P\,dx$ must not depend on $x$. Its $x$-derivative is $Q_x - \frac{\partial}{\partial y}\frac{\partial}{\partial x}\int P\,dx = Q_x - P_y$, which is ${}0$ exactly when the field passes the test. If you ever find $x$ left in $g'(y)$, the field is not conservative (or there is an arithmetic slip).
Level curves of the potential $f = x^2y + 3x + 2y^2$ from the first example. The field $\mathbf{F} = \langle 2xy + 3, x^2 + 4y \rangle$ is $\nabla f$: at every point it crosses the level curve at a right angle.

Worked examples

Worked example: In the plane

Find a potential for $\mathbf{F} = \langle 2xy + 3, x^2 + 4y \rangle$.
  1. $$f = \int (2xy + 3)\,dx = x^2y + 3x + g(y).$$
  2. $f_y = x^2 + g'(y)$ must equal $x^2 + 4y$, so $g'(y) = 4y$ and $g(y) = 2y^2$.
  3. $f = x^2y + 3x + 2y^2$ (plus any constant). Check: $\nabla f = \langle 2xy + 3, x^2 + 4y \rangle$.

Answer: $x^2y + 3x + 2y^2 + C$

Worked example: With an exponential

Find a potential for $\mathbf{F} = \langle ye^{xy}, xe^{xy} + 2y \rangle$.
  1. $f = \int ye^{xy}\,dx = e^{xy} + g(y)$.
  2. $f_y = xe^{xy} + g'(y) = xe^{xy} + 2y$, so $g'(y) = 2y$, $g = y^2$.
  3. $f = e^{xy} + y^2$.

Answer: $e^{xy} + y^2 + C$

Worked example: In space

Find a potential for $\mathbf{F} = \langle 2x + yz, xz + z^2, xy + 2yz \rangle$.
  1. $$f = \int (2x + yz)\,dx = x^2 + xyz + g(y, z).$$
  2. $f_y = xz + g_y = xz + z^2$, so $g_y = z^2$ and $g = yz^2 + h(z)$.
  3. $f_z = xy + 2yz + h'(z) = xy + 2yz$, so $h' = 0$.
  4. $f = x^2 + xyz + yz^2$.

Answer: $x^2 + xyz + yz^2 + C$

Common mistake

Integrating each component and adding. In the first example, $\int P\,dx = x^2y + 3x$ and $\int Q\,dy = x^2y + 2y^2$. Adding them gives ${}2x^2y + 3x + 2y^2$, whose gradient is $\langle 4xy + 3, 2x^2 + 4y \rangle$, not $\mathbf{F}$: the shared term $x^2y$ was counted twice. A term that appears in several partial integrals belongs in $f$ once. Following the steps above, or checking $\nabla f$ at the end, catches this.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax Calculus Volume 3, 6.3 Conservative Vector Fields
@teddyrookbook GitHub