Intuition The big idea in one line
A first-order linear ODE looks messy because the left side is two separate terms d y d x \frac{dy}{dx} d x d y and P ( x ) y P(x)y P ( x ) y . The trick: ==multiply by a cleverly chosen function μ ( x ) \mu(x) μ ( x ) so the left side collapses into a single derivative== d d x ( μ y ) \frac{d}{dx}(\mu y) d x d ( μ y ) . Once it's a single derivative, you just integrate both sides.
Definition Standard (canonical) form
A first-order linear ODE is any equation that can be written as
d y d x + P ( x ) y = Q ( x ) \frac{dy}{dx} + P(x)\,y = Q(x) d x d y + P ( x ) y = Q ( x )
Linear means: y y y and d y d x \frac{dy}{dx} d x d y appear only to the first power , never multiplied together, never inside functions like sin y \sin y sin y or y 2 y^2 y 2 .
P ( x ) P(x) P ( x ) and Q ( x ) Q(x) Q ( x ) are functions of x x x only (or constants).
WHY "standard form" matters: every formula below assumes the coefficient of d y d x \frac{dy}{dx} d x d y is exactly 1 1 1 . If yours is a ( x ) d y d x + … a(x)\frac{dy}{dx}+\dots a ( x ) d x d y + … , divide through by a ( x ) a(x) a ( x ) first .
We want to multiply the whole equation by some function μ ( x ) \mu(x) μ ( x ) :
μ d y d x + μ P y = μ Q . \mu\frac{dy}{dx} + \mu P y = \mu Q. μ d x d y + μ P y = μ Q .
wish would happen?
We wish the left side were exactly the product-rule expansion of d d x ( μ y ) \dfrac{d}{dx}(\mu y) d x d ( μ y ) . Recall:
d d x ( μ y ) = μ d y d x + d μ d x y . \frac{d}{dx}(\mu y) = \mu\frac{dy}{dx} + \frac{d\mu}{dx}\,y. d x d ( μ y ) = μ d x d y + d x d μ y .
Compare term-by-term with our left side μ d y d x + μ P y \mu\frac{dy}{dx} + \mu P\,y μ d x d y + μ P y :
our left side
product rule
μ d y d x \mu\frac{dy}{dx} μ d x d y
μ d y d x \mu\frac{dy}{dx} μ d x d y ✓ (already match)
μ P y \mu P\, y μ P y
d μ d x y \frac{d\mu}{dx}\,y d x d μ y
So the only condition we need is the coefficients of y y y to match:
d μ d x = μ P ( x ) \boxed{\frac{d\mu}{dx} = \mu P(x)} d x d μ = μ P ( x )
This is itself a separable ODE for μ \mu μ ! Solve it:
d μ μ = P d x ⇒ ∫ d μ μ = ∫ P d x ⇒ ln ∣ μ ∣ = ∫ P d x . \frac{d\mu}{\mu} = P\,dx \;\Rightarrow\; \int\frac{d\mu}{\mu} = \int P\,dx \;\Rightarrow\; \ln|\mu| = \int P\,dx. μ d μ = P d x ⇒ ∫ μ d μ = ∫ P d x ⇒ ln ∣ μ ∣ = ∫ P d x .
Exponentiate (drop the constant — we only need one working factor):
Once multiplied, the equation becomes
d d x ( μ y ) = μ Q . \frac{d}{dx}\big(\mu y\big) = \mu Q. d x d ( μ y ) = μ Q .
Integrate both sides w.r.t. x x x :
μ y = ∫ μ Q d x + C . \mu y = \int \mu Q\,dx + C. μ y = ∫ μ Q d x + C .
Worked example Example 1 —
d y d x + 2 y = e x \dfrac{dy}{dx} + 2y = e^{x} d x d y + 2 y = e x
Step 1: Identify P , Q P,Q P , Q . Already standard: P = 2 P=2 P = 2 , Q = e x Q=e^x Q = e x .
Why? Coefficient of d y d x \frac{dy}{dx} d x d y is 1 1 1 , good.
Step 2: Integrating factor. μ = e ∫ 2 d x = e 2 x \mu = e^{\int 2\,dx} = e^{2x} μ = e ∫ 2 d x = e 2 x .
Why? Plug P = 2 P=2 P = 2 into μ = e ∫ P \mu=e^{\int P} μ = e ∫ P .
Step 3: Multiply & collapse. d d x ( e 2 x y ) = e 2 x e x = e 3 x \frac{d}{dx}(e^{2x}y) = e^{2x}e^{x}=e^{3x} d x d ( e 2 x y ) = e 2 x e x = e 3 x .
Why? Left side is guaranteed a single derivative once we used μ \mu μ .
Step 4: Integrate. e 2 x y = 1 3 e 3 x + C e^{2x}y = \frac{1}{3}e^{3x} + C e 2 x y = 3 1 e 3 x + C .
Step 5: Solve for y y y . y = 1 3 e x + C e − 2 x y = \frac{1}{3}e^{x} + Ce^{-2x} y = 3 1 e x + C e − 2 x .
Why? Divide by μ = e 2 x \mu=e^{2x} μ = e 2 x ; e 3 x / e 2 x = e x e^{3x}/e^{2x}=e^x e 3 x / e 2 x = e x .
Worked example Example 2 —
x d y d x + y = cos x x\dfrac{dy}{dx} + y = \cos x x d x d y + y = cos x (must standardize first!)
Step 1: Standardize. Divide by x x x : d y d x + 1 x y = cos x x \frac{dy}{dx} + \frac{1}{x}y = \frac{\cos x}{x} d x d y + x 1 y = x c o s x .
Why? The formula needs coefficient 1 1 1 on d y d x \frac{dy}{dx} d x d y .
So P = 1 x P=\frac1x P = x 1 , Q = cos x x Q=\frac{\cos x}{x} Q = x c o s x .
Step 2: μ = e ∫ 1 x d x = e ln ∣ x ∣ = x \mu = e^{\int \frac1x dx} = e^{\ln|x|} = x μ = e ∫ x 1 d x = e l n ∣ x ∣ = x .
Why? ∫ 1 x d x = ln ∣ x ∣ \int \frac1x dx=\ln|x| ∫ x 1 d x = ln ∣ x ∣ , and e ln x = x e^{\ln x}=x e l n x = x .
Step 3: d d x ( x y ) = x ⋅ cos x x = cos x \frac{d}{dx}(xy) = x\cdot\frac{\cos x}{x} = \cos x d x d ( x y ) = x ⋅ x c o s x = cos x .
Why notice: multiplying μ = x \mu=x μ = x by Q = cos x x Q=\frac{\cos x}{x} Q = x c o s x cancels nicely — a sign you standardized correctly.
Step 4: x y = sin x + C ⇒ y = sin x + C x xy = \sin x + C \Rightarrow y = \frac{\sin x + C}{x} x y = sin x + C ⇒ y = x s i n x + C .
Worked example Example 3 — IVP:
d y d x − y = x \dfrac{dy}{dx} - y = x d x d y − y = x , y ( 0 ) = 1 y(0)=1 y ( 0 ) = 1
P = − 1 , Q = x P=-1,\ Q=x P = − 1 , Q = x . μ = e ∫ − 1 d x = e − x \mu=e^{\int -1\,dx}=e^{-x} μ = e ∫ − 1 d x = e − x .
d d x ( e − x y ) = x e − x \frac{d}{dx}(e^{-x}y)=xe^{-x} d x d ( e − x y ) = x e − x .
Integrate by parts: ∫ x e − x d x = − x e − x − e − x + C \int xe^{-x}dx = -xe^{-x}-e^{-x}+C ∫ x e − x d x = − x e − x − e − x + C .
So e − x y = − x e − x − e − x + C ⇒ y = − x − 1 + C e x e^{-x}y = -xe^{-x}-e^{-x}+C \Rightarrow y = -x-1+Ce^{x} e − x y = − x e − x − e − x + C ⇒ y = − x − 1 + C e x .
Apply y ( 0 ) = 1 y(0)=1 y ( 0 ) = 1 : 1 = − 0 − 1 + C ⇒ C = 2 1 = -0-1+C \Rightarrow C=2 1 = − 0 − 1 + C ⇒ C = 2 .
Answer: y = − x − 1 + 2 e x y = -x-1+2e^{x} y = − x − 1 + 2 e x .
Why apply IC last? The constant C C C is fixed only after the general solution is found.
Common mistake "I'll just plug into
μ = e ∫ P \mu = e^{\int P} μ = e ∫ P without dividing first."
Why it feels right: the equation already looks linear, so why bother? The trap: if the coefficient of d y d x \frac{dy}{dx} d x d y isn't 1 1 1 , the term that should equal μ P y \mu P y μ P y is wrong, and the product rule no longer collapses. Fix: always normalize to d y d x + P y = Q \frac{dy}{dx}+Py=Q d x d y + P y = Q first.
+ C +C + C to the integrating factor.
Why it feels right: every integral gets a + C +C + C . The trap: we only need one function μ \mu μ that works; an extra constant inside an exponential becomes a harmless multiplicative factor e C e^{C} e C that cancels. Fix: drop the constant when computing μ \mu μ ; keep + C +C + C only at the final integration.
Common mistake Forgetting to divide the final answer by
μ \mu μ .
Why it feels right: you reached μ y = … \mu y = \dots μ y = … and feel done. The trap: that's μ y \mu y μ y , not y y y . Fix: divide the whole right side (including C C C ) by μ ( x ) \mu(x) μ ( x ) .
Common mistake Mishandling
e ln ∣ x ∣ e^{\ln|x|} e l n ∣ x ∣ .
The fix: e ∫ n x d x = e n ln ∣ x ∣ = ∣ x ∣ n e^{\int \frac{n}{x}dx} = e^{n\ln|x|} = |x|^n e ∫ x n d x = e n l n ∣ x ∣ = ∣ x ∣ n ; for solution-building we usually take x n x^n x n on the relevant domain.
Recall Quick self-test (cover the answers)
What MUST the coefficient of d y d x \frac{dy}{dx} d x d y be before applying the method? → 1 1 1
What single derivative does the left side become? → d d x ( μ y ) \frac{d}{dx}(\mu y) d x d ( μ y )
Where does the constant C C C go? → only at the final integration step
Recall Feynman: explain to a 12-year-old
Imagine two kids, "d y d x \frac{dy}{dx} d x d y -kid" and "P y Py P y -kid", refusing to hold hands so you can't carry them together. The integrating factor μ \mu μ is a special pair of mittens: once everyone wears the same mittens, they magically join into one bundle, μ y \mu y μ y , that you can pick up (integrate) in a single grab. The mittens are chosen so the joining is automatic — that's why μ = e ∫ P \mu = e^{\int P} μ = e ∫ P .
Mnemonic Remember the recipe:
"Standardize, Mu, Multiply, Integrate, Divide" → "Some Monkeys Make Ice Drinks."
Standard form of a first-order linear ODE? d y d x + P ( x ) y = Q ( x ) \dfrac{dy}{dx}+P(x)y=Q(x) d x d y + P ( x ) y = Q ( x ) Formula for the integrating factor? μ ( x ) = e ∫ P ( x ) d x \mu(x)=e^{\int P(x)\,dx} μ ( x ) = e ∫ P ( x ) d x What condition on μ \mu μ makes the left side a single derivative? d μ d x = μ P ( x ) \dfrac{d\mu}{dx}=\mu P(x) d x d μ = μ P ( x ) After multiplying by μ \mu μ , the LHS equals which single derivative? d d x ( μ y ) \dfrac{d}{dx}(\mu y) d x d ( μ y ) General solution of the linear ODE? y = 1 μ [ ∫ μ Q d x + C ] y=\dfrac{1}{\mu}\left[\int \mu Q\,dx + C\right] y = μ 1 [ ∫ μ Q d x + C ] First thing to do if coefficient of y ′ y' y ′ is not 1? Divide the whole equation by that coefficient to standardize
Why do we drop the + C +C + C when computing μ \mu μ ? It becomes a multiplicative
e C e^C e C that cancels; one working factor suffices
μ \mu μ for d y d x + 1 x y = … \frac{dy}{dx}+\frac1x y = \dots d x d y + x 1 y = … ?μ = e ∫ 1 x d x = x \mu=e^{\int \frac1x dx}=x μ = e ∫ x 1 d x = x For d y d x + 2 y = e x \frac{dy}{dx}+2y=e^x d x d y + 2 y = e x , the integrating factor is? Where is the integration constant introduced? Only at the final integration
μ y = ∫ μ Q d x + C \mu y=\int\mu Q\,dx + C μ y = ∫ μ Q d x + C
Separable ODEs — used inside this derivation to solve for μ \mu μ .
Product Rule — the engine that makes μ d y d x + μ P y = d d x ( μ y ) \mu\frac{dy}{dx}+\mu P y=\frac{d}{dx}(\mu y) μ d x d y + μ P y = d x d ( μ y ) .
Exact ODEs — integrating factors generalize to making non-exact equations exact.
Bernoulli Equations — reduce to linear form by substitution v = y 1 − n v=y^{1-n} v = y 1 − n .
Linear Constant-Coefficient ODEs — special case P , Q P,Q P , Q constant.
Standard form dy/dx + Py = Q
Want left side as single derivative
Product rule d/dx of mu y
Integrating factor mu = exp integral P
Intuition Hinglish mein samjho
Dekho, first-order linear ODE ka standard roop hota hai d y d x + P ( x ) y = Q ( x ) \frac{dy}{dx}+P(x)y=Q(x) d x d y + P ( x ) y = Q ( x ) . Problem ye hai ki left side pe do alag-alag terms hain — ek derivative aur ek P y Py P y — inko ek saath integrate karna mushkil hai. Yahaan integrating factor ka jadoo aata hai: pura equation ko μ ( x ) \mu(x) μ ( x ) se multiply karo taaki left side seedha d d x ( μ y ) \frac{d}{dx}(\mu y) d x d ( μ y ) ban jaaye, yaani ek hi derivative. Phir dono taraf integrate karo, kaam khatam.
μ \mu μ kaha se aaya? Hum chahte hain ki product rule ke according d d x ( μ y ) = μ d y d x + d μ d x y \frac{d}{dx}(\mu y)=\mu\frac{dy}{dx}+\frac{d\mu}{dx}y d x d ( μ y ) = μ d x d y + d x d μ y humare left side se match kare. Match tabhi hoga jab d μ d x = μ P \frac{d\mu}{dx}=\mu P d x d μ = μ P . Ye toh ek chhota separable equation hai — solve karne pe μ = e ∫ P d x \mu=e^{\int P\,dx} μ = e ∫ P d x mil jaata hai. Bas isi liye formula yaad rakhne ki zaroorat nahi, derive kar sakte ho.
Do baatein hamesha dhyan rakho: pehle equation ko standard form mein laao (yaani d y d x \frac{dy}{dx} d x d y ka coefficient 1 1 1 hona chahiye, warna divide karo), aur constant C C C sirf last integration mein lagao, μ \mu μ banate waqt nahi. Aur final answer mein μ \mu μ se divide karna mat bhoolna — kyunki tumhare paas μ y \mu y μ y hota hai, sirf y y y nahi.
Yeh method exams mein bahut common hai aur Bernoulli, exact equations sab ki neev (foundation) hai. Recipe yaad rakho: "Standardize, Mu, Multiply, Integrate, Divide". Practice se ye 30 second ka kaam ban jaata hai.