How can I solve this differental equation?
The equation can be rewritten as $$\frac{\mathrm{d}x}{x}-\frac{y^2}{(x-y)^2}\mathrm{d}x+\frac{x^2}{(x-y)^2}\mathrm{d}y-\frac{\mathrm{d}y}{y}=0.$$ Here, I would suggest the substitution $xw=y.$ Hence $$\frac{\mathrm{d}x}{x}-\frac{w^2}{(1-w)^2}\mathrm{d}x+\frac1{(1-w)^2}\mathrm{d}(xw)-\frac{\mathrm{d}(xw)}{xw}=\frac{\mathrm{d}x}{x}-\frac{w^2}{(1-w)^2}\mathrm{d}x+\frac{x}{(1-w)^2}\mathrm{d}w+\frac{w}{(1-w)^2}\mathrm{d}x-\frac{\mathrm{d}w}{w}-\frac{\mathrm{d}x}{x}=-\frac{w^2}{(1-w)^2}\mathrm{d}x+\frac{w}{(1-w)^2}\mathrm{d}x+\frac{x}{(1-w)^2}\mathrm{d}w-\frac{\mathrm{d}w}{w}=\frac{w(1-w)}{(1-w)^2}\mathrm{d}x+x\mathrm{d}\left(\frac1{1-w}\right)-\mathrm{d}[\ln(w)]=\frac{w}{1-w}\mathrm{d}x+x\mathrm{d}\left(\frac1{1-w}\right)-\mathrm{d}[\ln(w)]=-\mathrm{d}x+\frac{\mathrm{d}x}{1-w}+x\mathrm{d}\left(\frac1{1-w}\right)-\mathrm{d}[\ln(w)]=\mathrm{d}\left(\frac{x}{1-w}\right)-\mathrm{d}x-\mathrm{d}[\ln(w)]=\mathrm{d}\left[\frac{x}{1-w}-x-\ln(w)\right]=\mathrm{d}\left[\frac{x-(x-xw)}{1-w}-\ln(w)\right]=\mathrm{d}\left[\frac{xw}{1-w}-\ln(w)\right]=\mathrm{d}\left[\frac{x^2w}{x-xw}-\ln(w)\right]=\mathrm{d}\left[\frac{xy}{x-y}-\ln(y)+\ln(x)\right]=0.$$