First-Order: Exact Equations & Substitutions

recovering the potential function

Once the exactness test passes, you know a hidden potential F exists — now you actually have to build it. The recovery procedure is a tidy two-step integration that turns the coefficients M and N back into the single function F whose level curves are the solutions.

Step one: integrate M with respect to x, treating y as a constant. This gives F up to an unknown function of y, because any term depending only on y disappears when you differentiate with respect to x — so write F = integral of M dx + g(y), where g(y) is to be determined. Step two: differentiate this candidate F with respect to y and set it equal to N. The x-dependent parts cancel by exactness, leaving an equation for g'(y); integrate it to get g(y). Assemble the pieces, and F(x, y) = C is your implicit solution. (You may equally start by integrating N with respect to y and recover an unknown function of x — same answer.)

This is the payoff of the whole exact-equation machinery: a deterministic recipe, no guesswork. The only common slip is forgetting that the 'constant' of integration in step one is really a function of the other variable, g(y), not a plain constant — that function is precisely where the y-only behaviour of F lives.

For (2xy) dx + (x^2 + 1) dy = 0: integrate M = 2xy in x to get F = x^2 y + g(y). Differentiate in y: partial F / partial y = x^2 + g'(y); set equal to N = x^2 + 1, so g'(y) = 1, giving g(y) = y. Thus F = x^2 y + y, and the solution is x^2 y + y = C.

Integrate M in x, then fix the leftover function of y by matching N.

After differentiating your candidate F in y, the result MUST contain no leftover x once you subtract N — if some x survives, either the equation was not exact or you made an arithmetic slip. The vanishing of x is exactly what exactness guarantees.

Also called
reconstructing Ffinding F求位勢函數