First, divide the equation through by x to get $\displaystyle \,dx +\left(\frac{y}{x}-2\right)\,dy=0$

Now applying the substitution $\displaystyle y=ux\implies \,dy=u\,dx+x\,du$, we see that the DE becomes

$\displaystyle \,dx+\left(u-2\right)\left(u\,dx+x\,du\right)=0\implies \,dx+u^2\,dx+ux\,du-2u\,dx-2x\,du=0$ $\displaystyle \implies -\left(u^2-2u+1\right)\,dx=\left(u-2\right)x\,du$

Now separating the variables, we have $\displaystyle -\frac{\,dx}{x}=\frac{u-2}{\left(u-1\right)^2}\,du$

Now we integrate. The LHS becomes $\displaystyle -\ln x + C$.

Now we need to do some manipulation on the RHS.

Note that $\displaystyle \frac{u-2}{\left(u-1\right)^2}=\frac{u-1}{\left(u-1\right)^2}-\frac{1}{\left(u-1\right)^2}=\frac{1}{u-1}-\frac{1}{\left(u-1\right)^2}$. Now when we integrate wrt u, we have $\displaystyle \ln\!\left|u-1\right|+\frac{1}{u-1}+C$.

So it turns out that we have $\displaystyle -\ln x + C=\ln\!\left|u-1\right|+\frac{1}{u-1}+C\implies -\ln x= \ln\!\left|u-1\right|+\frac{1}{u-1}+K$.

Backsubstituting $\displaystyle u=\frac{y}{x}$, we have $\displaystyle -\ln x=\ln\!\left|\frac{y}{x}-1\right|+\frac{1}{\frac{y}{x}-1}+K\implies -\ln x=\ln\!\left|y-x\right|-\ln x+\frac{x}{y-x}+K$

Continuing with the simplification, we have $\displaystyle \frac{x}{x-y}+K=\ln\!\left|x-y\right|\implies {\color{red}x}\,+K\left(x-y\right)=\left(x-y\right)\ln\!\left|x-y\right|$

Hmm...

My solution and the books solution disagree...due to one variable...XD

Are you sure you copied it down correctly?