Differential Equations: Tricky Questions Solved (3)

hard 2 min read

Question

Solve the differential equation:

dydx+2yx=x2,y(1)=2\frac{dy}{dx} + \frac{2y}{x} = x^2, \quad y(1) = 2

Solution — Step by Step

The form is dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x) y = Q(x) with P(x)=2/xP(x) = 2/x and Q(x)=x2Q(x) = x^2. Linear first-order ODE — use the integrating factor method.

IF=eP(x)dx=e(2/x)dx=e2lnx=x2\text{IF} = e^{\int P(x) \, dx} = e^{\int (2/x) \, dx} = e^{2 \ln|x|} = x^2

Multiplying both sides by x2x^2:

x2dydx+2xy=x4x^2 \frac{dy}{dx} + 2x y = x^4

The left side is ddx(x2y)\frac{d}{dx}(x^2 y). So:

ddx(x2y)=x4\frac{d}{dx}(x^2 y) = x^4

x2y=x55+Cx^2 y = \frac{x^5}{5} + C

At x=1x = 1, y=2y = 2: 12=15+C1 \cdot 2 = \frac{1}{5} + C, so C=215=95C = 2 - \frac{1}{5} = \frac{9}{5}.

y=x35+95x2\boxed{y = \frac{x^3}{5} + \frac{9}{5 x^2}}

Final answer: y=x35+95x2y = \frac{x^3}{5} + \frac{9}{5 x^2}.

Why This Works

The integrating factor μ(x)=ePdx\mu(x) = e^{\int P \, dx} converts the left side into the derivative of a product, ddx(μy)\frac{d}{dx}(\mu y). Once that happens, integrating both sides gives the solution directly.

The trick is spotting the linear form. Some equations don’t look linear at first but become linear after a substitution like u=y2u = y^2 or u=1/yu = 1/y — those are Bernoulli equations.

Alternative Method

For some equations, separation of variables is simpler. But this one has a yy term not multiplied by a function of yy, so separation fails. The IF method is essentially the only clean approach.

When you see dydx+(stuff in x)y=(stuff in x)\frac{dy}{dx} + (\text{stuff in } x) \cdot y = (\text{stuff in } x), the IF method works mechanically. Just remember: IF=eP(x)dx\text{IF} = e^{\int P(x) dx}, multiply through, recognise the derivative, integrate, divide by IF.

Common Mistake

Students often forget the x|x| inside the logarithm: 2/xdx=2lnx\int 2/x \, dx = 2\ln|x|. The absolute value matters when x<0x < 0. Also: some forget that elnu=ue^{\ln u} = u (not ueu^e or anything weird) — that’s how the IF simplifies to x2x^2.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next