# What is a solution to the differential equation (x+1)y'-2(x^2+x)y=e^(x^2)/(x+1) where x>-1 and y(0)=5?

Jun 24, 2016

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

#### Explanation:

The differential equation is first order linear nonhomogeneus. In this case the solution is composed from the homogeneus solution ${y}_{h} \left(x\right)$ and a particular solution ${y}_{p} \left(x\right)$.

$\left(x + 1\right) y {'}_{h} \left(x\right) - 2 \left({x}^{2} + x\right) y \left(x\right) = 0$
$\left(x + 1\right) y {'}_{p} \left(x\right) - 2 \left({x}^{2} + x\right) {y}_{p} \left(x\right) = {e}^{{x}^{2}} / \left(x + 1\right)$

Finally

$y \left(x\right) = {y}_{h} \left(x\right) + {y}_{p} \left(x\right)$

1) Obtaining the homogeneus solution ${y}_{h} \left(x\right)$
Simplifying we obtain

$y {'}_{h} \left(x\right) - 2 x \times {y}_{h} \left(x\right) = 0$

grouping variables

$\frac{y {'}_{h} \left(x\right)}{{y}_{h} \left(x\right)} = 2 x$

The solution is

${\log}_{e} \left({y}_{h} \left(x\right)\right) = {x}^{2} + {C}_{0} \to {y}_{h} \left(x\right) = {C}_{1} {e}^{{x}^{2}}$

2) Obtaining the particular solution ${y}_{p} \left(x\right)$
For this purpose we will suppose that

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

This method was due to Euler and Lagrange and can be seen in
https://en.wikipedia.org/wiki/Variation_of_parameters

Introducing ${y}_{p} \left(x\right)$ into the complete equation we obtain after simplifications

${e}^{{x}^{2}} \left(1 + x\right) C {'}_{1} \left(x\right) = {e}^{{x}^{2}} / \left(1 + x\right)$

Solving for ${C}_{1} \left(x\right)$ we obtain

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

Now, putting all together

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

With the initial conditions we find the ${C}_{2}$ value as

$y \left(0\right) = \left({C}_{2} - 1\right) = 5 \to {C}_{1} = 6$

Jun 25, 2016

$= {e}^{{x}^{2}} \left(\frac{6 x + 5}{x + 1}\right)$

#### Explanation:

this is linear so we can start by just moving stuff around.

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

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

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

we solve with inregrating factor $I = \exp \left(- 2 \int \setminus x \setminus \mathrm{dx}\right) = {e}^{- {x}^{2}}$

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

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

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

${e}^{- {x}^{2}} \cdot y = - \frac{1}{x + 1} + \alpha$

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

From $y \left(0\right) = 5$

$5 = 1 \cdot \left(- \frac{1}{1} + \alpha\right) \setminus \implies \alpha = 6$

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

$= {e}^{{x}^{2}} \left(\frac{6 x + 5}{x + 1}\right)$