Solve the differential equation dy/dx + y = eˣ

medium CBSE JEE-MAIN NCERT Class 12 3 min read

Question

Solve the differential equation:

dydx+y=ex\frac{dy}{dx} + y = e^x

(NCERT Class 12, Exercise 9.6)


Solution — Step by Step

This is of the form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x) \cdot y = Q(x), where P(x)=1P(x) = 1 and Q(x)=exQ(x) = e^x.

This is a linear first-order differential equation, so we use the integrating factor method.

IF=eP(x)dx=e1dx=ex\text{IF} = e^{\int P(x)\,dx} = e^{\int 1\,dx} = e^x

The integrating factor is exe^x.

Multiply through by exe^x:

exdydx+exy=e2xe^x \frac{dy}{dx} + e^x y = e^{2x}

The left side is the derivative of yexy \cdot e^x (that’s exactly why the IF works):

ddx(yex)=e2x\frac{d}{dx}(y \cdot e^x) = e^{2x}

Integrate both sides:

yex=e2xdx=e2x2+Cy \cdot e^x = \int e^{2x}\,dx = \frac{e^{2x}}{2} + C
y=e2x2ex+Cex=ex2+Cexy = \frac{e^{2x}}{2e^x} + \frac{C}{e^x} = \frac{e^x}{2} + Ce^{-x} y=ex2+Cex\boxed{y = \frac{e^x}{2} + Ce^{-x}}

where CC is an arbitrary constant.


Why This Works

The integrating factor method converts a non-exact equation into an exact one. When we multiply by ePdxe^{\int P\,dx}, the left side magically becomes the derivative of a product — ddx(yIF)\frac{d}{dx}(y \cdot \text{IF}). This lets us integrate both sides directly.

Why does ePdxe^{\int P\,dx} do the trick? Because ddx(yePdx)=ePdx(dydx+Py)\frac{d}{dx}(y \cdot e^{\int P\,dx}) = e^{\int P\,dx}\left(\frac{dy}{dx} + Py\right), which is exactly the left side of our equation multiplied by the IF. The product rule gives us this for free.


Alternative Method — Complementary Function + Particular Integral

For those familiar with the CF + PI approach (common in JEE):

CF: Solve dydx+y=0\frac{dy}{dx} + y = 0, which gives y=Cexy = Ce^{-x}.

PI: For Q(x)=exQ(x) = e^x, try yp=Aexy_p = Ae^x. Substituting: Aex+Aex=exAe^x + Ae^x = e^x, so 2A=12A = 1, giving A=1/2A = 1/2.

General solution: y=Cex+ex2y = Ce^{-x} + \frac{e^x}{2}. Same answer.

The CF + PI method is faster when Q(x)Q(x) is a standard form (eaxe^{ax}, sinbx\sin bx, polynomial). For CBSE boards, stick with the IF method — it’s what the marking scheme expects. For JEE, knowing both approaches saves time on different question types.


Common Mistake

Students often forget to divide by the IF at the end. After integrating, you have yex=e2x2+Cy \cdot e^x = \frac{e^{2x}}{2} + C. The final answer is y=ex2+Cexy = \frac{e^x}{2} + Ce^{-x}, not y=e2x2+Cy = \frac{e^{2x}}{2} + C. Always isolate yy — leaving the IF attached to yy in your final answer will cost you marks.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next