Solution of differential equation ${x^2}\frac{{dy}}{{dx}} + {y^2}{e^{\frac{{x\left( {y - x} \right)}}{y}}} = 2y\left( {x - y} \right)$ 
Solutions of differential equation
$$
{x^2}\frac{{dy}}{{dx}} + {y^2}{e^{\frac{{x\left( {y - x} \right)}}{y}}} = 2y\left( {x - y} \right)
$$
are given by
(A) $x(x + y) = y \ln (Ce^x– 1)$
(B) $x(x – y) = x \ln (Ce^x– 1)$
(C) $x(x + y) = x\ln (Ce^x + 1) $
(D) $x(x – y) = y \ln (Ce^x –1)$,
where $C$ is constant of integration.

My approach is as follow
\begin{align}
& \Rightarrow \frac{{{x^2}}}{{{y^2}}}\frac{{dy}}{{dx}} + {e^{\frac{{x\left( {y - x} \right)}}{y}}} = \frac{{2y\left( {x - y} \right)}}{{{y^2}}} \\
& t = \frac{1}{y} \\
& dt =  - \frac{1}{{{y^2}}}dy \\
& \Rightarrow  - \frac{{{x^2}dt}}{{dx}} + {e^{x\left( {1 - tx} \right)}} = 2\left( {tx - 1} \right) \\
& {e^{x\left( {1 - tx} \right)}} = g,\because \frac{{dg}}{{dx}} = g\left( {1 - 2tx - {x^2}\frac{{dt}}{{dx}}} \right) \Rightarrow \frac{{dg}}{{gdx}} = \left( {1 - 2tx - {x^2}\frac{{dt}}{{dx}}} \right) \Rightarrow \\
& \qquad- {x^2}\frac{{dt}}{{dx}} = 2tx - 2 + \frac{{dg}}{{gdx}} + 1 \\
& \Rightarrow 2tx - 2 + \frac{{dg}}{{gdx}} + 1 + g = 2\left( {tx - 1} \right) \Rightarrow \frac{{dg}}{{gdx}} + 1 + g = 0 \Rightarrow \frac{{dg}}{{g\left( {g + 1} \right)}} =  - dx \\
& \Rightarrow \frac{{dg}}{g} - \frac{{dg}}{{\left( {g + 1} \right)}} =  - x + C \\
& \Rightarrow \ln{e^{x\left( {1 - tx} \right)}} - \ln\left( {{e^{x\left( {1 - tx} \right)}} + 1} \right) =  - x + C \Rightarrow \ln\frac{{{e^{x\left( {1 - tx} \right)}}}}{{{e^{x\left( {1 - tx} \right)}} + 1}} =  - x + C
\end{align}
I am not able to proceed from here

$${x^2}\frac{{dy}}{{dx}} + {y^2}{e^{\frac{{x\left( {y - x} \right)}}{y}}} = 2y\left( {x - y} \right)$$
Substitute $y=tx$
$$t'x+t+ t^2{e^{x(1-\frac 1t )}} = 2t\left( {1 - t} \right)$$
$$t'x+ t^2{e^{x(1-\frac 1t )}} = t -2 t^2$$
$$-\left(\dfrac 1t \right)'x+ {e^{x(1-\frac 1t )}} = \dfrac 1t -2 $$
$$-\left(\dfrac xt \right)'+ {e^{x(1-\frac 1t )}} =  -2 $$
$$\left(\dfrac xt \right)'= {e^{x(1-\frac 1t )}}   +2 $$
Substitute $u=\dfrac x t$ .
$$(e^u)'-2e^u=e^x $$
This is easy to solve.
$$(e^ue^{-2x})'=e^{-x}$$
Integrate
$$e^u=-e^{x}+Ce^{2x}$$
$$\dfrac xt=\ln |-e^{x}+Ce^{2x}|$$
$$\dfrac {x^2}y=x+\ln |-1+Ce^{x}|$$
$$x(x-y) =y\ln |-1+Ce^{x}|$$
Solution is option D

You can continue from the last line. Put the denominator on the right side and then factorize
$$z=Ke^{-x}(z+1)$$
$$ \implies z(1-ke^{-x})=ke^{-x}$$
$$e^{x(1-tx)}= \dfrac {ke^{-x}}{1-ke^{-x}}$$
$$e^{x(1-tx)}= \dfrac {ke^{-x}}{1-ke^{-x}}$$
Take log function on both sides and continue. Normally you should end with the right solution.
