Q.Solve the following differential equation: dxdy+2y=sinx
Concept understanding — Integrating Factor Method
Integrating Factor Method
Some first-order differential equations refuse to separate — you cannot get all the y's on one side and all the x's on the other. The integrating factor method is the standard trick for a special (and very common) family of these: the linear first-order equation. The idea is beautifully simple: multiply the whole equation by one cleverly chosen function, and the messy left-hand side collapses into a single derivative that we can integrate directly.
The Standard Form
An equation is linear of first order if it can be written as
dxdy+Py=Q
where P and Q are functions of x alone (or constants). Notice y and dxdy appear only to the first power, and never multiplied together — that is what "linear" means here.
Always rearrange into this exact shape first. The coefficient of dxdy must be 1 before you read off P and Q.
The Integrating Factor
The magic multiplier is
I.F.=e∫Pdx.
Why this one? Multiply the equation by e∫Pdx:
e∫Pdxdxdy+Pe∫Pdxy=Qe∫Pdx.
By the product rule, the left-hand side is exactly dxd(y⋅e∫Pdx), because the derivative of e∫Pdx is Pe∫Pdx. So the equation becomes
dxd(y⋅I.F.)=Q⋅I.F.
The left side is now a single derivative — that is the whole point of choosing this factor.
The Solution
Integrate both sides with respect to x:
y⋅I.F.=∫(Q⋅I.F.)dx+C.
This is the general solution. In words: (solution) × (integrating factor) = integral of (Q × integrating factor), plus a constant.
A Quick Illustration
For dxdy+x1y=x, we read P=x1, Q=x. Then ∫Pdx=logx, so I.F.=elogx=x. The solution is
y⋅x=∫x⋅xdx+C=3x3+C.
The Same Idea the Other Way Round
If an equation is linear in x instead — that is, dydx+Px=Q with P,Q functions of y — the method is identical with the roles of x and y swapped: I.F.=e∫Pdy and x⋅I.F.=∫Q⋅I.F.dy+C.
Don't add a constant of integration when computing ∫Pdx for the I.F. — any one antiderivative works, and the single constant C at the final integration captures the whole family of solutions.
The integrating factor method for linear first-order differential equations is one of the highest-weightage techniques in the NCERT Class 12 Differential Equations chapter, and "integrating factor formula and examples" is a top search term among CBSE and JEE Main aspirants. Getting comfortable converting an equation into the standard dy/dx + Py = Q form is the single most useful skill for this whole topic.
The key idea is solving a first-order linear ODE using an integrating factor.
Step 1 – Identify the integrating factor.
The standard form is dxdy+P(x)y=Q(x) with P(x)=2.
Integrating factor:
μ(x)=e∫2dx=e2x.
Step 2 – Multiply through and integrate.
Multiplying the equation by e2x:
e2xdxdy+2e2xy=e2xsinx⇒dxd(ye2x)=e2xsinx.
Integrate both sides:
ye2x=∫e2xsinxdx.
Step 3 – Evaluate the integral.
Using integration by parts (or the standard formula):
∫e2xsinxdx=5e2x(2sinx−cosx)+C.
Step 4 – Solve for y.
Divide through by e2x:
y=52sinx−cosx+Ce−2x.
The general solution is y=52sinx−cosx+Ce−2x.
This is a first-order linear ODE solved using the integrating factor method. The general solution is y=51(2sinx−cosx)+Ce−2x.
Why This Approach Works
The equation dxdy+2y=sinx is a first-order linear ordinary differential equation — it has the standard form dxdy+P(x)y=Q(x). Here P(x)=2 (constant) and Q(x)=sinx.
The key insight: the left side dxdy+2y looks almost like the derivative of a product. If we multiply both sides by a cleverly chosen function μ(x), the left side becomes exactly dxd(μy). That function is the integrating factor.
For dxdy+P(x)y=Q(x), the integrating factor is μ(x)=e∫P(x)dx.
Once we multiply through by μ, we can integrate both sides directly — no guesswork needed.
Step-by-Step Solution
1. Identify P(x) and compute the integrating factor.
Here P(x)=2, so:
μ(x)=e∫2dx=e2x
2. Multiply the entire equation by μ(x).
e2xdxdy+2e2xy=e2xsinx
Notice the left side is now exactly dxd(e2xy) — check by differentiating: dxd(e2xy)=e2xdxdy+2e2xy. Perfect.
3. Rewrite and integrate.
dxd(e2xy)=e2xsinx
Integrate both sides with respect to x:
e2xy=∫e2xsinxdx+C
4. Evaluate the integral ∫e2xsinxdx.
This is a classic integration by parts (or use the formula for ∫eaxsin(bx)dx). Let's do it cleanly.
›Proof
Let I=∫e2xsinxdx.
Use integration by parts: set u=sinx, dv=e2xdx. Then du=cosxdx, v=21e2x.
I=21e2xsinx−21∫e2xcosxdx
Now integrate ∫e2xcosxdx similarly: u=cosx, dv=e2xdx, giving du=−sinxdx, v=21e2x.
∫e2xcosxdx=21e2xcosx+21∫e2xsinxdx=21e2xcosx+21I
Substitute back:
I=21e2xsinx−21(21e2xcosx+21I)
I=21e2xsinx−41e2xcosx−41I
Bring −41I to the left:
I+41I=21e2xsinx−41e2xcosx
45I=4e2x(2sinx−cosx)
Multiply both sides by 54:
I=5e2x(2sinx−cosx)
So:
∫e2xsinxdx=5e2x(2sinx−cosx)+C
A faster route: the formula ∫eaxsin(bx)dx=a2+b2eax(asin(bx)−bcos(bx)) gives the same result instantly with a=2, b=1.
5. Solve for y.
From step 3:
e2xy=5e2x(2sinx−cosx)+C
Divide through by e2x (which is never zero):
y=51(2sinx−cosx)+Ce−2x
A common mistake is forgetting the constant C or misplacing the sign when integrating by parts. Always double-check the integration of eaxsin(bx) — the signs in the formula are easy to flip.
The general solution is y=51(2sinx−cosx)+Ce−2x.
Method: Integrating factor for a linear equation with a trig right-hand side
Use the integrating-factor method for any first-order equation of the shape dxdy+Py=Q, where y and dxdy appear only to the first power.
Steps
Step 1: Put it in standard form.
Make the coefficient of dxdy equal to 1, then read off P and Q.
Step 2: Build the integrating factor.
I.F.=e∫Pdx.
Multiplying by it makes the left side an exact derivative dxd(y⋅I.F.).
Step 3: Integrate Q×I.F..
y⋅I.F.=∫Q(I.F.)dx+C.
Step 4: Handle an eaxsinbx or eaxcosbx integral.
Such integrals return to themselves after integrating by parts twice; solve the resulting algebra for the integral, or use ∫eaxsinbxdx=a2+b2eax(asinbx−bcosbx). Divide out the I.F. to finish.
Common Mistakes
Mistake 1: Stopping at ye2x=∫e2xsinxdx without the constant.
Why it's wrong: the arbitrary constant C must appear at the integration step; omitting it loses the general solution. Correct approach: write ye2x=5e2x(2sinx−cosx)+C.
Mistake 2: Sign errors in ∫e2xsinxdx.
Why it's wrong: this integral returns to itself after two by-parts steps; a flipped sign gives 2sinx+cosx instead of 2sinx−cosx. Correct approach: use ∫eaxsinbxdx=a2+b2eax(asinbx−bcosbx) with a=2,b=1.
Mistake 3: Forgetting the Ce−2x term after dividing by the I.F.
Why it's wrong: dividing by e2x turns C into Ce−2x, a genuine part of the solution. Correct approach: divide every term, including the constant.
Showing the 12 most recent of 21 on this concept.
- KEAM 2026Set eng-2026-04174 marksMCQQ.The general solution of the differential equation x3dxdy+3x2y=cosx is (A) y=x3sinx+C (B) y=x3sinx+Cx (C) y=x2sinx+C (D) y=x2sinx+C (E) y=x3sinx+C
›Reveal solutionSolution
Recognize the exact derivative dxd(x3y).
Since dxd(x3y)=x3dxdy+3x2y, the equation x3dxdy+3x2y=cosx becomes
dxd(x3y)=cosx.
Integrating: x3y=sinx+C, hence
y=x3sinx+C.
✓Final answerThe correct option is (E).
- KEAM 2026Set eng-2026-04174 marksMCQQ.The integrating factor of the differential equation 2dy=(y+cosx)dx is (A) e−2x (B) e−x/2 (C) e2x (D) ex/2 (E) −ex/2
›Reveal solutionSolution
Put in standard linear form and read off the integrating factor.
From 2dy=(y+cosx)dx:
2dxdy=y+cosx ⇒ dxdy−21y=21cosx.
This is linear with P(x)=−21, so the integrating factor is
e∫Pdx=e−x/2.
✓Final answerThe correct option is (B).
- KEAM 2026Set eng-2026-04184 marksMCQQ.The integrating factor of the differential equation dxdy+20−x2y=10 is (A) (20−x)21 (B) 20−x1 (C) 20−x (D) loge∣20−x∣ (E) loge(20−x)2
›Reveal solutionSolution
The integrating factor is e∫Pdx with P=20−x2, which evaluates to (20−x)21.
For dxdy+Py=Q with P=20−x2,
∫Pdx=∫20−x2dx=−2log∣20−x∣.
Hence IF =e−2log∣20−x∣=∣20−x∣−2=(20−x)21.
✓Final answerThe correct option is (A).
- KEAM 2026Set eng-2026-04224 marksMCQQ.The solution of the differential equation (y+x2)dx=xdy,x>0 is a curve which passes through the point (1,0). The equation of the curve is (A) y=x(x+1) (B) y=x(x−1) (C) y=x2(x−1) (D) y=x2(x+1) (E) y=x(x2−1)
›Reveal solutionSolution
Rewrite as a first-order linear ODE y′−y/x=x, use integrating factor 1/x, then apply the point (1,0).
From (y+x2)dx=xdy: xdxdy=y+x2⇒dxdy−xy=x.
Integrating factor =e−∫dx/x=x1, so dxd(xy)=1.
Thus xy=x+C⇒y=x2+Cx.
At (1,0): 0=1+C⇒C=−1, giving y=x2−x=x(x−1).
✓Final answerThe correct option is (B).
- JEE Main 2026Set 2026-01-21-s24 marksMCQQ.Let y = y(x) be the solution of the differential equation sec x (dy/dx) − 2y = 2 + 3 sin x, x ∈ (−π/2, π/2), y(0) = −7/4. Then y(π/6) is equal to : (A) −3√2 − 7 (B) −3√3 − 7 (C) −5/4 (D) −5/2
›Reveal solutionSolution
After converting to standard linear form and solving, the constant of integration turns out to be exactly zero, leaving the clean closed form y=−47−23sinx, giving y(π/6)=−25.
The equation isn't linear as written (it has secx multiplying dy/dx), but multiplying through by cosx fixes that.
- Multiply by cosx: dxdy−2cosxy=(2+3sinx)cosx.
- Integrating factor: e∫−2cosxdx=e−2sinx.
- dxd[ye−2sinx]=(2+3sinx)cosxe−2sinx. Substitute u=sinx, du=cosxdx: RHS integral becomes ∫(2+3u)e−2udu=e−2u(−47−23u) (via integration by parts).
- So ye−2sinx=e−2sinx(−47−23sinx)+C⇒y=−47−23sinx+Ce2sinx.
- y(0)=−47−0+C=−47⇒C=0.
- y(π/6)=−47−23×21=−47−43=−410=−25.
✓Final answerThe correct option is (D).
- JEE Main 2026Set 2026-04-04-s24 marksMCQQ.Let y = y(x) be the solution of the differential equation: dy/dx + [6x^2 + (3x^2 + 2x^3 + 4)e^{−2x}] / [(x^3 + 2)(2 + e^{−2x})] · y = 2 + e^{−2x}, x ∈ (−1, 2), satisfying y(0) = 3/2. If y(1) = α(2 + e^{−2}), then α is equal to: (A) 13/8 (B) 6/13 (C) 12/13 (D) 13/12
›Reveal solutionSolution
The messy P(x) splits into two clean logarithmic pieces, giving IF=(x³+2)/(2+e^{−2x}); after integrating and applying y(0)=3/2, α works out to 13/12.
The trick in this problem is recognizing that the complicated P(x) decomposes into a sum of two simple rational-in-each-piece terms.
- Decompose the numerator: 6x² + (3x²+2x³+4)e^{−2x} = 3x²(2+e^{−2x}) + 2(x³+2)e^{−2x} (check: 3x²×2+3x²e^{−2x} + 2x³e^{−2x}+4e^{−2x} = 6x²+3x²e^{−2x}+2x³e^{−2x}+4e^{−2x}, matching the original numerator).
- So P(x) = 3x²/(x³+2) + 2e^{−2x}/(2+e^{−2x}).
- Integrate each piece: ∫3x²/(x³+2)dx = ln(x³+2). For the second, let u=2+e^{−2x}, du=−2e^{−2x}dx: ∫2e^{−2x}/(2+e^{−2x})dx = −ln(2+e^{−2x}).
- So ∫P dx = ln(x³+2) − ln(2+e^{−2x}) = ln[(x³+2)/(2+e^{−2x})].
Integrating factor IF = e^{∫P dx}
-
IF = (x³+2)/(2+e^{−2x}).
-
Multiply the RHS Q=(2+e^{−2x}) by IF: Q×IF = (2+e^{−2x}) × (x³+2)/(2+e^{−2x}) = x³+2 — remarkably simple!
-
So d/dx[y·IF] = x³+2 ⟹ y·IF = ∫(x³+2)dx = x⁴/4 + 2x + C.
-
Apply y(0)=3/2: IF(0) = (0+2)/(2+1) = 2/3. So y(0)·IF(0) = (3/2)(2/3) = 1 = 0+0+C ⟹ C=1.
-
Evaluate at x=1: IF(1) = (1+2)/(2+e⁻²) = 3/(2+e⁻²). RHS: 1/4+2+1 = 13/4.
y(1) × 3/(2+e⁻²) = 13/4 ⟹ y(1) = (13/4)×(2+e⁻²)/3 = 13(2+e⁻²)/12.
-
Given y(1)=α(2+e⁻²): α = 13/12.
✓Final answerThe correct option is (D).
- JEE Main 2026Set 2026-04-05-s24 marksQ.Let y = y(x) be the solution of the differential equation (tan x)^(1/2) dy = (sec^3 x - (tan x)^(3/2) y) dx, 0 < x < π/2, y(π/4) = 6√2/5. If y(π/3) = (4/5) α, then α^4 equals __________.
›Reveal solutionSolution
Rewriting the equation as a linear ODE in y, solving with integrating factor secx, and fitting the initial condition gives y=cosx[2tanx+52(tanx)5/2], leading to α4=48.
Whenever a differential equation can be rearranged into the form dxdy+P(x)y=Q(x), the integrating factor e∫Pdx is the reliable way through — no need to guess a substitution.
- Starting from (tanx)1/2dy=[sec3x−(tanx)3/2y]dx, divide by (tanx)1/2dx:
dxdy=sec3x(tanx)−1/2−tanx⋅y ⟹ dxdy+tanx⋅y=sec3x(tanx)−1/2.
- The integrating factor is e∫tanxdx=elnsecx=secx, so
dxd(ysecx)=secx⋅sec3x(tanx)−1/2=sec4x(tanx)−1/2.
- Substitute t=tanx, dt=sec2xdx, and write sec4xdx=sec2x⋅(sec2xdx)=(1+t2)dt:
∫(1+t2)t−1/2dt=∫(t−1/2+t3/2)dt=2t1/2+52t5/2+C.
- So ysecx=2tanx+52(tanx)5/2+C, i.e.
y=cosx[2tanx+52(tanx)5/2+C].
Watch outDon't drop the constant C before checking the initial condition — it isn't automatically zero.
- At x=π/4, tanx=1, cosx=21:
y(4π)=21[2+52+C]=22.4+C.
Setting this equal to 562=5212=22.4 forces C=0.
6. So y=cosx[2tanx+52(tanx)5/2].
7. At x=π/3: tanx=3, cosx=21. Since 3=31/4 and (3)5/2=35/4=3⋅31/4,
y(3π)=21[2⋅31/4+52⋅3⋅31/4]=21⋅31/4[2+56]=21⋅31/4⋅516=58⋅31/4.
- Matching to 54α: 54α=58⋅31/4⇒α=2⋅31/4.
- So α4=(2⋅31/4)4=16⋅3=48.
✓Final answerThe value is 48.
- KEAM 2025Set eng-2025-04234 marksMCQQ.The integrating factor of the differential equation sinxdy=21(sin2x+2ycosx)dx is (A) secx (B) sinx (C) tanx (D) cosx (E) cscx
›Reveal solutionSolution
The equation reduces to y' - (cot x) y = cos x, giving integrating factor e^{-integral cot x dx} = csc x.
Concept and Intuition
Rewrite the equation in standard linear form dy/dx + P(x)y = Q(x); the integrating factor is e^{integral P dx}.
Step-by-Step Solution
- sin x dy = (1/2)(sin2x + 2y cos x) dx; using sin2x = 2 sin x cos x, the RHS = (sin x cos x + y cos x) dx.
- So sin x (dy/dx) = sin x cos x + y cos x, i.e. dy/dx = cos x + y cot x.
- Standard form: dy/dx - (cot x) y = cos x, so P(x) = -cot x.
- IF = e^{integral -cot x dx} = e^{-log|sin x|} = 1/sin x = csc x.
Common Mistakes
- Sign error on P(x) that flips csc x to sin x.
✓Final answerThe correct option is (E) — csc x.
ANSWER: E
- KEAM 2025Set eng-2025-04254 marksMCQQ.The integrating factor of the differential equation (1+x2)dy=(1−2xy)dx is (A) x2+1 (B) loge(x2+1) (C) x2+1x (D) x(x2+1) (E) loge∣x∣
›Reveal solutionSolution
Put in standard linear form dxdy+Py=Q and compute e∫Pdx.
Rewrite (1+x2)dy=(1−2xy)dx as
dxdy+1+x22xy=1+x21.
Here P=1+x22x, so
IF=e∫1+x22xdx=eloge(1+x2)=1+x2.
✓Final answerThe correct option is (A).
- KEAM 2025Set eng-2025-04274 marksMCQQ.The integrating factor of the differential equation dxdy−2y=2x−3 is (A) e2x (B) 2−1e−2x (C) 21e−2x (D) 21e−2x (E) e−2x
›Reveal solutionSolution
[!TLDR]
With P(x)=−2, the integrating factor e∫Pdx=e−2x.
Concept
A linear first-order differential equation in the form dxdy+P(x)y=Q(x) is solved by multiplying through by the integrating factor μ(x)=e∫P(x)dx — the standard method in the NCERT/CBSE differential-equations chapter.
Solution
The equation is
dxdy−2y=2x−3.
Comparing with dxdy+P(x)y=Q(x), we read off P(x)=−2.
The integrating factor is
μ(x)=e∫Pdx=e∫(−2)dx=e−2x.
[!ANSWER]
(E) e−2x
- KEAM 2024Set eng-2024-06054 marksMCQQ.The integrating factor of (1+2e−x)dxdy−2e−xy=1+e−x is (A) 2e−x (B) 1+e−x (C) 1−e−x (D) 1−2e−x (E) 1+2e−x
›Reveal solutionSolution
∫Pdx=log(1+2e−x), so the integrating factor is 1+2e−x.
Divide by (1+2e−x):
dxdy−1+2e−x2e−xy=1+2e−x1+e−x,
so P(x)=−1+2e−x2e−x. With w=1+2e−x, dw=−2e−xdx:
∫Pdx=∫wdw=log∣1+2e−x∣.
Hence IF =elog(1+2e−x)=1+2e−x.
✓Final answerThe correct option is (E).
- KEAM 2024Set eng-2024-06064 marksMCQQ.The integrating factor of the differential equation xdxdy+2y=xex is (A) logex (B) loge2x (C) x (D) x2 (E) 2x
›Reveal solutionSolution
Dividing by x gives P(x)=x2, so the integrating factor is x2.
Divide xdxdy+2y=xex by x: dxdy+x2y=ex.
The integrating factor is e∫x2dx=e2logx=x2.
✓Final answerThe correct option is (D).
🎓Unlock everything free for 10 days
- ✓Full step-by-step solutions
- ✓Concept-first explanations
- ✓Methods, shortcuts & mistakes
- ✓PYQ mapping + timed mock tests
Full access for 10 days. No credit card required.