Tutorials › Calculus III › Common Errors in Potential Recovery

Conservative Fields and Path Independence · Tutorial 795 of 999

Common Errors in Potential Recovery

Practice checking potential recovery carefully, from the integration step to the domain on which the resulting function is valid.

Intermediate 10 min read

What You'll Learn

  • Distinguish an integration constant from an arbitrary function of the variables not integrated.
  • Check a recovered potential by differentiating every component.
  • Use mixed partial derivatives to detect incompatible field components.
  • Understand when integrating one component gives only a local representation.
  • Keep a potential’s domain consistent with the vector field’s domain.
  • Recognize why constants may differ across disconnected components.

Why Potential Recovery Needs Care

A scalar potential can make the work of a conservative vector field easier to compute, but recovering one requires more than integrating a component and writing down a formula. The integration must retain all possible dependence on the other variables, the resulting derivatives must agree with every component of the field, and the function must be defined wherever it is being used.

These checks matter because an expression can look plausible while failing to have the required gradient. A calculation may also succeed locally but not establish one global formula on an arbitrary domain. The safest approach is to state what is being integrated, keep track of the variables, and verify the final gradient on the field’s domain.

Definition: Let \(D\) be an open subset of \(\mathbb{R}^n\), and let \(\mathbf{F}:D\to\mathbb{R}^n\). A scalar function \(\phi:D\to\mathbb{R}\) is a potential for \(\mathbf{F}\) if \(\phi\) is differentiable and \(\nabla\phi=\mathbf{F}\) at every point of \(D\).

Error 1: Treating Integration as if Every Variable Were a Constant

When integrating a component with respect to \(x\), the variables other than \(x\) are held fixed. The result may therefore include an arbitrary function of those other variables. In two dimensions, the form is locally \(\phi(x,y)=\int P(x,y)\,dx+h(y)\); in three dimensions, it is locally \(\phi(x,y,z)=\int P(x,y,z)\,dx+h(y,z)\). The extra term is not necessarily a numerical constant.

These expressions are local unless the domain has suitable structure. For example, they are valid on a small rectangular box, and a single such global representation is valid on a product domain when the \(x\)-slices are intervals and the integral is consistently defined there. On an arbitrary open domain, an \(x\)-slice may have multiple connected components. The integration constants on those separate intervals need not agree, so one function \(h(y,z)\) may not describe the whole domain. In that setting, work locally or keep track of the separate slice components.

Worked Example: Recovering a Two-Variable Potential

Let \(\mathbf{F}(x,y)=(2xy+3,\;x^2+4y)\) on \(\mathbb{R}^2\). Find a potential, retaining the possible dependence on \(y\).

Write \(\nabla\phi=\mathbf{F}\), so \(\phi_x=2xy+3\) and \(\phi_y=x^2+4y\). Integrating the first equation with respect to \(x\), while treating \(y\) as fixed, gives

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

Differentiate this expression with respect to \(y\):

$$ \phi_y=x^2+h'(y). $$

Matching it to the second component requires \(x^2+h'(y)=x^2+4y\). Hence \(h'(y)=4y\), so \(h(y)=2y^2+C\), where \(C\) is a numerical constant. One potential is therefore \(\phi(x,y)=x^2y+3x+2y^2\).

Check both derivatives: \(\phi_x=2xy+3\), and \(\phi_y=x^2+4y\). Thus \(\nabla\phi=\mathbf{F}\) everywhere on \(\mathbb{R}^2\). The arbitrary constant \(C\) can be omitted because it disappears under differentiation.

A common wrong calculation would stop after integrating \(2xy+3\) and write \(\phi=x^2y+3x+C\), with \(C\) a number. Its \(y\)-derivative is only \(x^2\), not \(x^2+4y\). Replacing the number \(C\) by the function \(h(y)\) leaves room to satisfy the second component. This is the key distinction: integrating with respect to one variable leaves an arbitrary function of the variables held fixed.

Error 2: Forgetting to Use Every Component

In three dimensions, integrating one component does not finish the recovery. The undetermined function can depend on two remaining variables, and both other field components must be used to determine it. The resulting potential must then be checked by computing all three partial derivatives.

Worked Example: Determining the Remaining Function in Three Dimensions

Consider \(\mathbf{F}(x,y,z)=(2xy+z^2,\;x^2+2yz,\;2xz+y^2)\) on \(\mathbb{R}^3\). Recover a potential.

Begin with \(\phi_x=2xy+z^2\). Integrating with respect to \(x\) gives

$$ \phi(x,y,z)=x^2y+xz^2+h(y,z). $$

Now use the \(y\)-component. Differentiating with respect to \(y\) gives \(\phi_y=x^2+h_y(y,z)\). Equating this with \(x^2+2yz\) yields \(h_y=2yz\). Integrating with respect to \(y\), with \(z\) held fixed, gives

$$ h(y,z)=y^2z+g(z). $$

The function \(g(z)\) remains because integrating with respect to \(y\) does not determine the dependence on \(z\). Thus \(\phi=x^2y+xz^2+y^2z+g(z)\). Use the third component: \(\phi_z=2xz+y^2+g'(z)\). Matching \(2xz+y^2\) requires \(g'(z)=0\), so \(g\) is constant on this domain. One potential is

$$ \phi(x,y,z)=x^2y+xz^2+y^2z. $$

For verification, \(\phi_x=2xy+z^2\), \(\phi_y=x^2+2yz\), and \(\phi_z=2xz+y^2\). All three components agree with \(\mathbf{F}\) at every point of \(\mathbb{R}^3\).

Ignoring the final component would leave \(g(z)\) undetermined. That omission is not automatically harmless: a nonconstant \(g\) changes \(\phi_z\). A proposed potential is complete only after the remaining component has been checked.

Error 3: Ignoring a Mismatch Between Partial Derivatives

A potential must satisfy all component equations simultaneously. If those equations demand contradictory values for a derivative of the unknown function, then no potential of the assumed regularity exists on the region under consideration. Mixed partial derivatives provide a quick necessary check: if \(\phi\) has continuous second partial derivatives and \(\mathbf{F}=(P,Q)=\nabla\phi\), then \(P_y=\phi_{xy}=\phi_{yx}=Q_x\). In three dimensions, the corresponding mixed partials must agree for each pair of components.

Worked Example: A Failed Recovery Reveals Incompatibility

Test whether \(\mathbf{F}(x,y)=(y,\;2x)\) on \(\mathbb{R}^2\) can have a twice continuously differentiable potential.

If \(\phi_x=y\), integration with respect to \(x\) gives \(\phi=xy+h(y)\). Differentiating with respect to \(y\) gives \(\phi_y=x+h'(y)\). For this to equal the required second component \(2x\), we would need \(h'(y)=x\) for every \((x,y)\) in \(\mathbb{R}^2\). This is impossible because the left side depends only on \(y\), whereas the right side varies with \(x\). For instance, at fixed \(y=0\), the condition would require both \(h'(0)=0\) when \(x=0\) and \(h'(0)=1\) when \(x=1\).

The mixed partial check reaches the same conclusion: \(P_y=1\), while \(Q_x=2\), so they are unequal. Therefore no twice continuously differentiable potential exists on \(\mathbb{R}^2\). The direct recovery attempt and the derivative test agree.

Equal mixed partials are a necessary condition under the stated smoothness assumption, not a universal guarantee of a global potential. Domain conditions can matter, so a matching calculation should not be treated as a complete existence proof without checking the setting. Here, inequality is decisive: it rules out a potential of the stated regularity.

Error 4: Using a Formula Where It Is Not Defined

A potential is a function on the domain \(D\) of the vector field. It need not be defined at points outside \(D\), and a formula that is undefined at a point of \(D\) cannot serve as a potential on all of \(D\). Likewise, an endpoint-potential calculation can only use values at endpoints where the potential is defined. Always identify the domain before differentiating, evaluating, or claiming a global potential.

Worked Example: A Potential on a Punctured Plane

Let \(D=\mathbb{R}^2\setminus\{(0,0)\}\) and \(\mathbf{F}(x,y)=\left(\frac{x}{x^2+y^2},\frac{y}{x^2+y^2}\right)\). Consider \(\phi(x,y)=\frac12\ln(x^2+y^2)\).

The logarithm’s argument is positive at every point of \(D\), so \(\phi\) is defined throughout the field’s domain. Differentiating gives

$$ \phi_x=\frac12\frac{2x}{x^2+y^2} =\frac{x}{x^2+y^2}, \qquad \phi_y=\frac12\frac{2y}{x^2+y^2} =\frac{y}{x^2+y^2}. $$

Thus \(\nabla\phi=\mathbf{F}\) at every point of \(D\). At the origin, however, both the field formula and the potential formula are undefined. This causes no problem: the origin is not in \(D\). It would be an error to evaluate \(\phi(0,0)\), or to claim that this formula defines a potential on all of \(\mathbb{R}^2\).

As a further check, at \((1,0)\) the potential is \(\frac12\ln 1=0\), and the field is \((1,0)\); the derivative formulas above give these field components there. The potential’s validity is determined on \(D\), not at the excluded origin.

Why the Integration Method Works—and Where It Needs Care

The arbitrary function appears because a derivative in one variable cannot detect terms independent of that variable. On a small rectangular box, suppose two differentiable functions \(\phi\) and \(G\) have the same \(x\)-partial derivative. Then \(\partial(\phi-G)/\partial x=0\). For each fixed choice of the other coordinates, the mean value theorem implies that \(\phi-G\) is constant along the interval in the \(x\)-direction. That constant may vary with the other coordinates, which is exactly why it is represented by \(h(y)\) or \(h(y,z)\).

On a general open domain, each fixed-variable slice can have several disjoint intervals. The same argument makes \(\phi-G\) constant on each such interval, but it does not force those constants to coincide across different intervals. Thus one should use the recovery formula locally, or justify a global representation using the structure of the domain. This distinction prevents a local integration argument from being mistaken for a global statement.

1
Choose a component.
Write the relevant partial derivative equation, such as \(\phi_x=P\).
2
Integrate while retaining the other variables.
Add an arbitrary function of the variables held fixed; use a local formula unless global domain conditions justify more.
3
Match the remaining components.
Differentiate the provisional expression in the other variables and solve the resulting equations.
4
Verify and respect the domain.
Differentiate the final candidate in every variable and check equality with the field throughout its stated domain.

Constants and Disconnected Domains

Adding a numerical constant to a potential never changes its gradient. If the domain is connected, any two differentiable potentials for the same field differ by a constant: their difference has zero gradient, and hence is constant on the connected domain. If the domain is disconnected, the difference need only be constant on each connected component; those constants can differ from component to component.

This is another reason not to infer more from an integration step than it establishes. A single integration constant may be adequate on one connected region, but disconnected pieces can carry separate constants. In recovery work, the final gradient check is essential, and any global claim must match the actual domain.

A Reliable Final Check

Before accepting a recovered potential, check these points:

  • Was the integration performed with respect to the stated variable?
  • Was the arbitrary function of the remaining variables retained?
  • Were all components of the vector field used to determine that function?
  • Do the mixed partials agree when the required smoothness assumptions apply?
  • Is the proposed function defined throughout the vector field’s domain?
  • Does differentiating the final expression reproduce every component exactly?

These checks catch different errors. A correct-looking antiderivative can still omit dependence on another variable; compatible partials do not by themselves settle all global domain questions; and a formula outside its domain cannot be used to evaluate the potential there. Careful bookkeeping turns potential recovery into a verifiable calculation rather than a guess.

Check Your Understanding

Use the definitions and checks in this tutorial to answer the following questions.

  1. When integrating \(\phi_x=P(x,y)\) with respect to \(x\), what form can the undetermined term take, and why?
  2. For \(\mathbf{F}=(y,2x)\), what mismatch rules out a twice continuously differentiable potential on \(\mathbb{R}^2\)?
  3. Why can integration in one coordinate give only a local representation on an arbitrary open domain?
  4. What must be checked after finding a candidate potential in three dimensions?
  5. For a field defined on the punctured plane, must its potential be defined at the excluded origin? Explain.