Tutorials › Calculus III › Finding Potentials by Integrating the Second Component

Conservative Fields and Path Independence · Tutorial 783 of 999

Finding Potentials by Integrating the Second Component

Recover a planar potential from its second component, then use the first component to determine the remaining function of x and verify the result.

Intermediate 10 min read

What You'll Learn

  • Write the gradient equations for a planar potential.
  • Integrate the second component with respect to y while treating x as constant.
  • Explain why the integration “constant” may be a function of x.
  • Match the x-derivative of the candidate potential to the first component.
  • Check a recovered potential by differentiating both components.
  • Recognize when matching the first component fails.

Why Integrate the Second Component?

A planar vector field has two components, and a potential function must produce both of them through its partial derivatives. If one component is especially straightforward to integrate with respect to its variable, it can be efficient to start there. This tutorial develops the method of starting with the second component: integrate with respect to \(y\), allow the missing part to depend on \(x\), and then use the first component to determine that part.

The method is not simply “integrate and stop.” An antiderivative of the second component determines the potential only up to a function that is constant in \(y\). That function may vary with \(x\), and the first component supplies the information needed to find it.

Definition: For a planar vector field \(\mathbf{F}(x,y)=\langle P(x,y),Q(x,y)\rangle\), a potential function is a scalar function \(\phi(x,y)\) such that \(\nabla\phi=\mathbf{F}\). Equivalently, it satisfies \(\phi_x=P\) and \(\phi_y=Q\) throughout its domain.

The Recovery Procedure

Suppose the field is defined on a rectangle, and we seek a potential there. The equation \(\phi_y=Q\) says that, with \(x\) held fixed, the potential changes with \(y\) according to \(Q\). Integrating in \(y\) gives a candidate expression, but it cannot determine terms that do not change as \(y\) changes.

$$ \phi(x,y)=\int_{y_0}^{y} Q(x,t)\,dt+g(x), $$

Here \(y_0\) is a fixed reference value, \(t\) is the integration variable, and \(g(x)\) is an unknown function. The use of \(t\) makes clear that \(x\) is held fixed during the integration. A term depending only on \(x\) has zero partial derivative with respect to \(y\), so it is not detected by integrating \(Q\).

Next, differentiate this expression with respect to \(x\) and require the result to equal \(P\). If \(Q_x\) is continuous, differentiation under the integral sign gives the following matching equation:

$$ \phi_x(x,y) = \int_{y_0}^{y} Q_x(x,t)\,dt+g'(x) = P(x,y). $$

The equation determines \(g'(x)\) when the difference between \(P(x,y)\) and the integral term depends only on \(x\). Integrating that expression in \(x\) gives \(g(x)\), up to an additive constant. The resulting candidate must then be checked by computing both partial derivatives.

Method: Integrate \(Q\) with respect to \(y\), write the undetermined term as \(g(x)\), differentiate the candidate with respect to \(x\), and match that derivative to \(P\). A successful match gives a candidate potential; verify that its \(x\)- and \(y\)-derivatives are exactly the two components of the field.

Why the Unknown Term Depends on x

For each fixed \(x\), the equation \(\phi_y=Q\) is an ordinary antiderivative problem in the variable \(y\). Two functions with the same \(y\)-derivative can differ by a quantity that does not vary with \(y\). Since \(x\) is held fixed in this integration, that quantity may take a different value for each \(x\). Thus it is generally a function \(g(x)\), not just a numerical constant.

More formally, define \(A(x,y)=\int_{y_0}^{y}Q(x,t)\,dt\). The fundamental theorem of calculus gives \(A_y(x,y)=Q(x,y)\). If \(\phi_y=Q\) as well, then \((\phi-A)_y=0\). On a rectangle, each vertical slice is an interval, so a function whose \(y\)-derivative is zero is constant along that slice. Its value can vary from one vertical slice to another; therefore \(\phi-A=g(x)\). This justifies the form used in the method.

Worked Example: A Polynomial Field

Find a potential for \(\mathbf{F}(x,y)=\langle 2xy+3,\ x^2+4y\rangle\) on \(\mathbb{R}^2\), using the second component first.

Here \(Q(x,y)=x^2+4y\). Integrate with respect to \(y\), treating \(x\) as constant:

$$ \phi(x,y)=\int (x^2+4y)\,dy =x^2y+2y^2+g(x). $$

Differentiate this candidate with respect to \(x\):

$$ \phi_x(x,y)=2xy+g'(x). $$

Match it to \(P(x,y)=2xy+3\). Subtract \(2xy\) from both sides to obtain \(g'(x)=3\), so \(g(x)=3x+C\), where \(C\) is a constant. A potential is therefore \(\phi(x,y)=x^2y+2y^2+3x+C\).

Check both components:

$$ \phi_x=2xy+3=P(x,y), \qquad \phi_y=x^2+4y=Q(x,y). $$

Both partial derivatives reproduce the given field, so the candidate is verified.

Worked Examples

Worked Example: An Exponential-Trigonometric Field

Find a potential for \(\mathbf{F}(x,y)=\langle e^y\cos x,\ e^y\sin x\rangle\) on \(\mathbb{R}^2\).

Integrate the second component \(Q(x,y)=e^y\sin x\) with respect to \(y\). The factor \(\sin x\) is constant during this integration:

$$ \phi(x,y)=\int e^y\sin x\,dy =e^y\sin x+g(x). $$

Differentiate with respect to \(x\), then match the first component:

$$ \phi_x=e^y\cos x+g'(x) =e^y\cos x. $$

Subtracting \(e^y\cos x\) gives \(g'(x)=0\), so \(g\) is constant. Take \(\phi(x,y)=e^y\sin x\), with any additive constant if desired. Verify:

$$ \phi_x=e^y\cos x=P(x,y), \qquad \phi_y=e^y\sin x=Q(x,y). $$

The two derivatives agree with the field components, confirming the potential.

Worked Example: Matching Determines a Nonconstant Function

Find a potential for \(\mathbf{F}(x,y)=\langle 3y^2+2x,\ 6xy+3y^2\rangle\) on \(\mathbb{R}^2\).

Start with \(Q(x,y)=6xy+3y^2\). Integrating with respect to \(y\) gives

$$ \phi(x,y)=3xy^2+y^3+g(x). $$

Differentiate with respect to \(x\):

$$ \phi_x=3y^2+g'(x). $$

The first component is \(P(x,y)=3y^2+2x\). Matching gives \(g'(x)=2x\), hence \(g(x)=x^2+C\). A potential is \(\phi(x,y)=3xy^2+y^3+x^2+C\).

Differentiate in both variables to check the result:

$$ \phi_x=3y^2+2x=P(x,y), \qquad \phi_y=6xy+3y^2=Q(x,y). $$

Both components match. In this example, the first component reveals a genuinely nonconstant term, \(x^2\), that integration of \(Q\) alone would not have supplied.

When Matching Fails

The procedure can also show that the proposed field cannot have a potential on a given rectangle. After integrating \(Q\), the expression required for \(g'(x)\) must depend on \(x\) alone. If it still depends on \(y\), no choice of \(g(x)\) can make the first component match at every point of the rectangle. This conclusion follows directly from the two equations a potential must satisfy; it is not a matter of choosing a different integration constant.

Worked Example: A Match That Cannot Be Made

Determine whether \(\mathbf{F}(x,y)=\langle y^2,\ xy\rangle\) has a potential on \(\mathbb{R}^2\) using the recovery equations.

Integrate \(Q(x,y)=xy\) with respect to \(y\):

$$ \phi(x,y)=\frac{1}{2}xy^2+g(x). $$

Differentiate with respect to \(x\):

$$ \phi_x(x,y)=\frac{1}{2}y^2+g'(x). $$

For this to equal \(P(x,y)=y^2\), we would need

$$ g'(x)=\frac{1}{2}y^2. $$

The left side depends only on \(x\), while the right side varies with \(y\). For example, at the same \(x\), setting \(y=0\) requires \(g'(x)=0\), whereas setting \(y=2\) requires \(g'(x)=2\). These requirements cannot both hold. Therefore there is no potential on \(\mathbb{R}^2\).

A Common Mistake: Using a Numerical Constant

A frequent error is to integrate \(Q\), add a numerical constant, and assume that the result is the complete potential. A numerical constant accounts for the overall additive freedom in a potential, but it cannot replace the possibly nonconstant function \(g(x)\).

For instance, in the polynomial example above, stopping at \(\phi=x^2y+2y^2+C\) gives

$$ \phi_x=2xy, $$

which does not equal \(P(x,y)=2xy+3\). The missing term is \(3x\), not a numerical constant: its \(x\)-derivative supplies the required \(3\), while its \(y\)-derivative is zero. The correction is to retain \(g(x)\) until the first component determines it.

Takeaway: Integrating \(Q\) determines the \(y\)-dependence of a potential, but leaves its \(x\)-only part undetermined. Matching \(\phi_x\) to \(P\) determines that part—or reveals that no such match is possible.

Check Your Understanding

Use the recovery method and check your work by differentiating wherever a potential is requested.

  1. For \(\mathbf{F}(x,y)=\langle 4x,\ 2y\rangle\), integrate the second component first and determine a potential.
  2. Why must the undetermined term after integrating with respect to \(y\) be allowed to depend on \(x\)?
  3. For \(\mathbf{F}(x,y)=\langle 2y,\ 2x\rangle\), find a potential by integrating the second component and matching the first.
  4. After integrating \(Q\), what must be true of the expression for \(g'(x)\) if a potential is to be obtained by this method?
  5. Explain why adding a numerical constant cannot correct a mismatch in \(\phi_x\).