What is the general solution of the differential equation (1+x^2)dy/dx + xy = x ?

Sep 19, 2017

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

Explanation:

We have:

$\left(1 + {x}^{2}\right) \frac{\mathrm{dy}}{\mathrm{dx}} + x y = x$ ..... [A]

We can rearrange this First Order differential equation as follows:

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

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

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

This is now separable, so we can "seperate the variables" to get:

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

We can now integrate to get:

$- \ln | y - 1 | = \frac{1}{2} \ln | {x}^{2} + 1 | + \ln A$
$\text{ } = \ln \sqrt{{x}^{2} + 1} + \ln A$
$\text{ } = \ln A \sqrt{{x}^{2} + 1}$

And so:

$\ln | y - 1 | = \ln \left(\frac{1}{A \sqrt{{x}^{2} + 1}}\right)$

Taking exponentials (or anti-logarithms) and noting that the logarithm argument of the RHS must be positive, we have:

$y - 1 = \frac{1}{A \sqrt{{x}^{2} + 1}}$

$y = \frac{1}{A \sqrt{{x}^{2} + 1}} + 1$
$y = \frac{C}{\sqrt{{x}^{2} + 1}} + 1$