A "fixer" you multiply through a stubborn ODE to make it exact, so you can solve it by potential functions.
We write a first-order ODE in differential form :
M ( x , y ) d x + N ( x , y ) d y = 0. M(x,y)\,dx + N(x,y)\,dy = 0. M ( x , y ) d x + N ( x , y ) d y = 0.
Definition Exact equation
The equation M d x + N d y = 0 M\,dx + N\,dy = 0 M d x + N d y = 0 is exact if there exists a potential F ( x , y ) F(x,y) F ( x , y ) with
∂ F ∂ x = M , ∂ F ∂ y = N . \frac{\partial F}{\partial x} = M, \qquad \frac{\partial F}{\partial y} = N. ∂ x ∂ F = M , ∂ y ∂ F = N .
Then the solution is simply F ( x , y ) = C F(x,y) = C F ( x , y ) = C .
Intuition WHY exactness matters
If M d x + N d y M\,dx + N\,dy M d x + N d y is the total differential d F = F x d x + F y d y dF = F_x\,dx + F_y\,dy d F = F x d x + F y d y , then the ODE says
d F = 0 dF = 0 d F = 0 , i.e. F F F doesn't change along solution curves — so F = C F = C F = C . Solving the ODE collapses
to finding F F F . The whole game is: can I write the left side as a perfect differential?
The exactness test. Since mixed partials commute (F x y = F y x F_{xy} = F_{yx} F x y = F y x for smooth F F F ):
M y = F x y = F y x = N x . M_y = F_{xy} = F_{yx} = N_x. M y = F x y = F y x = N x .
So:
Exact ⟺ M y = N x . \boxed{\text{Exact} \iff M_y = N_x.} Exact ⟺ M y = N x .
If M y ≠ N x M_y \neq N_x M y = N x , there is no F F F and we're stuck... unless we multiply the whole equation by a
function μ ( x , y ) \mu(x,y) μ ( x , y ) , the integrating factor :
μ M d x + μ N d y = 0. \mu M\,dx + \mu N\,dy = 0. μ M d x + μ N d y = 0.
This has the SAME solution curves (we only multiplied by something nonzero), but now we demand it
be exact.
Intuition WHY this is allowed
Multiplying M d x + N d y = 0 M\,dx+N\,dy=0 M d x + N d y = 0 by μ ≠ 0 \mu\neq 0 μ = 0 does not change where the expression equals zero — the
solution set is identical. We're free to pick μ \mu μ to make the form nice (exact), the way you
multiply a fraction by a clever 1 1 1 .
Exactness of the multiplied equation requires
∂ ∂ y ( μ M ) = ∂ ∂ x ( μ N ) . \frac{\partial}{\partial y}(\mu M) = \frac{\partial}{\partial x}(\mu N). ∂ y ∂ ( μ M ) = ∂ x ∂ ( μ N ) .
Expand both sides with the product rule:
μ y M + μ M y = μ x N + μ N x . \mu_y M + \mu M_y = \mu_x N + \mu N_x. μ y M + μ M y = μ x N + μ N x .
Rearrange:
N μ x − M μ y = μ ( M y − N x ) \boxed{\;N\,\mu_x - M\,\mu_y = \mu\,(M_y - N_x)\;} N μ x − M μ y = μ ( M y − N x )
This is a PDE for μ \mu μ — generally as hard as the original ODE! The trick is to guess that
μ \mu μ depends on only one variable, which kills a term.
Then μ y = 0 \mu_y = 0 μ y = 0 , μ x = μ ′ \mu_x = \mu' μ x = μ ′ . The PDE becomes
N μ ′ = μ ( M y − N x ) ⟹ μ ′ μ = M y − N x N . N\,\mu' = \mu\,(M_y - N_x) \implies \frac{\mu'}{\mu} = \frac{M_y - N_x}{N}. N μ ′ = μ ( M y − N x ) ⟹ μ μ ′ = N M y − N x .
Intuition WHY one variable
For μ ( x ) \mu(x) μ ( x ) to exist, the right side must depend on x x x alone — otherwise μ ′ μ \frac{\mu'}{\mu} μ μ ′
(a function of x x x ) would have to equal something with y y y in it. That's the consistency check.
By symmetry (μ x = 0 \mu_x=0 μ x = 0 ):
− M μ ′ = μ ( M y − N x ) ⟹ μ ′ μ = N x − M y M . -M\,\mu' = \mu(M_y - N_x) \implies \frac{\mu'}{\mu} = \frac{N_x - M_y}{M}. − M μ ′ = μ ( M y − N x ) ⟹ μ μ ′ = M N x − M y .
Recall Forecast-then-verify
Before computing μ \mu μ : predict which case applies by checking whether M y − N x N \frac{M_y-N_x}{N} N M y − N x loses
its y y y 's, or N x − M y M \frac{N_x-M_y}{M} M N x − M y loses its x x x 's. One of them usually does in textbook problems.
Write as M d x + N d y = 0 M\,dx + N\,dy = 0 M d x + N d y = 0 .
Test: is M y = N x M_y = N_x M y = N x ? If yes, skip to step 5.
Compute M y − N x N \frac{M_y-N_x}{N} N M y − N x → function of x x x ? Use μ ( x ) \mu(x) μ ( x ) . Else compute
N x − M y M \frac{N_x-M_y}{M} M N x − M y → function of y y y ? Use μ ( y ) \mu(y) μ ( y ) .
Multiply through by μ \mu μ . Now exact.
Find F F F : integrate F x = M ∗ F_x=M^* F x = M ∗ in x x x , add unknown ϕ ( y ) \phi(y) ϕ ( y ) , differentiate in y y y , match N ∗ N^* N ∗ .
Solution: F ( x , y ) = C F(x,y)=C F ( x , y ) = C .
Solve ( 3 x y + y 2 ) d x + ( x 2 + x y ) d y = 0. (3xy + y^2)\,dx + (x^2 + xy)\,dy = 0. ( 3 x y + y 2 ) d x + ( x 2 + x y ) d y = 0.
Here M = 3 x y + y 2 M = 3xy + y^2 M = 3 x y + y 2 , N = x 2 + x y N = x^2 + xy N = x 2 + x y .
M y = 3 x + 2 y M_y = 3x + 2y M y = 3 x + 2 y , N x = 2 x + y \;N_x = 2x + y N x = 2 x + y . Why? Differentiate M M M w.r.t. y y y , N N N w.r.t. x x x .
Not exact since 3 x + 2 y ≠ 2 x + y 3x+2y \neq 2x+y 3 x + 2 y = 2 x + y .
M y − N x N = ( 3 x + 2 y ) − ( 2 x + y ) x 2 + x y = x + y x ( x + y ) = 1 x . \frac{M_y-N_x}{N} = \frac{(3x+2y)-(2x+y)}{x^2+xy} = \frac{x+y}{x(x+y)} = \frac{1}{x}. N M y − N x = x 2 + x y ( 3 x + 2 y ) − ( 2 x + y ) = x ( x + y ) x + y = x 1 .
Why this step? The numerator factors and cancels the ( x + y ) (x+y) ( x + y ) , leaving a pure-x x x function — so
Case 1 works.
μ = exp ( ∫ 1 x d x ) = e ln x = x . \mu = \exp\!\left(\int \tfrac{1}{x}\,dx\right) = e^{\ln x} = x. μ = exp ( ∫ x 1 d x ) = e l n x = x .
Multiply: M ∗ = 3 x 2 y + x y 2 M^* = 3x^2 y + xy^2 M ∗ = 3 x 2 y + x y 2 , N ∗ = x 3 + x 2 y N^* = x^3 + x^2 y N ∗ = x 3 + x 2 y .
Check exact: M y ∗ = 3 x 2 + 2 x y M^*_y = 3x^2 + 2xy M y ∗ = 3 x 2 + 2 x y , N x ∗ = 3 x 2 + 2 x y N^*_x = 3x^2 + 2xy N x ∗ = 3 x 2 + 2 x y . ✓
Find F F F : F = ∫ ( 3 x 2 y + x y 2 ) d x = x 3 y + 1 2 x 2 y 2 + ϕ ( y ) . F = \int (3x^2y + xy^2)\,dx = x^3 y + \tfrac12 x^2 y^2 + \phi(y). F = ∫ ( 3 x 2 y + x y 2 ) d x = x 3 y + 2 1 x 2 y 2 + ϕ ( y ) .
Why ϕ ( y ) \phi(y) ϕ ( y ) ? Integration "constant" w.r.t. x x x may depend on y y y .
F y = x 3 + x 2 y + ϕ ′ ( y ) F_y = x^3 + x^2 y + \phi'(y) F y = x 3 + x 2 y + ϕ ′ ( y ) must equal N ∗ = x 3 + x 2 y N^* = x^3 + x^2 y N ∗ = x 3 + x 2 y , so ϕ ′ ( y ) = 0 \phi'(y)=0 ϕ ′ ( y ) = 0 .
x 3 y + 1 2 x 2 y 2 = C . \boxed{x^3 y + \tfrac12 x^2 y^2 = C.} x 3 y + 2 1 x 2 y 2 = C .
Solve y d x + ( 2 x − y e y ) d y = 0. y\,dx + (2x - ye^y)\,dy = 0. y d x + ( 2 x − y e y ) d y = 0.
M = y M = y M = y , N = 2 x − y e y N = 2x - ye^y N = 2 x − y e y . M y = 1 M_y = 1 M y = 1 , N x = 2 N_x = 2 N x = 2 . Not exact.
Try Case 1: M y − N x N = − 1 2 x − y e y \frac{M_y-N_x}{N} = \frac{-1}{2x-ye^y} N M y − N x = 2 x − y e y − 1 — still has x x x . ✗
Try Case 2: N x − M y M = 2 − 1 y = 1 y \frac{N_x-M_y}{M} = \frac{2-1}{y} = \frac{1}{y} M N x − M y = y 2 − 1 = y 1 — pure y y y . ✓
μ = exp ( ∫ 1 y d y ) = y . \mu = \exp\!\left(\int \tfrac1y\,dy\right) = y. μ = exp ( ∫ y 1 d y ) = y .
Multiply: M ∗ = y 2 M^* = y^2 M ∗ = y 2 , N ∗ = 2 x y − y 2 e y N^* = 2xy - y^2 e^y N ∗ = 2 x y − y 2 e y .
Check: M y ∗ = 2 y M^*_y = 2y M y ∗ = 2 y , N x ∗ = 2 y N^*_x = 2y N x ∗ = 2 y . ✓
F = ∫ y 2 d x = x y 2 + ϕ ( y ) F = \int y^2\,dx = x y^2 + \phi(y) F = ∫ y 2 d x = x y 2 + ϕ ( y ) . Then F y = 2 x y + ϕ ′ ( y ) = 2 x y − y 2 e y F_y = 2xy + \phi'(y) = 2xy - y^2 e^y F y = 2 x y + ϕ ′ ( y ) = 2 x y − y 2 e y , so
ϕ ′ ( y ) = − y 2 e y \phi'(y) = -y^2 e^y ϕ ′ ( y ) = − y 2 e y . Integrate by parts: ϕ = − e y ( y 2 − 2 y + 2 ) \phi = -e^y(y^2 - 2y + 2) ϕ = − e y ( y 2 − 2 y + 2 ) .
x y 2 − e y ( y 2 − 2 y + 2 ) = C . \boxed{xy^2 - e^y(y^2 - 2y + 2) = C.} x y 2 − e y ( y 2 − 2 y + 2 ) = C .
Common mistake Forgetting to re-test exactness after multiplying
Why it feels right: "I used the formula for μ \mu μ , so it must be exact now." The fix: the
formula only works if the ratio was genuinely a single-variable function. Always verify
M y ∗ = N x ∗ M^*_y = N^*_x M y ∗ = N x ∗ — a quick sanity check that catches arithmetic slips.
x x x -formula even when the ratio still contains y y y
Why it feels right: you blindly compute M y − N x N \frac{M_y-N_x}{N} N M y − N x first. The fix: if that ratio has
a leftover y y y , μ ( x ) \mu(x) μ ( x ) cannot exist; switch to the y y y -test N x − M y M \frac{N_x-M_y}{M} M N x − M y . The sign
flips in the numerator — don't carry the old one.
∫ M d x \int M\,dx ∫ M d x "constant" as a true constant
Why it feels right: in single-variable integration the constant is just C C C . The fix: here the
other variable is frozen, so the "constant" is any function ϕ ( y ) \phi(y) ϕ ( y ) . Dropping it loses the
y y y -only piece of F F F (e.g. the − e y ( … ) -e^y(\dots) − e y ( … ) term above).
Common mistake Sign of the
y y y -case numerator
μ ′ μ = N x − M y M \frac{\mu'}{\mu} = \frac{N_x - M_y}{M} μ μ ′ = M N x − M y , not M y − N x M \frac{M_y-N_x}{M} M M y − N x . Why it feels right:
mirroring the x x x -case. The fix: it comes from − M μ ′ = μ ( M y − N x ) -M\mu' = \mu(M_y-N_x) − M μ ′ = μ ( M y − N x ) ; the minus moves over.
M y over N , N ext over M "
x x x -factor uses M y − N x N \dfrac{M_y-N_x}{N} N M y − N x (divide by N , want function of x =the other letter).
y y y -factor uses N x − M y M \dfrac{N_x-M_y}{M} M N x − M y (divide by M , flip the sign).
Recall Feynman: explain to a 12-year-old
Imagine a hill where height is F F F . Walking so your height never changes means walking along a
contour line — that's the solution. Some "walking rules" (M d x + N d y M\,dx+N\,dy M d x + N d y ) don't quite trace a real
hill's contour. The integrating factor μ \mu μ is like putting on magic glasses that rescale the map
until the rule does match a real hill. Once it matches, you just read off the contour:
"stay at height C C C ."
When is M d x + N d y = 0 M\,dx+N\,dy=0 M d x + N d y = 0 exact? When
M y = N x M_y = N_x M y = N x (then a potential
F F F with
F x = M , F y = N F_x=M,F_y=N F x = M , F y = N exists).
Why does exactness give solution F = C F=C F = C ? Because
M d x + N d y = d F M\,dx+N\,dy = dF M d x + N d y = d F , and
d F = 0 dF=0 d F = 0 means
F F F is constant along solutions.
PDE that the integrating factor μ \mu μ must satisfy? N μ x − M μ y = μ ( M y − N x ) N\mu_x - M\mu_y = \mu(M_y - N_x) N μ x − M μ y = μ ( M y − N x ) .
Condition for an x x x -only integrating factor? M y − N x N \frac{M_y-N_x}{N} N M y − N x is a function of
x x x alone.
Formula for the x x x -only factor? μ ( x ) = exp ∫ M y − N x N d x \mu(x)=\exp\!\int \frac{M_y-N_x}{N}\,dx μ ( x ) = exp ∫ N M y − N x d x .
Condition and formula for a y y y -only factor? N x − M y M \frac{N_x-M_y}{M} M N x − M y is a function of
y y y alone;
μ ( y ) = exp ∫ N x − M y M d y \mu(y)=\exp\!\int \frac{N_x-M_y}{M}\,dy μ ( y ) = exp ∫ M N x − M y d y .
Why is multiplying by μ \mu μ legitimate? It doesn't change where the expression is zero (same solution curves), only the form.
After multiplying by μ \mu μ , what must you do? Re-verify
M y ∗ = N x ∗ M^*_y=N^*_x M y ∗ = N x ∗ , then find
F F F by partial integration.
N mu_x - M mu_y = mu M_y-N_x
Intuition Hinglish mein samjho
Dekho, ODE ko hum aksar likhte hain M d x + N d y = 0 M\,dx + N\,dy = 0 M d x + N d y = 0 form mein. Agar yeh "exact" hai — matlab
M y = N x M_y = N_x M y = N x — toh ek potential function F F F milta hai jiska F x = M F_x=M F x = M aur F y = N F_y=N F y = N , aur answer seedha
F = C F=C F = C aa jaata hai. Problem tab aati hai jab equation exact nahi hoti. Tab hum poori equation ko ek
clever function μ \mu μ (integrating factor) se multiply karte hain taaki woh exact ban jaaye. Yeh
allowed hai kyunki μ \mu μ se multiply karne par solution curves same rehti hain, sirf form badalta hai.
μ \mu μ nikaalne ka rule: pehle M y − N x N \frac{M_y-N_x}{N} N M y − N x check karo — agar ismein sirf x x x bacha (koi y y y
nahi), toh μ ( x ) = e ∫ ( ⋯ ) d x \mu(x)=e^{\int (\cdots)dx} μ ( x ) = e ∫ ( ⋯ ) d x . Agar usmein y y y reh gaya, toh doosra check karo:
N x − M y M \frac{N_x-M_y}{M} M N x − M y — agar yeh sirf y y y ka function hai toh μ ( y ) = e ∫ ( ⋯ ) d y \mu(y)=e^{\int(\cdots)dy} μ ( y ) = e ∫ ( ⋯ ) d y . Dhyaan rakho
y y y -wale case mein numerator ka sign palat jaata hai (N x − M y N_x-M_y N x − M y ), yeh students bahut galti karte hain.
Multiply karne ke baad ek baar dobara M y ∗ = N x ∗ M^*_y = N^*_x M y ∗ = N x ∗ verify zaroor karo — yeh chhota sa check tumhari
arithmetic galtiyaan pakad leta hai. Phir F F F nikaalo: M ∗ M^* M ∗ ko x x x mein integrate karke ek extra
ϕ ( y ) \phi(y) ϕ ( y ) jodo (kyunki x x x -integration ka "constant" actually y y y ka function ho sakta hai), phir
F y F_y F y ko N ∗ N^* N ∗ se match karke ϕ ( y ) \phi(y) ϕ ( y ) nikaalo. Bas, answer F = C F=C F = C . Intuition: μ \mu μ ek magic glasses
hai jo tilted map ko proper hill bana deta hai, jiske contours hi solution curves hain.