# How do you solve xy'+2y=4x^2 given y(1)=0?

May 9, 2017

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

#### Explanation:

We have:

$x y ' + 2 y = 4 {x}^{2}$

Which we can write as:

$y ' + \frac{2}{x} y = 4 x \setminus \setminus \setminus \setminus \ldots \ldots \left[1\right]$

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

Then the integrating factor is given by;

$I F = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\text{ } = \exp \left(\int \setminus \frac{2}{x} \setminus \mathrm{dx}\right)$
$\text{ } = \exp \left(2 \ln x\right)$
$\text{ } = {e}^{\ln {x}^{2}}$
$\text{ } = {x}^{2}$

And if we multiply the DE  by this Integrating Factor, $I F$, we will have a perfect product differential;

$y ' + \frac{2}{x} y = 4 x$

$\therefore {x}^{2} y ' + 2 x y = 4 {x}^{3}$

$\therefore \frac{d}{\mathrm{dx}} \left({x}^{2} y\right) = 4 {x}^{3}$

Which we can directly integrate to get:

$\int \setminus \frac{d}{\mathrm{dx}} \left({x}^{2} y\right) \setminus \mathrm{dx} = \int \setminus 4 {x}^{3} \setminus \mathrm{dx}$
$\therefore {x}^{2} y = {x}^{4} + C$

Applying the initial condition, $y \left(1\right) = 0$, we get:

$1 \cdot 0 = 1 + C \implies C = - 1$

Thus the solution is:

$\setminus {x}^{2} y = {x}^{4} - 1$
$\therefore y = {x}^{2} - \frac{1}{x} ^ 2$