# How can i solve this differencial equation? : y'+x^2 y=x^2

Feb 21, 2018

$y = 1 + C {e}^{- \frac{1}{3} {x}^{3}}$

#### Explanation:

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)$

We have:

$y ' + {x}^{2} y = {x}^{2}$ ..... [1]

This is a First Order Ordinary Differential Equation in Standard Form. So we compute and integrating factor, $I$, using;

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

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

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

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

This has transformed our initial ODE into a Separable ODE, so we can now "separate the variables" to get::

$y {e}^{\frac{1}{3} {x}^{3}} = \int \setminus {x}^{2} {e}^{\frac{1}{3} {x}^{3}} \setminus \mathrm{dx} + C$

This is trivial to integrate, and we get:

$y {e}^{\frac{1}{3} {x}^{3}} = {e}^{\frac{1}{3} {x}^{3}} + C$

Leading to the explicit General Solution:

$y = {e}^{- \frac{1}{3} {x}^{3}} \left\{{e}^{\frac{1}{3} {x}^{3}} + C\right\}$
$\setminus \setminus = 1 + C {e}^{- \frac{1}{3} {x}^{3}}$

Feb 21, 2018

A simpler method to the one given in the other answer

#### Explanation:

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

This is a separable ODE

$\frac{\mathrm{dy}}{\mathrm{dx}} = {x}^{2} - {x}^{2} y = {x}^{2} \left(1 - y\right)$

$\Rightarrow \int \frac{1}{1 - y} \mathrm{dy} = \int {x}^{2} \mathrm{dx}$

$\Rightarrow - \ln | 1 - y | = \frac{1}{3} {x}^{3} + \text{c}$

$1 - y = B {e}^{\frac{1}{3} {x}^{3}}$ where $B = {e}^{- \text{c}}$

$y = 1 + A {e}^{\frac{1}{3} {x}^{3}}$ where $A = - B$