# Solve the differential equation  (2y-x)dy/dx=2x+y where y=3 when x=2?

Jul 12, 2017

See below.

#### Explanation:

Making $y = \lambda x$ we have

$\mathrm{dy} = x \mathrm{dl} a m b \mathrm{da} + \lambda \mathrm{dx}$ and substituting

$x \mathrm{dl} a m b \mathrm{da} + \lambda \mathrm{dx} = \left(\frac{2 + \lambda}{2 \lambda - 1}\right) \mathrm{dx}$ or

$x \mathrm{dl} a m b \mathrm{da} = \left(\left(\frac{2 + \lambda}{2 \lambda - 1}\right) - \lambda\right) \mathrm{dx}$ or

$\frac{\mathrm{dx}}{x} = - \frac{1}{2} \frac{2 \lambda - 1}{{\lambda}^{2} - \lambda - 1} \mathrm{dy}$ and after integrating both sides

$\log x = - \frac{1}{2} \log \left(2 \left(1 + \lambda - {\lambda}^{2}\right)\right) + C$ or

$x = {C}_{0} / \sqrt{2 \left(1 + \lambda - {\lambda}^{2}\right)}$ or

$\frac{1}{2} {\left({C}_{0} / x\right)}^{2} = 1 + \lambda - {\lambda}^{2}$ and solving for $\lambda$

$\lambda = \frac{{x}^{2} \pm \sqrt{5 {x}^{4} - 2 {C}_{0}^{2} {x}^{2}}}{2 {x}^{2}} = \frac{y}{x}$ and finally

$y = x \left(\frac{{x}^{2} \pm \sqrt{5 {x}^{4} - 2 {C}_{0}^{2} {x}^{2}}}{2 {x}^{2}}\right) =$

and simplifying

$y = \frac{1}{2} \left(x \pm \sqrt{5 {x}^{2} - 2 {C}_{0}^{2}}\right)$

For initial conditions we have

$3 = \frac{1}{2} \left(2 \pm \sqrt{20 - 2 {C}_{0}^{2}}\right)$ we have

${C}_{0} = \pm \sqrt{2}$ and finally

$y = \frac{1}{2} \left(x \pm \sqrt{5 {x}^{2} - 4}\right)$

Jul 12, 2017

${y}^{2} - x y - {x}^{2} + 1 = 0$

#### Explanation:

We have:

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

We can rearrange this Differential Equation as follows:

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

So Let us try a substitution, Let:

$v = \frac{y}{x} \implies y = v x$

Then:

$\frac{\mathrm{dy}}{\mathrm{dx}} = v + x \frac{\mathrm{dv}}{\mathrm{dx}}$

And substituting into the above DE, to eliminate $y$:

$v + x \frac{\mathrm{dv}}{\mathrm{dx}} = \frac{2 + v}{2 v - 1}$

$\therefore x \frac{\mathrm{dv}}{\mathrm{dx}} = \frac{2 + v}{2 v - 1} - v$
$\therefore \text{ } = \frac{\left(2 + v\right) - v \left(2 v - 1\right)}{2 v - 1}$
$\therefore \text{ } = \frac{2 + v - 2 {v}^{2} + v}{2 v - 1}$
$\therefore \text{ } = \frac{2 + 2 v - 2 {v}^{2}}{2 v - 1}$
$\therefore \text{ } = - \frac{2 \left({v}^{2} - v - 1\right)}{2 v - 1}$

$\therefore \frac{2 v - 1}{{v}^{2} - v - 1} \setminus \frac{\mathrm{dv}}{\mathrm{dx}} = - \frac{2}{x}$

This is now a separable DIfferential Equation, and so "separating the variables" gives us:

$\int \setminus \frac{2 v - 1}{{v}^{2} - v - 1} \setminus \mathrm{dv} = - \int \setminus \frac{2}{x} \setminus \mathrm{dx}$

This is now a trivial integration problem, thus:

$\ln \left({v}^{2} - v - 1\right) = - 2 \ln x + \ln A$
$\text{ } = \ln \frac{A}{x} ^ 2$

$\therefore {v}^{2} - v - 1 = \frac{A}{x} ^ 2$

And restoring the substitution we get:

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

Using $y = 3$ when $x = 2$:

$\frac{9}{4} - \frac{3}{2} - 1 = \frac{A}{4} \implies A = - 1$

Thus:

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