# What is a solution to the differential equation? : dy/dx + (1-2x)/x^2*y = 1 when y|_(x=1)=0

May 13, 2018

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

#### Explanation:

We have:

$\frac{\mathrm{dy}}{\mathrm{dx}} + \frac{1 - 2 x}{x} ^ 2 y = 1$ and $y \left(1\right) = 0$

We can use an integrating factor when we have 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)$

So we compute and integrating factor, $I$, using;

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

And if we multiply the original DE by this Integrating Factor, $I$, we will have (by design) a perfect product differential;

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

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

This has transformed our initial ODE into a Separable ODE, so we can now "separate the variables" to get::

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

We can integrate, and we get:

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

We now apply the initial conditions, $y \left(1\right) = 0$ to gte:

$0 = {e}^{- 1} + C \implies C = - {e}^{- 1}$

Leading to the Particular Solution is:

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

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

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

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