<s>[INST] Problems with an exact differential eqution Consider the following differential equation
$$
\left(\frac{1}{x}-\frac{y^2}{(x-y)^2}\right)dx=\left(\frac{1}{y}-\frac{x^2}{(x-y)^2}\right)dy
$$ 
I want  to find its general solution. I get that this equation is exact but, I trying to solve it for this method and it seems not  work. Can someone give me a hit? 
 [/INST] The differential is indeed exact
$$\left(\frac{1}{x}-\frac{y^2}{(x-y)^2}\right)dx-\left(\frac{1}{y}-\frac{x^2}{(x-y)^2}\right)dy=0$$
Note that
$$\frac {dx}x=d\ln (x)$$
$$\frac {dy}y=d\ln (y)$$
And also that
$$
\begin{align}
E=&-\frac{y^2}{(x-y)^2}dx+\frac{x^2}{(x-y)^2}dy \\
E=&\frac{-y^2dx+x^2dy}{(x-y)^2}\\
E=&\frac{-y^2dx+x^2dy}{x^2y^2}\frac {(xy)^2}{(x-y)^2}\\
E=&(d(\frac 1x- \frac 1y))\frac {(xy)^2}{(x-y)^2}\\
E=&(\frac {xy}{y-x})^2d(\frac {y-x}{xy})  \\
\end{align}
$$
$$ \text {Since we have } \frac {dv}{v^2}=-d\left(\frac 1v  \right ) \implies E=-d(\frac {xy}{y-x})$$
Therefore we have
$$d  \ln x -d \ln y +d(\frac {xy}{x-y})=0$$
$$\boxed{\ln (\frac xy)+\frac {xy}{x-y}=K}$$
</s>