# Linear diff eq - correctly done?

1. Jun 28, 2011

### Asphyxiated

1. The problem statement, all variables and given/known data

Solve the linear differential equation:

$$xy'-2y=x^{2}$$

2. Relevant equations

If you have a linear differential equation of the form:

$$y'+P(x)y=Q(x)$$

$$I(x)=e^{\int P(x) dx}$$

3. The attempt at a solution

If we divide both sides by x then the equation is in standard form:

$$y' - \frac {2y}{x} = x$$

where

$$P(x)=-\frac{2}{x}$$

thus:

$$I(x)=e^{\int -\frac{2}{x} dx} = e^{-2\int\frac{1}{x}dx}= e^{-2ln|x|}=x^{-2}$$

so we then multiple both sides of the diff eq by I(x):

$$x^{-2}y'-2x^{-3}y=\frac{1}{x}$$

which is:

$$\frac {d}{dx}(x^{-2}y)=\frac{1}{x}$$

if we the integrate both sides:

$$x^{-2}y=ln|x|+c$$

therefore:

$$y= x^{2}ln|x|+cx^{2}$$

2. Jun 28, 2011

### Char. Limit

Looks good to me.

3. Jun 28, 2011

### Staff: Mentor

Your solution is easy enough to check. Substitute your solution for y and take its derivative. When you evaluate xy' - 2y, you should get x2.