# What is the general solution of the differential equation  y'-2xy=x^3 ?

Jan 11, 2018

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

#### Explanation:

We have:

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

This is 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 can readily generate an integrating factor when we have an equation of this form, given by;

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

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

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

We can now integrate to get:

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

The RHS integral can be evaluated by an application of Integration By Parts (omitted) which gives us:

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

So we have:

${e}^{- {x}^{2}} y = - \frac{1}{2} \left({x}^{2} + 1\right) {e}^{- {x}^{2}} + C$

Using the initial condition $y \left(0\right) = 2$ we can evaluate the constant $C$

$2 {e}^{0} = - \frac{1}{2} \left(0 + 1\right) {e}^{0} + C \implies C = \frac{5}{2}$

${e}^{- {x}^{2}} y = - \frac{1}{2} \left({x}^{2} + 1\right) {e}^{- {x}^{2}} + \frac{5}{2}$
$\therefore y = - \frac{1}{2} \left({x}^{2} + 1\right) {e}^{- {x}^{2}} + \frac{5}{2 {e}^{- {x}^{2}}}$
$\setminus \setminus \setminus \setminus = - \frac{1}{2} \left({x}^{2} + 1\right) + \frac{5}{2} {e}^{{x}^{2}}$
$\setminus \setminus \setminus \setminus = \frac{5}{2} {e}^{{x}^{2}} - \frac{1}{2} {x}^{2} - \frac{1}{2}$