Math Lab
Home/Class XII/Ch 9/Linear differential equations

Linear differential equations

The form dydx+P(x) y=Q(x)\frac{dy}{dx} + P(x)\,y = Q(x) is a first-order linear differential equation in yy. Linear here means yy and dydx\dfrac{dy}{dx} appear to first power only , no y2y^2, no sin⁡y\sin y. The functions PP and QQ depend only on xx.

This is among the most useful DE forms in applied work , it models RC and RL circuits, mixing problems with constant flow, motion under linear drag, and many growth problems with constant input rates.

The integrating-factor idea

Suppose we multiply both sides by a function μ(x)\mu(x) , the integrating factor: μ(x)dydx+μ(x)P(x) y=μ(x)Q(x).\mu(x)\frac{dy}{dx} + \mu(x) P(x)\,y = \mu(x) Q(x). The left side resembles the derivative of a product ddx(μy)=μy′+μ′y\dfrac{d}{dx}(\mu y) = \mu y' + \mu' y, provided μ′=μP\mu' = \mu P. Solving this for μ\mu: dμμ=P dx\dfrac{d\mu}{\mu} = P\,dx, so μ=e∫P(x) dx\mu = e^{\int P(x)\,dx}.

So the integrating factor is μ(x)=e∫P(x) dx.\mu(x) = e^{\int P(x)\,dx}. After multiplying, the equation becomes ddx(μy)=μQ\dfrac{d}{dx}(\mu y) = \mu Q, which integrates directly: μ(x)y=∫μ(x)Q(x) dx+C,y=1μ(x)[∫μ(x)Q(x) dx+C].\mu(x) y = \int \mu(x) Q(x)\,dx + C, \qquad y = \frac{1}{\mu(x)}\left[\int \mu(x) Q(x)\,dx + C\right].

The procedure

  1. Put the equation in standard form dydx+P(x)y=Q(x)\dfrac{dy}{dx} + P(x) y = Q(x) , coefficient of dydx\dfrac{dy}{dx} must be 11.
  2. Compute P(x)P(x) and the integrating factor μ(x)=e∫P dx\mu(x) = e^{\int P\,dx}.
  3. Multiply both sides by μ\mu.
  4. Recognise the left side as ddx[μy]\dfrac{d}{dx}[\mu y].
  5. Integrate both sides; solve for yy.

When the roles swap: linear in xx

Sometimes a DE is not linear in yy but is linear in xx. The form dxdy+P(y) x=Q(y)\frac{dx}{dy} + P(y)\,x = Q(y) is solved identically , treating xx as the dependent variable and yy as the independent variable. Integrating factor: μ(y)=e∫P(y) dy\mu(y) = e^{\int P(y)\,dy}.

You should always test both forms when the obvious arrangement fails.

Worked examples

Example 1. Solve dydx+y=ex\dfrac{dy}{dx} + y = e^x.

Here P=1P = 1, Q=exQ = e^x. μ=ex\mu = e^x. Multiply: exy′+exy=e2xe^x y' + e^x y = e^{2x}, i.e. (exy)′=e2x(e^x y)' = e^{2x}. Integrate: exy=e2x2+Ce^x y = \dfrac{e^{2x}}{2} + C, so y=ex2+Ce−xy = \dfrac{e^x}{2} + C e^{-x}.

Example 2. Solve dydx+yx=x2\dfrac{dy}{dx} + \dfrac{y}{x} = x^2.

P=1/xP = 1/x, μ=e∫dx/x=eln⁡∣x∣=∣x∣\mu = e^{\int dx/x} = e^{\ln|x|} = |x|, take μ=x\mu = x (positive branch). Multiply: xy′+y=x3xy' + y = x^3, i.e. (xy)′=x3(xy)' = x^3. Integrate: xy=x44+Cxy = \dfrac{x^4}{4} + C, so y=x34+Cxy = \dfrac{x^3}{4} + \dfrac{C}{x}.

Example 3. Solve dydx+ytan⁡x=sec⁡x\dfrac{dy}{dx} + y \tan x = \sec x.

P=tan⁡xP = \tan x, ∫tan⁡x dx=ln⁡∣sec⁡x∣\int \tan x\,dx = \ln|\sec x|, so μ=sec⁡x\mu = \sec x. Multiply: sec⁡x⋅y′+ysec⁡xtan⁡x=sec⁡2x\sec x \cdot y' + y \sec x \tan x = \sec^2 x, i.e. (sec⁡x⋅y)′=sec⁡2x(\sec x \cdot y)' = \sec^2 x. Integrate: sec⁡x⋅y=tan⁡x+C\sec x \cdot y = \tan x + C, so y=sin⁡x+Ccos⁡xy = \sin x + C \cos x.

Example 4. Solve (x+y)dydx=1(x + y)\dfrac{dy}{dx} = 1.

Rewrite: dydx=1x+y\dfrac{dy}{dx} = \dfrac{1}{x + y}, then flip: dxdy=x+y\dfrac{dx}{dy} = x + y, i.e. dxdy−x=y\dfrac{dx}{dy} - x = y. Linear in xx. P=−1P = -1, μ=e−y\mu = e^{-y}. Multiply: (e−yx)′=ye−y(e^{-y} x)' = y e^{-y}. Integrate (by parts): ∫ye−y dy=−ye−y−e−y+C\int y e^{-y}\,dy = -y e^{-y} - e^{-y} + C. So e−yx=−ye−y−e−y+Ce^{-y} x = -y e^{-y} - e^{-y} + C, giving x=−y−1+Ceyx = -y - 1 + C e^y.

Example 5. Solve dydx+2y=e3x\dfrac{dy}{dx} + 2y = e^{3x}, y(0)=1y(0) = 1.

P=2P = 2, μ=e2x\mu = e^{2x}. Multiply: (e2xy)′=e5x(e^{2x} y)' = e^{5x}. Integrate: e2xy=e5x5+Ce^{2x} y = \dfrac{e^{5x}}{5} + C, so y=e3x5+Ce−2xy = \dfrac{e^{3x}}{5} + C e^{-2x}. Apply IC: 1=15+C1 = \dfrac{1}{5} + C, so C=45C = \dfrac{4}{5}. Particular: y=e3x+4e−2x5y = \dfrac{e^{3x} + 4e^{-2x}}{5}.

Example 6. Solve xdydx−y=x2x\dfrac{dy}{dx} - y = x^2.

Divide by xx: dydx−yx=x\dfrac{dy}{dx} - \dfrac{y}{x} = x. P=−1/xP = -1/x, μ=e−ln⁡x=1/x\mu = e^{-\ln x} = 1/x. Multiply: 1xdydx−yx2=1\dfrac{1}{x}\dfrac{dy}{dx} - \dfrac{y}{x^2} = 1, i.e. (yx)′=1\left(\dfrac{y}{x}\right)' = 1. Integrate: yx=x+C\dfrac{y}{x} = x + C, so y=x2+Cxy = x^2 + Cx.

Try it yourself

  1. dydx+y=x\dfrac{dy}{dx} + y = x
  2. dydx+2xy=x\dfrac{dy}{dx} + 2xy = x
  3. dydx−yx=2x2\dfrac{dy}{dx} - \dfrac{y}{x} = 2x^2
  4. dydx+ycot⁡x=sin⁡2x\dfrac{dy}{dx} + y \cot x = \sin 2x
  5. (1+x2)dydx+2xy=4x2(1 + x^2)\dfrac{dy}{dx} + 2xy = 4x^2
  6. dydx+y=cos⁡x\dfrac{dy}{dx} + y = \cos x
  7. dydx−ytan⁡x=exsec⁡x\dfrac{dy}{dx} - y \tan x = e^x \sec x
  8. xdydx+y=xcos⁡xx\dfrac{dy}{dx} + y = x \cos x, y(π/2)=0y(\pi/2) = 0.
  9. dxdy+x=y\dfrac{dx}{dy} + x = y (linear in xx)
  10. (x+1)dydx−y=ex(x+1)2(x + 1)\dfrac{dy}{dx} - y = e^x (x + 1)^2
  11. dydx−2y=x2e2x\dfrac{dy}{dx} - 2y = x^2 e^{2x}
  12. dydx=y−xx\dfrac{dy}{dx} = \dfrac{y - x}{x} (rearrange to standard form)
  13. dydx−2ycot⁡2x=1−2xcot⁡2x−2csc⁡2x\dfrac{dy}{dx} - 2y \cot 2x = 1 - 2x \cot 2x - 2 \csc 2x
  14. Verify that for dydx+Py=QP\dfrac{dy}{dx} + P y = Q P, the answer is y=Q+Ce−∫P dxy = Q + C e^{-\int P\,dx} if QQ is constant.

Pitfalls and tricks

  • Always normalise to coefficient 11 on dydx\dfrac{dy}{dx} before computing PP.
  • μ=e∫P dx\mu = e^{\int P\,dx}. No constant of integration here , any antiderivative works (the constant just rescales μ\mu).
  • The product rule check. After multiplying by μ\mu, the left side must equal (μy)′(\mu y)'. Verify by expanding.
  • Linear in xx, not yy? When the natural form has nonlinearity in yy but linearity in xx, swap roles and proceed.
  • Don't forget +C+C when integrating μQ\mu Q. It generates the family of solutions.

Test Your Knowledge

Quick MCQ check on this chapter

Start Quiz →

AI Summary

Summarize this page in your favorite LLM