Q.Find the general solution of the differential equation dxdy−y=cosx.
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 that this is a linear first-order ODE — we solve it using an integrating factor.
Step 1 – Identify the standard form
The equation is already in the form dxdy+P(x)y=Q(x) with P(x)=−1 and Q(x)=cosx.
Step 2 – Find the integrating factor
μ(x)=e∫Pdx=e∫−1dx=e−x
Step 3 – Multiply through and integrate
Multiplying: e−xdxdy−e−xy=e−xcosx
The left side is dxd(ye−x), so:
dxd(ye−x)=e−xcosx
Integrate both sides:
ye−x=∫e−xcosxdx
Using integration by parts (or the standard formula), we get:
∫e−xcosxdx=2e−x(sinx−cosx)+C
Step 4 – Solve for y
Multiply through by ex:
y=21(sinx−cosx)+Cex
The general solution is y=21(sinx−cosx)+Cex.
This is a first-order linear ODE solved using the integrating factor method. The general solution is y=21sinx−21cosx+Cex.
The equation dxdy−y=cosx is a first-order linear ordinary differential equation. It has the standard form dxdy+P(x)y=Q(x), where here P(x)=−1 and Q(x)=cosx.
The key idea: we cannot directly integrate because y and its derivative are mixed. But we can multiply both sides by a cleverly chosen function — the integrating factor — that turns the left-hand side into the derivative of a product. Once that happens, we just integrate both sides.
Step-by-step solution
1. Identify the integrating factor.
For an equation of the form dxdy+P(x)y=Q(x), the integrating factor is
μ(x)=e∫P(x)dx.
Here P(x)=−1, so
∫P(x)dx=∫(−1)dx=−x.
Thus
μ(x)=e−x.
2. Multiply the entire equation by μ(x).
Original: dxdy−y=cosx.
Multiply by e−x:
e−xdxdy−e−xy=e−xcosx.
Notice the left-hand side is exactly the derivative of y⋅e−x with respect to x (by the product rule). Check:
dxd(ye−x)=dxdye−x+y⋅(−e−x)=e−xdxdy−e−xy.
So the equation becomes
dxd(ye−x)=e−xcosx.
3. Integrate both sides.
ye−x=∫e−xcosxdx+C.
Now we need the integral I=∫e−xcosxdx. This is a classic integration by parts (or use the formula for ∫eaxcos(bx)dx). Let's do it carefully.
›Proof
Evaluating ∫e−xcosxdx
Use integration by parts twice. Let u=e−x, dv=cosxdx. Then du=−e−xdx, v=sinx.
I=e−xsinx−∫sinx⋅(−e−x)dx=e−xsinx+∫e−xsinxdx.
Now integrate ∫e−xsinxdx by parts again: let u=e−x, dv=sinxdx, so du=−e−xdx, v=−cosx.
∫e−xsinxdx=−e−xcosx−∫(−cosx)(−e−x)dx=−e−xcosx−∫e−xcosxdx.
Substitute back:
I=e−xsinx+(−e−xcosx−I)=e−xsinx−e−xcosx−I.
So 2I=e−x(sinx−cosx), hence
I=21e−x(sinx−cosx).
Thus
ye−x=21e−x(sinx−cosx)+C.
4. Solve for y.
Multiply both sides by ex:
y=21(sinx−cosx)+Cex.
A common mistake is forgetting the constant of integration C or misplacing the sign when integrating by parts. Always check by differentiating your final answer.
The general solution is y=21sinx−21cosx+Cex.
Method: Integrating factor for a linear first-order equation
Use this whenever the equation can be put in the linear standard form dxdy+P(x)y=Q(x) — the unknown y and its derivative appear only to the first power and are not multiplied together.
Steps
Step 1: Identify P(x) and Q(x).
Match the equation to dxdy+P(x)y=Q(x); read off P (the coefficient of y) and Q (everything on the right).
Step 2: Compute the integrating factor.
μ(x)=e∫P(x)dx.
Step 3: Multiply through; the left side becomes an exact derivative.
By design, μdxdy+μPy=dxd(μy), so the equation reads dxd(μy)=μQ.
Step 4: Integrate both sides and solve for y.
μy=∫μQdx+C.
When μQ is a product like e−xcosx, use integration by parts twice and solve for the repeating integral algebraically.
Common Mistakes
Mistake 1: Taking P(x) with the wrong sign.
Why it's wrong: the equation is dxdy+P(x)y=Q(x) with P=−1 here (not +1), so μ=e−x. A sign error gives the wrong integrating factor. Correct approach: rewrite as dxdy+(−1)y=cosx and read P=−1.
Mistake 2: Giving up on ∫e−xcosxdx.
Why it's wrong: it does not have an elementary "obvious" antiderivative but is standard via parts twice, after which you solve algebraically for the repeating integral. Correct approach: apply integration by parts twice and rearrange to get 21e−x(sinx−cosx).
Mistake 3: Forgetting the constant C.
Why it's wrong: the general solution needs the Cex term. Correct approach: add C when integrating, then multiply by ex.
Showing the 12 most recent of 36 on this concept.
- CBSE 2026Set 65/1/11 markMCQQ.The integrating factor of differential equation Rdydx+Px=Q, where P, Q, R are functions of y, is (A) e∫QPdy (B) e∫Pdy (C) e∫RPdy (D) e∫RPdx
›Reveal solutionSolution
The key idea is to rewrite the given equation in the standard linear form dydx+P1x=Q1 by dividing through by R, then the integrating factor is e∫P1dy=e∫RPdy. The correct option is (C).
The Integrating Factor (IF) method is a systematic way to solve first-order linear differential equations. The core insight is that we want to multiply the entire equation by a function that turns the left-hand side into the exact derivative of a product — specifically, the derivative of x times some function. This works because if you have an equation of the form dydx+f(y)x=g(y), multiplying both sides by e∫f(y)dy makes the left side become dyd(x⋅e∫f(y)dy), which is then easy to integrate.
Here, the given equation is Rdydx+Px=Q, where P, Q, R are functions of y alone. Notice that the coefficient of dydx is R, not 1. So our first job is to put it into the standard form.
- Rewrite in standard linear form. Divide every term by R (assuming R=0):
dydx+RPx=RQ.
Now it matches the pattern dydx+P1(y)x=Q1(y), where P1(y)=RP and Q1(y)=RQ.
- Recall the formula for the integrating factor. For a first-order linear ODE in the form dydx+P1(y)x=Q1(y), the integrating factor is
IF=e∫P1(y)dy.
This is a standard result — the exponential of the integral of the coefficient of x.
- Substitute P1 into the formula. Here P1(y)=RP, so
IF=e∫RPdy.
Watch outA common mistake is to forget to divide by R first and then incorrectly use P directly. The integrating factor depends on the coefficient of x after the derivative term has coefficient 1. Also, note that the integration is with respect to y (the independent variable), not x — option (D) integrates with respect to x, which is wrong because P and R are functions of y.
TipIf you ever forget the formula, just remember: you want to find a function μ(y) such that μdydx+μP1x=dyd(μx). Expanding the right side gives μdydx+dydμx, so comparing, we need dydμ=μP1, which gives μ=e∫P1dy.
Thus, the integrating factor is e∫RPdy.
✓Final answerThe correct option is (C).
- CBSE 2026Set 65/2/11 markMCQQ.The integrating factor of the differential equation 2xdxdy−y=3 is (A) x (B) x1 (C) ex (D) e−x
›Reveal solutionSolution
To find the integrating factor, we first convert the given differential equation into the standard linear form dxdy+P(x)y=Q(x). From this, we identify P(x)=−2x1, and the integrating factor is calculated as e∫P(x)dx, which evaluates to x1.
The integrating factor method is a powerful technique used to solve first-order linear differential equations. A first-order linear differential equation has the general form:
dxdy+P(x)y=Q(x)
where P(x) and Q(x) are functions of x (or constants).
Why the Integrating Factor?
The core idea is to transform the left-hand side (LHS) of this equation into the derivative of a product. Specifically, we want to make the LHS look like dxd(y⋅some function).
Let's say we multiply the entire equation by a function, μ(x), which we call the integrating factor:
μ(x)dxdy+μ(x)P(x)y=μ(x)Q(x)
Now, consider the product rule for differentiation: dxd(μ(x)y)=μ(x)dxdy+ydxdμ.
For our modified LHS to be exactly dxd(μ(x)y), we need the term μ(x)P(x)y to be equal to ydxdμ.
This means:
μ(x)P(x)=dxdμ
This is a separable differential equation for μ(x). We can rewrite it as:
μdμ=P(x)dx
Integrating both sides:
∫μdμ=∫P(x)dx
log∣μ∣=∫P(x)dx
Exponentiating both sides (and typically taking the positive value for μ(x) as a convention, and omitting the constant of integration since any constant factor in μ(x) would cancel out later):
μ(x)=e∫P(x)dx
This μ(x) is the integrating factor. Once we multiply the original equation by this μ(x), the LHS becomes dxd(μ(x)y), which can then be easily integrated to solve for y.
Let's apply this method to the given problem.
- Convert to Standard Form The given differential equation is 2xdxdy−y=3. The standard form for a first-order linear differential equation is dxdy+P(x)y=Q(x). To achieve this, we need the coefficient of dxdy to be 1. We can do this by dividing the entire equation by 2x:
2x2xdxdy−2xy=2x3
dxdy−2x1y=2x3
- Identify P(x) Now, comparing our equation dxdy−2x1y=2x3 with the standard form dxdy+P(x)y=Q(x), we can identify P(x) and Q(x):
P(x)=−2x1
Q(x)=2x3
> [!WARNING] > Be careful with the sign! $P(x)$ includes the sign of the $y$ term. Here, it's $ - \frac{1}{2x} $, not just $ \frac{1}{2x} $.3. Calculate the Integrating Factor
The formula for the integrating factor (IF) is:
> [!FORMULA]
> IF=e∫P(x)dx
Substitute P(x)=−2x1 into the formula:
IF=e∫−2x1dx
Now, we need to evaluate the integral in the exponent:∫−2x1dx=−21∫x1dx
=−21log∣x∣
For typical exam problems involving integrating factors, we usually assume $x > 0$ (or the domain where the solution is valid) so we can write $ \log x $.=−21logx
Using the logarithm property $a \log b = \log(b^a)$:=log(x−1/2)
Now, substitute this back into the integrating factor formula:IF=elog(x−1/2)
Using the property $e^{\log A} = A$:IF=x−1/2
IF=x1
Comparing this result with the given options:
(A) x
(B) x1
(C) ex
(D) e−x
Our calculated integrating factor matches option (B).
✓Final answerThe integrating factor of the differential equation is x1.
- CBSE 2026Set A1 markMCQQ.The integrating factor of the differential equation (1+x2)dxdy+y=etan−1x is(a) etan−1x(b) esin−1x(c) tan−1x(d) sin−1x
›Reveal solutionSolution
Standard form gives P=1+x21, so I.F. =e∫1+x2dx=etan−1x.
Divide the equation by (1+x2) to get the linear form dxdy+Py=Q:
dxdy+1+x21y=1+x2etan−1x, so P=1+x21.
The integrating factor is e∫Pdx=e∫1+x2dx=etan−1x.
✓Final answer(A) etan−1x.
- CBSE 2026Set ANNUAL1 markMCQQ.The Integrating factor of differential equation (1 − y²) dy/dx + y·x = ay is(a) 1/(y²−1)(b) 1/√(y²−1)(c) 1/(1−y²)(d) 1/√(1−y²)
›Reveal solutionSolution
Written correctly this is a linear equation in x as a function of y: (1−y2)dydx+xy=ay. Its integrating factor works out to 1/1−y2.
Divide through by (1−y2) to get the standard linear form dydx+P(y)x=Q(y):
dydx+1−y2yx=1−y2ay,P(y)=1−y2y.
Integrating factor I.F.=e∫P(y)dy=e∫1−y2ydy.
Let u=1−y2, du=−2ydy:
∫1−y2ydy=−21∫udu=−21ln∣1−y2∣.
So I.F.=e−21ln∣1−y2∣=(1−y2)−1/2=1−y21.
✓Final answer1−y21. (Option d)
- CBSE 2026Set ANNUAL1 markQ.Find the integrating factor of the differential equation x dy/dx + y = 10.
›Reveal solutionSolution
Write the equation in the standard linear form dy/dx+Py=Q first, then use I.F.=e∫Pdx.
xdxdy+y=10⇒dxdy+x1y=x10
Here P=1/x.
I.F.=e∫Pdx=e∫x1dx=elnx=x
✓Final answerIntegrating factor =x.
- CBSE 2026Set ANNUAL1 markQ.Write the answer in one word/sentence: Write the general solution of a differential equation of the type dydx+P1x=Q1.
›Reveal solutionSolution
Linear DE in x; multiply by integrating factor e∫P1dy.
For dydx+P1x=Q1, the integrating factor is IF=e∫P1dy, and the solution is
x⋅IF=∫Q1⋅IFdy+C.
✓Final answerxe∫P1dy=∫Q1e∫P1dydy+C.
- CBSE 2025Set 65/1/11 markMCQQ.The integrating factor of differential equation (x+2y3)dxdy=2y is (A) e2y2 (B) y1 (C) y21 (D) e−y21
›Reveal solutionSolution
The given equation is not linear in y, but it is linear in x when rewritten as dydx−2yx=y2. The integrating factor is e∫−2y1dy=y1, so the correct option is (B).
We often learn the integrating factor method for first-order linear ODEs of the form dxdy+P(x)y=Q(x). But here, the equation is (x+2y3)dxdy=2y. If we try to write it as dxdy+P(x)y=Q(x), we run into trouble because the coefficient of dxdy involves both x and y, and the right-hand side is 2y — not a function of x alone. That path leads nowhere.
The trick is to swap the roles of x and y. Notice that the equation contains x and y in a way that suggests x might be the dependent variable. If we rewrite it as dydx, we get a linear equation in x — and then the integrating factor method works cleanly.
Let’s do it step by step.
- Rewrite the equation in terms of dydx. Start with
(x+2y3)dxdy=2y.
Divide both sides by dxdy (which is fine as long as y is not constant):
x+2y3=2ydydx.
Now isolate dydx:
dydx=2yx+2y3=2yx+y2.
- Bring it to the standard linear form. A first-order linear ODE in x (as a function of y) looks like
dydx+P(y)x=Q(y).
From dydx=2yx+y2, subtract 2yx from both sides:
dydx−2yx=y2.
So here P(y)=−2y1 and Q(y)=y2.
- Find the integrating factor. The integrating factor for dydx+P(y)x=Q(y) is
μ(y)=e∫P(y)dy.
With P(y)=−2y1, we have
∫−2y1dy=−21log∣y∣=log(y−1/2).
Therefore
μ(y)=elog(y−1/2)=y−1/2=y1.
TipNotice that we never needed to solve for x — the question only asks for the integrating factor. Once you see the equation is linear in x, the integrating factor comes directly from P(y).
- Check the options. The integrating factor we found is y1, which matches option (B).
Watch outA common mistake is to try to force the equation into the form dxdy+P(x)y=Q(x) and then compute an integrating factor in x. That would give something like e∫x+2y32ydx, which is nonsense because y is not a constant. Always check whether the roles of x and y can be swapped to get a linear form.
✓Final answerThe correct option is (B) y1.
- CBSE 2025Set ANNUAL1 markQ.The integrating factor of differential equation dxdy+y=x is _____.
›Reveal solutionSolution
For a linear equation dxdy+Py=Q, the integrating factor is e∫Pdx.
Here dxdy+y=x is linear with P=1, Q=x.
I.F.=e∫1dx=ex
✓Final answerThe integrating factor is ex.
- CBSE 2025Set ANNUAL1 markMCQQ.Integrating factor of differential equation dxdy−xy=x4−3x is(a) x(b) logx(c) x1(d) −x
›Reveal solutionSolution
The integrating factor of a linear DE depends only on the coefficient of y, not on the right-hand-side function of x — so it is unaffected by the exact power in the RHS term.
The equation dxdy−xy=x4−3x is a first-order linear differential equation of the standard form dxdy+P(x)y=Q(x), with:
P(x)=−x1, and Q(x)=x4−3x (the right-hand side, whatever its exact power).
The integrating factor is:
I.F.=e∫P(x)dx=e∫−x1dx=e−lnx=x1
Note: only P(x) (the coefficient of y) determines the integrating factor — Q(x) never enters this calculation. So even though this item's source scan had a slightly ambiguous exponent glyph in the right-hand-side term (best read as x^4), the integrating factor is unaffected either way and remains 1/x.
✓Final answer(c) x1.
- CBSE 2025Set ANNUAL1 markMCQQ.The integrating factor of ydx − (x + 2y²)dy = 0 is :(a) 1/y²(b) −1/y(c) 1/y(d) y
›Reveal solutionSolution
Rewritten as a linear equation in x (treating y as the independent variable), the integrating factor is e∫−y1dy=y1.
Given: ydx−(x+2y2)dy=0, i.e. ydx=(x+2y2)dy, so
dydx=yx+2y⟹dydx−y1x=2y.
This is linear in x, of the form dydx+P(y)x=Q(y) with P(y)=−y1. The integrating factor is
IF=e∫P(y)dy=e−∫y1dy=e−lny=y1.
✓Final answer(c) y1.
- CBSE 2025Set ANNUAL1 markMCQQ.Choose the correct answer : The integrating factor of the differential equation xdxdy−y=2x2 is(a) e−x(b) e−y(c) x1(d) x
›Reveal solutionSolution
Put the equation in standard linear form dxdy+Py=Q and compute e∫Pdx.
Starting from xdxdy−y=2x2, divide throughout by x:
dxdy−x1y=2x.
This is linear in y with P(x)=−x1 and Q(x)=2x.
The integrating factor is
IF=e∫Pdx=e∫−x1dx=e−logx=elogx−1=x1.
Checking against the options: (a) e−x, (b) e−y, (d) x do not arise from ∫−x1dx; only (c) x1 does.
✓Final answer(c) x1
- CBSE 2025Set ANNUAL1 markMCQQ.The integrating factor of differential equation cos x (dy/dx) + y sin x = 1 is .......(a) sec x + tan x(b) Log(sec x + tan x)(c) e^(sec x)(d) sec x
›Reveal solutionSolution
Writing the equation in standard linear form dxdy+Py=Q gives P=tanx, and the integrating factor e∫Pdx=eln∣secx∣=secx.
Given: cosxdxdy+ysinx=1
Step 1 — standard form: Divide throughout by cosx:
dxdy+ytanx=secx
This is linear in y, with P(x)=tanx and Q(x)=secx.
Step 2 — integrating factor:
I.F.=e∫tanxdx=eln∣secx∣=secx
✓Final answerThe integrating factor is secx (Option d).
🎓Unlock everything free for 14 days
- ✓Full step-by-step solutions
- ✓Concept-first explanations
- ✓Methods, shortcuts & mistakes
- ✓PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.