Differential Equations: Edge Cases and Subtle Traps (7)

easy 2 min read

Question

Solve the differential equation dydx+y=ex\dfrac{dy}{dx} + y = e^x.

Solution — Step by Step

This is a linear first-order ODE: dydx+P(x)y=Q(x)\dfrac{dy}{dx} + P(x)y = Q(x) with P(x)=1P(x) = 1 and Q(x)=exQ(x) = e^x.

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

Multiplying both sides 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:

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

Integrate both sides:

yex=e2x2+Cy \cdot e^x = \frac{e^{2x}}{2} + C

y=ex2+Cexy = \frac{e^x}{2} + C e^{-x}

Final answer: y=ex2+Cexy = \dfrac{e^x}{2} + C e^{-x}.

Why This Works

The integrating factor trick converts a linear first-order ODE into something we can integrate directly. After multiplying by ePdxe^{\int P\, dx}, the left side becomes the exact derivative of yy times the integrating factor. Then a single integration gives the solution.

This method works for any linear first-order ODE of the form above. The art lies in spotting that the equation is linear and identifying PP and QQ correctly.

Alternative Method

Find the homogeneous solution by solving dy/dx+y=0dy/dx + y = 0: yh=Cexy_h = Ce^{-x}. Then guess a particular solution of the form yp=Aexy_p = Ae^x (matching the right side). Substituting: Aex+Aex=exAe^x + Ae^x = e^x, so A=1/2A = 1/2. General solution: y=Aex/2+Cexy = Ae^x/2 + Ce^{-x}. Same answer.

This method (homogeneous + particular) is what we use for higher-order linear ODEs in JEE Advanced.

Edge case: if the equation is dy/dx+y=0dy/dx + y = 0 alone, the answer is y=Cexy = Ce^{-x}. Students sometimes write y=ex+Cy = e^{-x} + C — wrong, because CC should multiply, not add.

Common Mistake

Forgetting to multiply Q(x)Q(x) by the integrating factor before integrating. The correct integrand is IF ×Q(x)=ex×ex=e2x\times Q(x) = e^x \times e^x = e^{2x}, not just exe^x. Always multiply both sides by the IF before stepping into the integral.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next