JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Making It Exact: Integrating Factors

Most equations that look like a total differential are not quite exact — but multiplying through by the right factor can rescue them. Here is how to find that factor and turn a stubborn equation back into a hidden potential.

So close to exact, and yet

In the previous guide you learned to spot an exact equation: written as M(x,y) dx + N(x,y) dy = 0, it is exact exactly when the exactness test dM/dy = dN/dx holds, and then the whole left side is the total differential of some hidden potential function F. Solve it and you are done. The trouble is that most equations of this shape fail the test — the cross-partials simply do not match. The equation is *almost* a total differential, but not quite.

Here is the saving idea. The expression M dx + N dy = 0 says the same thing as (mu M) dx + (mu N) dy = 0 for any nonzero function mu — multiplying both sides of an equation by something nonzero never changes its solution curves. So we are free to hunt for a factor mu(x,y) that, when multiplied through, makes the *new* coefficients pass the exactness test. That rescuing factor is an integrating factor: a function whose only job is to convert a not-quite-exact equation into an honestly exact one.

Why the factor is hard in general

Demanding that (mu M) dx + (mu N) dy = 0 be exact means demanding d(mu M)/dy = d(mu N)/dx. Expand both sides with the product rule and you get a relation tying together mu, its partial derivatives, and the partials of M and N. The honest truth: in full generality, finding mu requires solving a *partial* differential equation — and that is usually harder than the original problem, not easier. So the integrating-factor method is not a universal machine; it is a collection of lucky special cases where mu turns out to depend on only one variable.

The good news is that those special cases cover a lot of textbook equations, and they have clean tests. The key quantity is the *mismatch* between the cross-partials, dM/dy - dN/dx. If that mismatch, divided by the right coefficient, simplifies to a function of x alone, an integrating factor mu(x) exists. If instead it simplifies to a function of y alone, an integrating factor mu(y) exists. The mismatch is not just an obstacle — it is the very thing that tells you which factor to reach for.

M dx + N dy = 0   (fails:  dM/dy =/= dN/dx)

if  (dM/dy - dN/dx) / N  =  g(x)  only  ->  mu(x) = e^( integral g(x) dx )
if  (dN/dx - dM/dy) / M  =  h(y)  only  ->  mu(y) = e^( integral h(y) dy )

then  (mu M) dx + (mu N) dy = 0  IS exact
The two everyday tests: a one-variable mismatch hands you a one-variable factor.

The recipe, walked through

Put the two tests together and you have a reliable procedure. The point is to *fail* the exactness test first, then read the failure as a clue, build the factor, multiply, and proceed exactly as in the previous guide — now on an equation that really is exact.

  1. Write the equation as M dx + N dy = 0 and run the exactness test. If dM/dy = dN/dx already, you need no factor — skip ahead and solve it as exact.
  2. Form the mismatch dM/dy - dN/dx. Divide it by N: if the result depends on x only, you have g(x). If not, divide the opposite mismatch by M and check for a function of y only.
  3. Integrate to build the factor: mu(x) = e^(integral g(x) dx), or mu(y) = e^(integral h(y) dy). You only need one valid factor — no arbitrary constant here, since any single mu does the job.
  4. Multiply the whole equation by mu and confirm the new coefficients pass the exactness test (they will, by construction). Then recover the potential F as before; the answer F(x,y) = C is an implicit general solution.

A tiny concrete taste: take y dx + (2x - y e^y) dy = 0. Here M = y, N = 2x - y e^y, so dM/dy = 1 and dN/dx = 2 — not exact, mismatch 1 - 2 = -1. Dividing the opposite mismatch (dN/dx - dM/dy = 1) by M = y gives 1/y, a function of y alone, so mu(y) = e^(integral dy/y) = y. Multiply through by y and the equation becomes exact; from there the potential drops out by the usual integration. The factor did nothing magical — it just rebalanced the coefficients so the cross-partials would finally agree.

What the factor quietly costs

Multiplying by mu is not entirely free of side effects, and honesty about that is part of using the method well. The equation M dx + N dy = 0 and (mu M) dx + (mu N) dy = 0 share the same solution curves *only where mu is nonzero*. Wherever the integrating factor equals zero, you may quietly introduce a spurious solution (a place where the new equation is satisfied trivially) or, conversely, mask a genuine one. It is the same flavour of bookkeeping danger you met when dividing in separation of variables — except here it hides inside a multiplication.

There is also a humbler limit worth stating plainly. An integrating factor of the easy, one-variable kind exists only when the mismatch cooperates; plenty of equations have an integrating factor that depends on *both* x and y, or on a combined variable like xy or x^2 + y^2, and finding those is an art with no guaranteed recipe. And even when no elementary factor exists at all, the equation is not broken — it simply belongs to the vast majority of differential equations that demand numerical or qualitative methods instead of a closed-form potential.

Why this rung matters

Step back and notice the strategy you have just learned, because it recurs everywhere in differential equations: when an equation is not in a form you can solve, *transform it into one that is*. The integrating factor for exactness does this by multiplication; the substitutions coming up in the next guides do it by a clever change of variable. Same philosophy, different lever. Recognizing that an equation is one trick away from a solved form is half the skill of this whole subject.

It also closes a loop. The linear integrating factor you learned earlier and the exact-equation machinery from the last guide were two separate-looking techniques; this guide reveals them as one. A first-order linear equation, rearranged, is just a not-quite-exact equation whose rescuing factor happens to depend on x only — which is precisely why e^(integral p dx) works. Seeing two methods you already trusted turn out to be the same idea is the kind of consolidation that makes the next, harder rungs feel less like a pile of tricks and more like a single coherent craft.