<s>[INST] A homogeneous differential equation. Solving by substitution: $\frac{dy}{dx} = \frac{y-x}{y+x}$ I think i'm stuck on this differential equation. I have a differential equation:
$\frac{dy}{dx} = \frac{y-x}{y+x}$
I need to find the implicit general solution. This is what I've done so far:
$dy(y+x) = dx(y-x)$
divide both sides by $x$ until we have each $y$ divided by $x$
$dy(\frac{y}{x} + 1) = dx(\frac{y}{x} - 1)$
Let $y = ux$. Therefore $y' = u'x + u$
 and $u = \frac{y}{x}$
I now have:
$dy(u + 1) = dx(u - 1)$
Therefore, 
$\frac{dy}{dx} = \frac{u-1}{u+1}$
$u'x + u = \frac{u-1}{u+1}$
$\frac{du}{dx}x = \frac{u-1}{u+1} - u$
In order to make this seperable I decided to make the RHS into one fraction first:
$= \frac{(u-1) - u(u+1)}{u+1} = \frac{-u^2 - 1}{u+1} = -\frac{u^2 + 1}{u+1} = -\frac{1}{u+1}(u^2 + 1)$
$\frac{dx}{xdu} = -(u+1)(\frac{1}{u^2 + 1})$
$\frac{dx}{x} = -(u+1)(\frac{1}{u^2 + 1})du$
Now integrate both sides and get:
$ln(x) + c = ...$
Now For RHS: $-\int(u+1)(\frac{1}{u^2 + 1}) du$
Using integration by parts, let $a = u+1, b' = \frac{1}{u^2 + 1}$
Where: $\int ab' = ab - \int bda$ 
We have $b = arctan(u), a' = 1$
RHS = $uarctan(u) + arctan(u) - \int arctan(u)$
$=uarctan(u) + arctan(u) - (uarctan(u) - \frac{1}{2}ln|u^2 + 1|)$
RHS = $arctan(u) + \frac{1}{2}ln|u^2 + 1|$
Therefore the solution to our differential equation in terms of $u$ is:
$ln(x) + C = arctan(u) + \frac{1}{2}ln|u^2 + 1|$
Substituting back in, the implicit solution is:
$ln(x) + C = arctan(\frac{y}{x}) + \frac{1}{2}ln|\frac{y^2}{x^2} + 1|$
Yet in my answer book the answer is
$ln(x^2 + y^2) + 2arctan(\frac{y}{x}) = c$
Where did I go wrong?
 [/INST] You forgot a negative sign on the right hand side.
Your RHS should have been $$RHS =  -arctan(u) - \frac{1}{2}ln|u^2 + 1|$$
That will take care of the difference between your answer and the book's anwwer.
</s>