# Separable Differential Equation with Initial Value?

## ${x}^{2} \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) = y - x y$ Initial condition : y(-1)=-1 This is what I separated it to $\left(\frac{\mathrm{dy}}{y}\right) = \frac{1 - x}{{x}^{2}} \mathrm{dx}$ After integration, I have: $\ln \left(y\right) = \frac{- x \ln \left(x\right) - 1}{x}$ I know that I will have to introduce "e," but I am getting tripped up here. Any help would be appreciated. Thanks!

Jun 3, 2018

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

#### Explanation:

We have:

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

Which we can write as:

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

So, as indicated, the ODE is separable, so we can "separate the variables" to get:

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

Both integrals are of standard functions, so we can directly integrate, to get:

$\ln | y | = - \frac{1}{x} - \ln | x | + A$

Using the initial condition $y \left(- 1\right) = - 1$ we have:

$\ln | - 1 | = - \frac{1}{- 1} - \ln | - 1 | + A \implies A = - 1$

Thus we have:

$\ln | y | = - \frac{1}{x} - \ln | x | + 1$

Noting that we can write $\ln e = 1$ we get:

$\ln | y | = - \frac{1}{x} - \ln e - \ln | x |$

$\therefore \ln | y | + \ln | x | + \ln e = - \frac{1}{x}$

$\therefore \ln | x y e | = - \frac{1}{x}$

$\therefore | x y e | = {e}^{- \frac{1}{x}}$

$\therefore | y | = \frac{{e}^{- \frac{1}{x}}}{e | x |}$

$\therefore | y | = \frac{{e}^{- \frac{1}{x} - 1}}{| x |}$