# What is a solution to the linear differential equation: dy/dx= y/x+x?

Apr 17, 2018

$y = c x + {x}^{2}$

#### Explanation:

Solve first the homogeneous equation that is separable:

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

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

Integrate both sides:

$\int \frac{\mathrm{dy}}{y} = \int \frac{\mathrm{dx}}{x}$

$\ln \left\mid y \right\mid = \ln \left\mid x \right\mid + C$

and taking the exponential of both sides:

$y = c x$

Use now the variable coefficient method to find a solution to the compete equation in the form;

$\overline{y} = c \left(x\right) x$

Differentiate using the product rule:

$\frac{\mathrm{db} a r y}{\mathrm{dx}} = x c ' \left(x\right) + c \left(x\right)$

and substitute in the original equation:

$\frac{\mathrm{db} a r y}{\mathrm{dx}} = \frac{\overline{y}}{x} + x$

$x c ' \left(x\right) + c \left(x\right) = \frac{c \left(x\right) x}{x} + x$

$x c ' \left(x\right) + c \left(x\right) = c \left(x\right) + x$

$x c ' \left(x\right) = x$

$c ' \left(x\right) = 1$

$\int c ' \left(x\right) \mathrm{dx} = \int \mathrm{dx}$

$c \left(x\right) = x$

and we do not need the constant because we can choose just one solution:

$\overline{y} = c \left(x\right) x = {x}^{2}$

Then the complete solution of the equation is:

$y = c x + {x}^{2}$

In fact:

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

Apr 18, 2018

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

#### Explanation:

We have:

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

Which we can write as:

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

Which is of the form:

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

So, we can construct an Integrating Factor:

 I = exp(int \ P(x) \ 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{1}{x} ^ 2 y = 1$

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

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

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

Which is trivial to integrate:

$\frac{y}{x} = x + C$

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