# What is the general solution of the differential equation  dy/dx- 2xy = x ?

Sep 19, 2017

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

#### Explanation:

We have:

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

Which we can write as:

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x y + x$
$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} = \left(2 y + 1\right) x$
$\therefore \frac{1}{2 y + 1} \frac{\mathrm{dy}}{\mathrm{dx}} = x$

Which is a first order separable differential equation, so we can "separate the variables" to get:

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

Integrating we get, the General Solution:

$\frac{1}{2} \ln | 2 y + 1 | = \frac{1}{2} {x}^{2} + C$

Applying the initial condition $y \left(1\right) = 1$ we find:

$\frac{1}{2} \ln 3 = \frac{1}{2} + C \implies C = \frac{1}{2} \ln 3 - \frac{1}{2}$

So we can write an implicit particular solution as:

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

We typically require an explicit solution, so we can rearrange as follows:

$\ln | 2 y + 1 | = {x}^{2} + \ln 3 - 1$
$\therefore | 2 y + 1 | = {e}^{{x}^{2} + \ln 3 - 1}$

Noting that the exponential function is positive over its entire domain, (as ${e}^{x} > 0 \forall x \in \mathbb{R}$):

$2 y + 1 = {e}^{{x}^{2} - 1} {e}^{\ln 3}$

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

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