# What is a general solution to the differential equation y'+2xy=2x^3?

Jul 26, 2016

The Gen. Soln. is,

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

#### Explanation:

This is a Linear Diff. Eqn. $: \frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) \cdot y = Q \left(x\right) \ldots \ldots \ldots \ldots \ldots \left(1\right)$,

where, $P \left(x\right)$ and $Q \left(x\right)$ are funs. of variable $x$.

To find its Gen. Soln. , we have to multiply it by, Integrating

Factor given by, $I . F . = {e}^{\int P \left(x\right) \mathrm{dx}}$.

Comparing the given diff. eqn. with $\left(1\right)$, we have,

$P \left(x\right) = 2 x \Rightarrow \int P \left(x\right) \mathrm{dx} = \int 2 x \mathrm{dx} = {x}^{2} \Rightarrow I . F . = {e}^{{x}^{2}}$.

Multiplying the eqn. throughout by $I , F .$, we get,

${e}^{{x}^{2}} \frac{\mathrm{dy}}{\mathrm{dx}} + 2 x y {e}^{{x}^{2}} = 2 {x}^{3} {e}^{{x}^{2}}$

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

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

$\therefore y \cdot {e}^{{x}^{2}} = \int 2 {x}^{3} {e}^{{x}^{2}} \mathrm{dx} \ldots \ldots \ldots \ldots \left(2\right)$

To evaluate the integral, say $I$, on $R . H . S .$, we will subst.,

${x}^{2} = t$, so that, $2 x \mathrm{dx} = \mathrm{dt}$.

$\therefore I = \int t {e}^{t} \mathrm{dt}$

=tinte^tdt-int[(d/dt(t)*inte^tdt]dt............[IBP]

$= t {e}^{t} - \int {e}^{t} \mathrm{dt} = t {e}^{t} - {e}^{t} = \left(t - 1\right) {e}^{t} = \left({x}^{2} - 1\right) {e}^{{x}^{2}} + C$.

By $\left(2\right)$, then, the Gen. Soln. is,

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

Jul 26, 2016

$y = {x}^{2} - 1 + C {e}^{- {x}^{2}}$

#### Explanation:

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

this is not separable. we can use an integrating factor $\eta \left(x\right)$

here $\eta = \exp \left(\int 2 x \setminus \mathrm{dx}\right) = {e}^{{x}^{2}}$

so
${e}^{{x}^{2}} y ' + {e}^{{x}^{2}} 2 x y = {e}^{{x}^{2}} 2 {x}^{3}$

or

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

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

${e}^{{x}^{2}} y = \int \setminus \frac{d}{\mathrm{dx}} \left({e}^{{x}^{2}}\right) {x}^{2} \mathrm{dx}$

using IBP

${e}^{{x}^{2}} y = {x}^{2} {e}^{{x}^{2}} - \int \setminus {e}^{{x}^{2}} \frac{d}{\mathrm{dx}} \left({x}^{2}\right) \mathrm{dx}$

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

and spotting the pattern in the integrand

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

${e}^{{x}^{2}} y = {x}^{2} {e}^{{x}^{2}} - {e}^{{x}^{2}} + C$

$y = {x}^{2} - 1 + C {e}^{- {x}^{2}}$