Skip to content
Worked Examples · Example 15

Q.Find the general solution of the differential equation xdydx+2y=x2x\frac{dy}{dx} + 2y = x^2 (x≠0)(x \neq 0).

Yanam CbseNCERTSubjective· 3mImportance★★★★★
28% · 62/222 Questions
✓ Free question

This is a first-order linear ODE solved using the integrating factor method. The general solution is y=x24+Cx2y = \frac{x^2}{4} + \frac{C}{x^2}.

The equation xdydx+2y=x2x\frac{dy}{dx} + 2y = x^2 is a first-order linear differential equation. The key idea: we can rewrite it in the standard form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x) and then multiply both sides by an integrating factor — a function that turns the left-hand side into a perfect derivative of a product. This trick works because the derivative of a product always gives two terms, just like the left side of our equation.

Let’s walk through it.

  1. Rewrite in standard form. Divide through by xx (allowed since x≠0x \neq 0):

dydx+2xy=x\frac{dy}{dx} + \frac{2}{x}y = x

Here P(x)=2xP(x) = \frac{2}{x} and Q(x)=xQ(x) = x.

  1. Find the integrating factor. The integrating factor μ(x)\mu(x) is given by e∫P(x) dxe^{\int P(x)\,dx}.

∫2x dx=2log⁡∣x∣=log⁡(x2)\int \frac{2}{x}\,dx = 2\log|x| = \log(x^2)

So μ(x)=elog⁡(x2)=x2\mu(x) = e^{\log(x^2)} = x^2.

Tip

You can drop the absolute value because x≠0x \neq 0 and the constant of integration is absorbed later — we only need one integrating factor.

  1. Multiply the ODE by μ(x)\mu(x).

x2⋅dydx+x2⋅2xy=x2⋅xx^2 \cdot \frac{dy}{dx} + x^2 \cdot \frac{2}{x}y = x^2 \cdot x

Simplify:

x2dydx+2xy=x3x^2\frac{dy}{dx} + 2xy = x^3

  1. Recognise the left side as a derivative. Notice that ddx(x2y)=x2dydx+2xy\frac{d}{dx}(x^2 y) = x^2\frac{dy}{dx} + 2xy. Exactly our left side! So the equation becomes:

ddx(x2y)=x3\frac{d}{dx}(x^2 y) = x^3

  1. Integrate both sides.

∫ddx(x2y) dx=∫x3 dx\int \frac{d}{dx}(x^2 y)\,dx = \int x^3\,dx

x2y=x44+Cx^2 y = \frac{x^4}{4} + C

where CC is the constant of integration.

  1. Solve for yy. Divide by x2x^2:

y=x24+Cx2y = \frac{x^2}{4} + \frac{C}{x^2}

Watch out

A common mistake is forgetting the constant CC or dividing by x2x^2 without noting x≠0x \neq 0 — but the problem already states that, so we’re safe.

✓Final answer

The general solution is y=x24+Cx2y = \frac{x^2}{4} + \frac{C}{x^2}.

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.