# What is a solution to the differential equation dy/dx=(x+y)/(x-y)?

Jul 23, 2016

$\frac{1}{2} \ln \left({\left(\frac{y}{x}\right)}^{2} + 1\right) - \arctan \left(\frac{y}{x}\right) = - \ln x + C$

#### Explanation:

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

this is first order linear and homogeneous in the sense that when written in the form $\frac{\mathrm{dy}}{\mathrm{dx}} = f \left(x , y\right)$ then

$f \left(k x , k y\right) = f \left(x , y\right)$

so we re-write it as $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{1 + \frac{y}{x}}{1 - \frac{y}{x}}$

in order to make the standard sub $v \left(x\right) = \frac{y \left(x\right)}{x}$

because $y = v x$, then $y ' = v ' x + v$

so we have

$v ' x + v = \frac{1 + v}{1 - v}$ and we may as well now separate it out

$v ' x = - v + \frac{1 + v}{1 - v}$

$= \frac{- v \left(1 - v\right) + 1 + v}{1 - v}$

$\implies v ' x = \frac{{v}^{2} + 1}{1 - v}$

$\frac{v - 1}{{v}^{2} + 1} v ' = - \frac{1}{x}$

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

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

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

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

$\frac{1}{2} \ln \left({\left(\frac{y}{x}\right)}^{2} + 1\right) - \arctan \left(\frac{y}{x}\right) = - \ln x + C$

horrible