Recipe
Test a 2D field for conservativeness and find its potential function
Use when: you have a 2D field \mathbf{F}=(P,Q) and need to know whether it is conservative, and if so, produce an actual potential function f
Goal: either a confirmed potential function f with \nabla f=\mathbf{F}, or a definitive proof that no such f exists
Taught in The 2D test for conservative fields · a later section extends this recipe with more cases
Quick recipe
-
1
Write \mathbf{F}=(P,Q) and label which component is which. The whole test compares a derivative of P against a derivative of Q, so mixing them up ruins every step that follows.
Example
Take \mathbf{F}=(3x^2+2y,\ 2x+3y^2). Then P=3x^2+2y and Q=2x+3y^2.
Why: the cross-partials test and the potential-function construction both need P and Q correctly labeled before a single derivative is taken.
-
2
Differentiate P with respect to y and Q with respect to x, then check whether the two results agree for every (x,y), not just at one point.
Example
P_y = \dfrac{\partial}{\partial y}(3x^2+2y) = 2, and Q_x = \dfrac{\partial}{\partial x}(2x+3y^2) = 2. They match, and they match for every (x,y).
- P_y=Q_x everywhere — \mathbf{F} is conservative; continue to Step 3 to build f.
- P_y\ne Q_x somewhere — \mathbf{F} is NOT conservative; stop here, since no potential function exists.
Why: this is exactly the theorem's cross-partials test, and a single point of disagreement already rules out a potential function.
-
3
Treat y as a constant and integrate P in x. The result is a first draft of f, plus an unknown function g(y) standing in for anything this integration could not see.
Example
f(x,y) = \displaystyle\int (3x^2+2y)\,dx = x^3+2xy+g(y).
Why: this recovers all of f's x-dependence directly from P=f_x, leaving only its y-only piece still missing.
-
4
Differentiate the Step 3 result with respect to y, set it equal to Q, and solve for g'(y).
Example
f_y = 2x+g'(y). Setting this equal to Q=2x+3y^2 gives g'(y)=3y^2.
Why: differentiating in y cancels every part of f that Step 3 already found, isolating exactly the piece still missing.
-
5
Integrate g'(y) with respect to y to get g(y), substitute it back into the Step 3 draft, and add an arbitrary constant C.
Example
g(y) = \displaystyle\int 3y^2\,dy = y^3+C, so f(x,y) = x^3+2xy+y^3+C.
Why: f and f+C share the identical gradient, so the additive constant is a genuine feature of the answer, not a loose end.
-
6
Differentiate the finished f in both x and y and confirm the results match P and Q exactly.
Example
f_x = 3x^2+2y = P and f_y = 2x+3y^2 = Q. Both match.
Why: this catches an algebra slip in the partial integration before f is used downstream, such as in the Fundamental Theorem for line integrals.
Common mistakes
- Comparing P_y and Q_y, or P_x and Q_x, instead of P_y against Q_x.
- Forgetting the unknown g(y) after the first integration and treating that partial result as the whole potential function.
- Skipping the final check and carrying an algebra mistake into a later computation that assumes f is correct.
- Checking only f_x=P and never verifying f_y=Q as well.