# What is the general solution of the differential equation dy/dx=y+x-1 ?

Mar 4, 2018

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

#### Explanation:

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)$

We have:

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

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} - y = x - 1$ ..... [1]

This is a First Order Ordinary Differential Equation in Standard Form. So we compute and integrating factor, $I$, using;

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

And if we multiply the DE [1] by this Integrating Factor, $I$, we will have a perfect product differential;

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

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

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

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

We can integrate, and we get:

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

Leading to the explicit General Solution:

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