# What is a general solution to the differential equation y=y+2xe^(2x)?

Aug 26, 2016

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

#### Explanation:

assuming a typo, i think you have

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

that's not separable so we write it in this form

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

OR

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

and we use an integrating factor $\eta \left(x\right)$ to make the equation exact on the LHS

$\eta \left(x\right) = {e}^{\int \setminus \left(- 1\right) \mathrm{dx}} = {e}^{- x}$, note the pattern

Now multiply every term by $\eta$

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

and magically the LHS is now very useful

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

so

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

time for a spot of IBP

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

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

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

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

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

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

The theory is as follows

For an equation in form

$y ' + f \left(x\right) y = g \left(x\right)$

using our mysterious integrating factor $\eta \left(x\right)$, we have
$\eta \left(x\right) y ' + \textcolor{red}{\eta \left(x\right) f \left(x\right) y} = \eta \left(x\right) g \left(x\right)$

we then think wouldn't it have handy if the stuff in red was equal to $\eta ' \left(x\right)$

because it would then be a case of

$\eta \left(x\right) y ' + \textcolor{red}{\eta \left(x\right) f \left(x\right)} y = \eta \left(x\right) g \left(x\right)$

$\implies \eta \left(x\right) y ' + \textcolor{red}{\eta ' \left(x\right)} y = \eta \left(x\right) g \left(x\right)$

and by the product rule

$\implies \frac{d}{\mathrm{dx}} \left(\eta \left(x\right) y\right) = \eta \left(x\right) g \left(x\right)$

and so
$\eta \left(x\right) y = \int \setminus \eta \left(x\right) g \left(x\right) \setminus \mathrm{dx}$

so we want

$\eta ' \left(x\right) = \eta \left(x\right) f \left(x\right)$

we can separate the variables here

$\frac{\eta ' \left(x\right)}{\eta \left(x\right)} = f \left(x\right)$

and integrate

$\int \setminus \frac{\eta ' \left(x\right)}{\eta \left(x\right)} \setminus \mathrm{dx} = \int f \left(x\right) \setminus \mathrm{dx}$

$\ln \left(\eta \left(x\right)\right) = \int f \left(x\right) \setminus \mathrm{dx}$

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