Integrating Factors for Non-Exact Equations

Suppose you meet the differential equation (3xy+y2)+(x2+xy) y′=0(3xy + y^2) + (x^2 + xy)\,y' = 0. You want to solve it in closed form. It is not exact. The mixed partials of its coefficient functions disagree. So the shortcut of writing it as dF=0dF=0 for some potential FF seems unavailable. Yet the equation is not hopeless. Multiplying every term by xx turns it into an exact equation. It then has a genuine potential function, and the solution falls out immediately. This trick, hunting for a multiplier that repairs exactness, is one of the oldest and most useful moves. It belongs to the theory of first-order Ordinary Differential Equations. The idea matters because most first-order equations are not handed to us in exact form. They arise this way from physics, chemistry, and economics. Exactness is a fragile, coordinate-dependent property. Rescaling an equation by any nonvanishing function changes whether it holds. It does this without changing the set of solution curves. This means every non-exact equation with a suitably nice solution structure secretly has an exact companion equation. Finding the rescaling factor — the integrating factor — converts an unsolved problem into a solved one. It does this using nothing but Exact Equations theory. The big picture is that integrating factors form a bridge between two techniques you already know. On one side are separable/exact equations. On the other are Linear First-Order Equations. In fact the standard integrating factor e∫p(x) dxe^{\int p(x)\,dx} for a linear equation is a special case. It is exactly the machinery developed here. Recognizing this unifies what might otherwise look like two unrelated tricks. It becomes a single conceptual method. This article gives the precise definition of an integrating factor. It proves the two classical criteria for when such a factor exists. These criteria cover factors depending on xx alone or yy alone. The article works through the algebra in full. It also shows where the method breaks down. It closes by connecting the search for solutions here to a deeper question. That question asks when solutions exist and are unique at all. This is the subject of Existence and Uniqueness (Picard-Lindelof).

Key takeaways
  • An integrating factor μ\mu is a nonvanishing function that, multiplied through a non-exact equation M dx+N dy=0M\,dx+N\,dy=0, makes it exact.
  • Exactness of μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0 is checked by the same cross-partial condition ∂y(μM)=∂x(μN)\partial_y(\mu M)=\partial_x(\mu N) used for exact equations.
  • A factor μ(x)\mu(x) depending only on xx exists iff (My−Nx)/N(M_y-N_x)/N depends only on xx; a symmetric criterion in yy governs μ(y)\mu(y).
  • Once μ\mu is found, solve by the same potential-function method as for exact equations, applied to μM dx+μN dy=0\mu M\,dx + \mu N\,dy=0.
  • The classical linear-equation integrating factor e∫p dxe^{\int p\,dx} is the special case M=p(x)y−q(x)M=p(x)y-q(x), N=1N=1.
  • Key idea: multiplying by the right function restores a lost potential without changing the solution curves.

Where this lives today

Integrating factors appear constantly wherever a first-order balance law is rescaled to expose a conserved quantity. In classical thermodynamics, the existence of entropy as a state function is, formally, the statement that 1/T1/T is an integrating factor for the inexact differential δQ\delta Q of heat exchanged in a reversible process — Clausius's construction of entropy is a direct physical incarnation of this theorem. In chemical kinetics and population models, integrating factors convert non-exact rate equations into potentials that reveal conserved combinations of concentrations. In electrical circuit theory, the same linear-equation integrating factor e∫p dte^{\int p\,dt} underlies the transient analysis of RL and RC circuits. In numerical analysis and control theory, recognizing an equation as (after multiplication) exact, or as linear, dictates whether closed-form solutions or Lyapunov-type energy functions are available, feeding into stability arguments. In pure mathematics, the exactness criterion generalizes to the statement that a closed differential form is locally exact (Poincaré's lemma) on simply connected domains, linking this elementary technique to algebraic topology and to the theory that will let you rigorously address when solutions to a first-order equation exist and are unique at all, taken up in Existence and Uniqueness (Picard-Lindelof).

Ask the tutor: How do I find an integrating factor when it depends on a combination like xyxy or x2+y2x^2+y^2 rather than on xx or yy alone?

DefinitionIntegrating Factor

Let M(x,y)M(x,y) and N(x,y)N(x,y) be functions continuous with continuous first partial derivatives on an open, simply connected region D⊆R2D\subseteq\mathbb{R}^2, and consider the first-order differential equation

M(x,y) dx+N(x,y) dy=0.M(x,y)\,dx + N(x,y)\,dy = 0 .

A function μ(x,y)\mu(x,y), continuous and nonvanishing on DD, is called an integrating factor for this equation if the equation

μ(x,y)M(x,y) dx+μ(x,y)N(x,y) dy=0\mu(x,y)M(x,y)\,dx + \mu(x,y)N(x,y)\,dy = 0

is exact on DD, meaning there exists a C2C^2 function F(x,y)F(x,y) with Fx=μMF_x=\mu M and Fy=μNF_y=\mu N throughout DD. Because μ\mu is never zero, the original equation M dx+N dy=0M\,dx+N\,dy=0 and the multiplied equation μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0 have identical solution curves (implicit relations y=y(x)y=y(x) or x=x(y)x=x(y) satisfying the differential equation), so solving the exact equation solves the original one.

Intuition

Think of M dx+N dy=0M\,dx+N\,dy=0 as prescribing, at every point of the plane, a direction field: the tangent line to the solution curve through (x,y)(x,y) has slope −M/N-M/N. Multiplying both MM and NN by the same nonzero scalar function μ(x,y)\mu(x,y) does not change this ratio, hence does not change the direction field, hence does not change the solution curves at all. What it can change is whether the vector field (M,N)(M,N) happens to be the gradient of some scalar potential FF. Exactness is really the statement that (M,N)=∇F(M,N)=\nabla F; it is a property of the specific representative (M,N)(M,N) of the direction field, not of the direction field itself. Since rescaling by μ\mu leaves the field of directions alone while adjusting the "steepness" in a position-dependent way, some rescalings turn a non-gradient field into a gradient field even though the underlying geometry — the family of solution curves — never moves. The picture below shows this for the example equation to be solved fully later: the family of curves stays fixed, but the "potential landscape" whose level sets they trace only becomes visible after rescaling.

Figure
Rescaling a vector field does not move its integral curves, only reveals a potential
x y M dx + N dy = 0 (non-exact, same curves) x y μM dx + μN dy = dF = 0 (exact: F = const are these curves)

Central results

TheoremTest for Exactness (prerequisite recalled)

Let M,NM,N be C1C^1 on an open, simply connected region D⊆R2D\subseteq\mathbb{R}^2. The equation M dx+N dy=0M\,dx+N\,dy=0 is exact on DD — that is, M=FxM=F_x, N=FyN=F_y for some C2C^2 function FF — if and only if

My(x,y)=Nx(x,y)for all (x,y)∈D.M_y(x,y) = N_x(x,y) \qquad \text{for all } (x,y)\in D .
Proof

(⇒\Rightarrow) If Fx=MF_x=M and Fy=NF_y=N with F∈C2F\in C^2, then by equality of mixed partials (Clairaut/Schwarz theorem, valid since FF is C2C^2),

My=Fxy=Fyx=Nx.M_y = F_{xy} = F_{yx} = N_x .

(⇐\Leftarrow) Suppose My=NxM_y=N_x on DD. Fix a basepoint (x0,y0)∈D(x_0,y_0)\in D and, using simple connectivity, define

F(x,y)=∫x0xM(t,y0) dt+∫y0yN(x,t) dt.F(x,y) = \int_{x_0}^{x} M(t,y_0)\,dt + \int_{y_0}^{y} N(x,t)\,dt .

This is well-defined because DD is simply connected and (M,N)(M,N) is a C1C^1, hence locally Lipschitz, vector field satisfying the mixed-partial condition; the line integral of (M,N)(M,N) between any two points along any path in DD is path-independent (a standard consequence of Green's theorem applied to any closed loop, since My−Nx≡0M_y-N_x\equiv0 makes the circulation over any simple closed contractible loop vanish), so the particular "staircase" path used above computes the same value as any other path. Differentiate directly:

Fy(x,y)=N(x,y)F_y(x,y) = N(x,y)

immediately from the Fundamental Theorem of Calculus applied to the second integral (the first integral does not depend on yy). For FxF_x, differentiate under the integral sign (justified since NN is C1C^1, so NxN_x is continuous and the integral in tt is over a compact interval):

Fx(x,y)=M(x,y0)+∫y0yNx(x,t) dt=M(x,y0)+∫y0yMy(x,t) dt,F_x(x,y) = M(x,y_0) + \int_{y_0}^{y} N_x(x,t)\,dt = M(x,y_0) + \int_{y_0}^{y} M_y(x,t)\,dt,

using the hypothesis Nx=MyN_x=M_y. By the Fundamental Theorem of Calculus, ∫y0yMy(x,t) dt=M(x,y)−M(x,y0)\int_{y_0}^y M_y(x,t)\,dt = M(x,y)-M(x,y_0), so

Fx(x,y)=M(x,y0)+M(x,y)−M(x,y0)=M(x,y).F_x(x,y) = M(x,y_0) + M(x,y) - M(x,y_0) = M(x,y).

Thus Fx=MF_x=M, Fy=NF_y=N, and FF is C2C^2 since M,NM,N are C1C^1. Hence the equation is exact. ■\blacksquare

∎
TheoremExistence Criteria for Integrating Factors μ(x)\mu(x) and μ(y)\mu(y)

Let M,NM,N be C1C^1 on an open, simply connected region D⊆R2D\subseteq\mathbb{R}^2, with NN nonvanishing on DD.

(a) Suppose the quantity

R(x,y):=My(x,y)−Nx(x,y)N(x,y)R(x,y) := \frac{M_y(x,y)-N_x(x,y)}{N(x,y)}

is, on DD, actually a function of xx alone; write it R(x)R(x). Assume further DD is a union of horizontal strips so that for each xx in the relevant interval II, the fiber {x}×(some interval)\{x\}\times(\text{some interval}) lies in DD (this holds automatically if DD is a rectangle or a vertical strip I×RI\times\mathbb{R}). Then

μ(x)=exp⁡ ⁣(∫R(x) dx)\mu(x) = \exp\!\left(\int R(x)\,dx\right)

is a nonvanishing, C1C^1 integrating factor for M dx+N dy=0M\,dx+N\,dy=0 on DD, and the resulting equation μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0 is exact there.

(b) Symmetrically, if MM is nonvanishing on DD and

S(x,y):=Nx(x,y)−My(x,y)M(x,y)S(x,y):=\frac{N_x(x,y)-M_y(x,y)}{M(x,y)}

depends only on yy (call it S(y)S(y)), with the analogous fibering condition on vertical strips, then

μ(y)=exp⁡ ⁣(∫S(y) dy)\mu(y) = \exp\!\left(\int S(y)\,dy\right)

is a nonvanishing, C1C^1 integrating factor.

Proof

We prove (a); (b) follows by the symmetric argument swapping the roles of x,yx,y, and M,NM,N. Step 1 — reduce exactness of the new equation to an ODE for μ\mu. Suppose μ=μ(x)\mu=\mu(x) is C1C^1 and nonvanishing. Exactness of μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0 requires, by Test for Exactness (stated above), that

∂y(μM)=∂x(μN).\partial_y(\mu M) = \partial_x(\mu N).

Since μ\mu depends only on xx, ∂y(μM)=μ My\partial_y(\mu M) = \mu\,M_y. By the product rule, ∂x(μN)=μ′N+μNx\partial_x(\mu N) = \mu'N + \mu N_x. So exactness holds precisely when

μMy=μ′N+μNx  ⟺  μ′(x)=μ(x)⋅My−NxN.\mu M_y = \mu' N + \mu N_x \iff \mu'(x) = \mu(x)\cdot\frac{M_y-N_x}{N}.

This is a first-order linear (indeed separable) ODE for μ\mu in the single variable xx, provided the right side depends only on xx — which is exactly our hypothesis that R:=(My−Nx)/NR:=(M_y-N_x)/N is a function of xx alone. Step 2 — solve that ODE. The equation μ′=R(x)μ\mu' = R(x)\mu is separable: since μ\mu is required nonvanishing, on any interval where μ>0\mu>0 (WLOG, else replace μ\mu by −μ-\mu, which is also an integrating factor) we may write μ′μ=R(x)\dfrac{\mu'}{\mu}=R(x), i.e. ddxln⁡μ=R(x)\dfrac{d}{dx}\ln\mu = R(x). Integrating,

ln⁡μ(x)=∫R(x) dx+C,\ln \mu(x) = \int R(x)\,dx + C,

and exponentiating gives the one-parameter family μ(x)=C1exp⁡(∫R(x) dx)\mu(x) = C_1\exp\left(\int R(x)\,dx\right). Since only a single integrating factor is needed (any positive multiple of an integrating factor is again an integrating factor, as scaling by a nonzero constant does not affect exactness), take C1=1C_1=1:

μ(x)=exp⁡ ⁣(∫R(x) dx).\mu(x) = \exp\!\left(\int R(x)\,dx\right).

This function is manifestly nonvanishing (it is an exponential) and C1C^1 (since RR is continuous, being a quotient of continuous functions with N≠0N\neq0, its antiderivative is C1C^1 and the exponential of a C1C^1 function is C1C^1). Step 3 — verify exactness directly, not merely as a solved ODE. We must check this μ\mu genuinely satisfies ∂y(μM)=∂x(μN)\partial_y(\mu M)=\partial_x(\mu N) pointwise on DD, not just formally. Compute, using μ′(x)=R(x)μ(x)\mu'(x)=R(x)\mu(x) (true by construction, since μ\mu is an antiderivative-exponential of RR):

∂x(μN)−∂y(μM)=μ′N+μNx−μMy=μ(R N+Nx−My).\partial_x(\mu N) - \partial_y(\mu M) = \mu'N + \mu N_x - \mu M_y = \mu\big(R\,N + N_x - M_y\big).

By definition R=(My−Nx)/NR = (M_y - N_x)/N, so RN=My−NxR N = M_y - N_x, and substituting,

μ((My−Nx)+Nx−My)=μ⋅0=0.\mu\big((M_y-N_x) + N_x - M_y\big) = \mu\cdot 0 = 0.

Hence ∂x(μN)=∂y(μM)\partial_x(\mu N)=\partial_y(\mu M) identically on DD, confirming exactness. Step 4 — apply <span class="wiki-link-missing">Test for Exactness</span>. Since μM\mu M and μN\mu N are C1C^1 (products of C1C^1 functions), share continuous mixed partials, satisfy ∂y(μM)=∂x(μN)\partial_y(\mu M)=\partial_x(\mu N), and DD is open and simply connected (with the stated fibering ensuring the potential-construction integral in the proof of that theorem stays inside DD), the sufficiency direction of the exactness test applies verbatim to μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0. Therefore this equation is exact on DD, so μ\mu is a genuine integrating factor. ■\blacksquare

∎
CorollaryRecovering the Linear Equation Integrating Factor

Consider the standard linear first-order equation

y′+p(x)y=q(x),i.e.(p(x)y−q(x)) dx+1 dy=0,y' + p(x) y = q(x), \qquad\text{i.e.}\qquad \big(p(x)y - q(x)\big)\,dx + 1\,dy = 0,

so M(x,y)=p(x)y−q(x)M(x,y)=p(x)y-q(x), N(x,y)=1N(x,y)=1. Then My=p(x)M_y=p(x), Nx=0N_x=0, so

R(x)=My−NxN=p(x),R(x) = \frac{M_y-N_x}{N} = p(x),

which indeed depends only on xx. By part (a) of the theorem, μ(x)=exp⁡(∫p(x) dx)\mu(x)=\exp\left(\int p(x)\,dx\right) is an integrating factor — precisely the familiar formula from Linear First-Order Equations.

Proof

Direct substitution as shown above into the formula of part (a); no further argument is needed since the hypotheses (N=1≠0N=1\neq0 everywhere, RR manifestly a function of xx alone, D=R2D=\mathbb{R}^2 simply connected) are all immediately verified. ■\blacksquare

∎

Worked examples

Example 1 (asymmetric coefficients, μ(x)\mu(x) case). Solve

(3xy+y2) dx+(x2+xy) dy=0.(3xy + y^2)\,dx + (x^2+xy)\,dy = 0 .

Step 1: test exactness. Here M=3xy+y2M=3xy+y^2, N=x2+xyN=x^2+xy. Compute

My=3x+2y,Nx=2x+y.M_y = 3x+2y, \qquad N_x = 2x+y.

Since 3x+2y≠2x+y3x+2y \neq 2x+y in general (they differ by x+yx+y, which is not identically zero), the equation is not exact. Step 2: test for μ(x)\mu(x). Compute

R=My−NxN=(3x+2y)−(2x+y)x2+xy=x+yx(x+y)=1x,R = \frac{M_y-N_x}{N} = \frac{(3x+2y)-(2x+y)}{x^2+xy} = \frac{x+y}{x(x+y)} = \frac{1}{x},

valid wherever x+y≠0x+y\neq0 and x≠0x\neq0; the (x+y)(x+y) factors cancel algebraically as an identity of rational functions, so R=1/xR=1/x holds on the open region D={(x,y):x≠0, x+y≠0}D=\{(x,y): x\neq 0,\ x+y\neq 0\}, and in particular RR depends on xx alone. Good — restrict attention to, say, the simply connected rectangle-like region D={x>0}D=\{x>0\} minus the curve y=−xy=-x; on the component with x>0,y>−xx>0, y>-x this is an open simply connected set, and N=x(x+y)≠0N=x(x+y)\neq0 there. Step 3: build μ\mu.

μ(x)=exp⁡(∫1x dx)=exp⁡(ln⁡x)=x(x>0).\mu(x) = \exp\left(\int \frac1x\,dx\right) = \exp(\ln x) = x \quad (x>0).

Step 4: multiply through.

μM=x(3xy+y2)=3x2y+xy2,μN=x(x2+xy)=x3+x2y.\mu M = x(3xy+y^2) = 3x^2y + xy^2, \qquad \mu N = x(x^2+xy)=x^3+x^2y.

Check exactness of the new equation: ∂y(μM)=3x2+2xy\partial_y(\mu M) = 3x^2+2xy, and ∂x(μN)=3x2+2xy\partial_x(\mu N) = 3x^2+2xy. They agree — exact, as guaranteed. Step 5: find the potential FF. We need Fx=3x2y+xy2F_x = 3x^2y+xy^2. Integrate in xx, holding yy fixed:

F(x,y)=∫(3x2y+xy2) dx=x3y+12x2y2+h(y)F(x,y) = \int (3x^2y+xy^2)\,dx = x^3y + \tfrac12 x^2y^2 + h(y)

for an unknown function h(y)h(y). Differentiate in yy and match to μN\mu N:

Fy=x3+x2y+h′(y)x3+x2y ⇒ h′(y)=0 ⇒ h(y)=const.F_y = x^3 + x^2y + h'(y) \overset{!}{=} x^3+x^2y \ \Rightarrow\ h'(y)=0 \ \Rightarrow\ h(y)=\text{const}.

Step 6: write the implicit solution. Absorbing the constant into the right-hand side,

x3y+12x2y2=C.x^3 y + \tfrac12 x^2 y^2 = C .

This is the general solution, valid on the region where μ=x\mu=x was constructed (and — since the original equation and the multiplied one share solution curves everywhere x≠0x\neq0 — the formula continues to define solution curves for x<0x<0 too, by the same algebra with μ=−x\mu=-x or simply by analytic continuation of the implicit relation). Verification by implicit differentiation. Differentiate x3y+12x2y2=Cx^3y+\tfrac12x^2y^2=C with respect to xx:

3x2y+x3y′+xy2+x2yy′=0  ⟹  (3x2y+xy2)+(x3+x2y)y′=0,3x^2 y + x^3y' + xy^2 + x^2yy' = 0 \implies (3x^2y+xy^2) + (x^3+x^2y)y' = 0,

which is exactly (x3+x2y)y′=−(3x2y+xy2)(x^3+x^2y)y'=-(3x^2y+xy^2), i.e. μM+μNy′=0\mu M+\mu N y'=0 — matching the exact equation derived, and dividing by x≠0x\neq0 recovers the original equation (3xy+y2)+(x2+xy)y′=0(3xy+y^2)+(x^2+xy)y'=0. This confirms the solution.

Example 2 (asymmetric coefficients, μ(y)\mu(y) case, with an initial condition). Solve the initial value problem

(2y2+2y+4x2) dx+(2xy+x) dy=0,y(1)=1.(2y^2 + 2y + 4x^2)\,dx + (2xy+x)\,dy = 0, \qquad y(1)=1.

Step 1: test exactness. M=2y2+2y+4x2M = 2y^2+2y+4x^2, N=2xy+xN=2xy+x.

My=4y+2,Nx=2y+1.M_y = 4y+2, \qquad N_x = 2y+1.

These differ (4y+2≠2y+14y+2\neq 2y+1 unless y=−12y=-\tfrac12), so not exact. Step 2: try μ(x)\mu(x) first.

R=My−NxN=(4y+2)−(2y+1)2xy+x=2y+1x(2y+1)=1x,R=\frac{M_y-N_x}{N} = \frac{(4y+2)-(2y+1)}{2xy+x} = \frac{2y+1}{x(2y+1)} = \frac1x,

provided 2y+1≠02y+1\neq 0. This also cancels to a function of xx alone! So in fact either route works here; to illustrate the μ(y)\mu(y) technique deliberately, we instead check the S(y)S(y) criterion directly, treating this as a demonstration of part (b).

S=Nx−MyM=(2y+1)−(4y+2)2y2+2y+4x2=−2y−12y2+2y+4x2.S = \frac{N_x - M_y}{M} = \frac{(2y+1)-(4y+2)}{2y^2+2y+4x^2} = \frac{-2y-1}{2y^2+2y+4x^2}.

This is not a function of yy alone (the 4x24x^2 term in the denominator prevents cancellation), so the μ(y)\mu(y) route fails here — only μ(x)\mu(x) works for this particular equation. This is instructive: the two criteria are not symmetric in applicability, only in form, and one must check both. Step 3: build μ(x)\mu(x).

μ(x)=exp⁡(∫1x dx)=x.\mu(x) = \exp\left(\int\frac1x\,dx\right) = x.

Step 4: multiply through.

μM=x(2y2+2y+4x2)=2xy2+2xy+4x3,μN=x(2xy+x)=2x2y+x2.\mu M = x(2y^2+2y+4x^2) = 2xy^2+2xy+4x^3, \qquad \mu N = x(2xy+x) = 2x^2y+x^2.

Check: ∂y(μM)=4xy+2x\partial_y(\mu M) = 4xy+2x; ∂x(μN)=4xy+2x\partial_x(\mu N) = 4xy+2x. Exact. Step 5: find potential.

F(x,y)=∫(2xy2+2xy+4x3) dx=x2y2+x2y+x4+h(y).F(x,y) = \int (2xy^2+2xy+4x^3)\,dx = x^2y^2+x^2y+x^4+h(y).

Differentiate in yy: Fy=2x2y+x2+h′(y)F_y = 2x^2y+x^2+h'(y). Match to μN=2x2y+x2\mu N = 2x^2y+x^2: so h′(y)=0h'(y)=0, h≡h\equiv const. Step 6: general solution.

x2y2+x2y+x4=C.x^2y^2 + x^2y + x^4 = C.

Step 7: apply the initial condition. At x=1,y=1x=1,y=1:

1⋅1+1⋅1+1=3=C.1\cdot1 + 1\cdot1 + 1 = 3 = C.

So the solution of the IVP is

x2y2+x2y+x4=3.x^2y^2+x^2y+x^4 = 3.

Sanity check at the initial point: plug x=1,y=1x=1,y=1 into the original equation's slope: M(1,1)=2+2+4=8M(1,1)=2+2+4=8, N(1,1)=2+1=3N(1,1)=2+1=3, so y′(1)=−M/N=−8/3y'(1) = -M/N=-8/3. Differentiating the implicit solution: 2xy2+2x2yy′+2xy+x2y′+4x3=02xy^2+2x^2yy' + 2xy+x^2y'+4x^3=0; at (1,1)(1,1): 2+2y′+2+y′+4=0⇒8+3y′=0⇒y′=−8/32+2y'+2+y'+4=0 \Rightarrow 8+3y'=0 \Rightarrow y'=-8/3. Matches, confirming correctness.

CounterexampleWhy "DD simply connected" and "RR a function of xx alone on all of DD" cannot be dropped

Consider the equation

−y dx+x dy=0on D=R2∖{(0,0)}.-y\,dx + x\,dy = 0 \qquad\text{on } D = \mathbb{R}^2\setminus\{(0,0)\}.

Here M=−yM=-y, N=xN=x, so My=−1M_y=-1, Nx=1N_x=1, not exact. Compute

R=My−NxN=−1−1x=−2x,R = \frac{M_y-N_x}{N} = \frac{-1-1}{x} = \frac{-2}{x},

which is a function of xx alone, formally satisfying the hypothesis of part (a) of the theorem — except at x=0x=0, where N=0N=0 and RR blows up, so DD as given is not the right domain to apply the theorem on directly; one must restrict to {x≠0}\{x\neq0\}, which already fails to be all of R2∖{0}\mathbb{R}^2\setminus\{0\} and, more importantly, is not simply connected once you try to patch the two half-planes back together around the puncture at the origin. Formally proceeding anyway, μ(x)=exp⁡∫(−2/x) dx=x−2\mu(x)=\exp\int(-2/x)\,dx = x^{-2} (for x>0x>0). Multiplying through:

μM dx+μN dy=−yx2 dx+1x dy=0,\mu M\,dx+\mu N\,dy = -\frac{y}{x^2}\,dx + \frac1x\,dy = 0,

which is exact on the simply connected half-plane {x>0}\{x>0\} with potential F=y/xF=y/x, giving solution curves y/x=Cy/x=C, i.e. straight lines through the origin — correct on that half-plane. But the same multiplier μ=x−2\mu=x^{-2} is undefined at x=0x=0 and cannot be continued across the puncture to give one single global potential on all of {x≠0,y arbitrary}∖{x=0}\{x\ne 0, y\ \text{arbitrary}\}\setminus\{x=0\} consistently with both half-planes simultaneously, because the two half-plane potentials y/xy/x (for x>0x>0) and y/xy/x (for x<0x<0) do not glue into a function that is even continuous at x=0x = 0 (indeed FF is not even defined there) — reflecting the fact that the vector field (M,N)=(−y,x)(M,N)=(-y,x) has nonzero circulation (∮M dx+N dy=2π≠0\oint M\,dx+N\,dy = 2\pi\neq0 around the origin), an obstruction that exists precisely because the natural domain R2∖{0}\mathbb{R}^2\setminus\{0\} is not simply connected. Dropping the simple-connectivity hypothesis (or the requirement that NN be nonvanishing throughout the region where you want μ(x)\mu(x) to be defined) allows RR to look like a legitimate function of xx alone while no single global integrating factor and potential actually exist on the full punctured plane. The theorem's construction still produces a valid local integrating factor and solution on each half-plane, illustrating that the hypotheses are not decorative — they guarantee the potential-function integral construction in the exactness theorem is path-independent, which genuinely requires simple connectivity.

Scope, edge cases & common traps

SituationWhat to do
(My−Nx)/N(M_y-N_x)/N depends on both x,yx,yTry (Nx−My)/M(N_x-M_y)/M for a μ(y)\mu(y); if that also fails, more general forms μ(xy)\mu(xy), μ(x2+y2)\mu(x^2+y^2), etc., may be tried, or the equation may require a substitution instead.
N≡0N\equiv 0 on part of the domainThe formula for RR is undefined there; restrict to a subregion where N≠0N\neq0, or use the μ(y)\mu(y) criterion instead.
Domain is not simply connected (e.g. has a puncture or is an annulus)The sufficiency direction of the exactness test can fail globally even though My=NxM_y=N_x holds locally; see the counterexample.
Both μ(x)\mu(x) and μ(y)\mu(y) criteria happen to holdEither produces a valid integrating factor; they need not coincide, but both yield the same family of solution curves.
μ\mu found but vanishes somewhere on the domain of interestExactness fails to be meaningful (division issues) exactly where μ=0\mu=0; since our μ=exp⁡(⋅)\mu=\exp(\cdot) never vanishes, this is not actually an issue for the exponential form, but always double check the derivation used μ≠0\mu\neq0.

The mathematician behind it

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · 18th-century analysis and mechanics, St. Petersburg and Berlin Academies

Euler systematized the method of integrating factors within his broader program of turning first-order differential equations into ones solvable by quadrature (direct integration). His investigations, alongside those of Alexis Clairaut on exact differentials, established the exactness criterion My=NxM_y=N_x as a practical test, and Euler explicitly produced classes of multipliers — including μ(x)\mu(x) and μ(y)\mu(y) of the type proven above — as part of his systematic classification of first-order ODEs in his Institutiones Calculi Integralis.

History
- 1734 — Alexis Clairaut studies conditions for a differential expression M dx+N dyM\,dx+N\,dy to be an exact differential.
- 1739 — Euler begins systematic work on integrating factors for first-order ODEs, seeking multipliers reducing equations to exact form.
- 1768–1770 — Euler's Institutiones Calculi Integralis compiles integrating-factor techniques, including the single-variable criteria, as a central solution method.
- 19th century — the theory is absorbed into the broader Lie-symmetry viewpoint, where integrating factors are reinterpreted via infinitesimal symmetries of the equation.
- 20th century — integrating-factor and exactness concepts generalize to exact differential forms and closed/exact forms in de Rham cohomology on manifolds.
What exactly is an integrating factor, in one sentence?

An integrating factor is a nonvanishing function μ(x,y)\mu(x,y) that, when multiplied through a non-exact equation M dx+N dy=0M\,dx+N\,dy=0, makes the new equation μM dx+μN dy=0\mu M\,dx + \mu N\,dy=0 exact, i.e. makes (μM,μN)(\mu M,\mu N) the gradient of some potential function FF. Because μ\mu is never zero, multiplying by it does not change which curves solve the equation — it only changes whether those curves happen to be the level sets of an explicit function you can write down and solve for. The entire value of the technique is computational: it converts a differential equation without an obvious closed-form solution into one, dF=0dF=0, whose solution is simply F(x,y)=CF(x,y)=C.

Are the criteria for μ(x)\mu(x) and μ(y)\mu(y) the only ways to find an integrating factor?

No. They are the two most commonly taught sufficient conditions, covering a large fraction of textbook exercises, but far from exhaustive. Integrating factors of the form μ(xy)\mu(xy), μ(x/y)\mu(x/y), μ(x2+y2)\mu(x^2+y^2), or μ(x+y)\mu(x+y) each have their own derivable existence criteria, obtained by the same method: substitute the ansatz into the exactness condition and see what ODE for μ\mu results, then check whether that ODE is consistent (i.e., whether its right-hand side really only depends on the claimed single variable). In general, an integrating factor always exists locally near any point where (M,N)≠(0,0)(M,N)\neq(0,0), by the theory underlying Existence and Uniqueness (Picard-Lindelof), but it may not have a closed elementary form.

Why must μ\mu be required to be nonvanishing in the definition?

If μ\mu were allowed to vanish at some points, multiplying the equation by μ\mu there would not be a reversible operation: solutions of M dx+N dy=0M\,dx+N\,dy=0 near a zero of μ\mu might get "erased" or extra spurious solutions (where μ=0\mu=0 identically satisfies the multiplied equation regardless of the true direction field) could be introduced. Requiring μ≠0\mu\neq0 throughout the domain of interest guarantees the multiplied equation μM dx+μN dy=0\mu M\,dx+\mu N\,dy=0 has exactly the same solution curves as the original, since dividing back through by μ\mu recovers M dx+N dy=0M\,dx+N\,dy=0 everywhere.

How does this connect to the linear first-order equation method I already know?

The standard linear equation y′+p(x)y=q(x)y'+p(x)y=q(x) can be rewritten as (p(x)y−q(x))dx+dy=0\big(p(x)y-q(x)\big)dx + dy=0, which is generally not exact. Applying the μ(x)\mu(x) criterion here gives exactly R(x)=p(x)R(x)=p(x), so μ(x)=e∫p dx\mu(x)=e^{\int p\,dx} — the integrating factor taught for linear equations turns out to be a special case of the general theorem proven here, rather than an unrelated ad hoc trick. This unification is one of the chief payoffs of learning the general integrating-factor method.

What happens if neither the μ(x)\mu(x) nor the μ(y)\mu(y) criterion works?

Then this particular theorem does not directly hand you an integrating factor, but the equation may still be solvable by other means: trying integrating factors depending on a specific combination of xx and yy, recognizing the equation as separable or homogeneous after a substitution, or using a series or numerical method. It is also possible that no elementary closed-form integrating factor exists at all, even though a solution curve through any given point still exists locally, guaranteed abstractly by the hypotheses of Existence and Uniqueness (Picard-Lindelof) rather than by any explicit formula.

Does finding an integrating factor guarantee I've found ALL solutions?

It finds the solution curves passing through points where μ\mu, MM, and NN are all well-defined and μ≠0\mu\neq0, N≠0N\neq0 (or M≠0M\neq0 for the μ(y)\mu(y) case), matching the domain restrictions used in the derivation. Solutions can be lost or need separate handling at points where N=0N=0 (vertical tangent lines to the solution curve, which the dy/dxdy/dx formulation cannot see) or where the original coefficient functions themselves are undefined. Always check such boundary or singular points by direct substitution into the original equation, separately from the integrating-factor-derived implicit solution.

Is the choice of integrating factor unique?

No — if μ\mu is one integrating factor and FF its resulting potential, then μ⋅g(F)\mu\cdot g(F) is also an integrating factor for any differentiable function gg with g′≠0g'\neq 0, since g(F)g(F) is then also constant along the same solution curves and the chain rule shows (μg(F))M dx+(μg(F))N dy=g′(F) dF\big(\mu g(F)\big)M\,dx + \big(\mu g(F)\big)N\,dy = g'(F)\,dF is still an exact differential (of ∫g\int g, in effect). The theorem singles out one convenient choice — often the simplest — but it is never the only one.

Before this

Where this leads