What is the general solution of the differential equation  y'=y/x+xe^x ?

Dec 23, 2017

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

Explanation:

We seek a solution to the First Order ODE:

$y ' = \frac{y}{x} + x {e}^{x}$

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 rewrite the equations in standard form as:

$\frac{\mathrm{dy}}{\mathrm{dx}} - \frac{y}{x} = x {e}^{x} \ldots . . \left[1\right]$

Then the integrating factor is given by;

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

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

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

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

Which we can directly integrate to get:

$\frac{y}{x} = \int \setminus {e}^{x} + C$

$\therefore \frac{y}{x} = {e}^{x} + C$

$\therefore y = x {e}^{x} + C x$