ODE No. 876

\[ y'(x)=-\frac {y(x)^2 \left (x^2 y(x)-2 x y(x)+y(x)-2 x\right )}{2 x (x y(x)-2 y(x)-2)} \] Mathematica : cpu = 0.183129 (sec), leaf count = 135

DSolve[Derivative[1][y][x] == -1/2*(y[x]^2*(-2*x + y[x] - 2*x*y[x] + x^2*y[x]))/(x*(-2 - 2*y[x] + x*y[x])),y[x],x]
 

\[\left \{\left \{y(x)\to -\frac {4 x}{-2 (x-2) x+\frac {2 \sqrt {-x (x-2)^2-4 x \left (-2 \left (\frac {x^2}{8}-\frac {x}{2}+\frac {\log (x)}{4}\right )+c_1\right )}}{\sqrt {-\frac {1}{x}}}}\right \},\left \{y(x)\to \frac {4 x}{2 (x-2) x+\frac {2 \sqrt {-x (x-2)^2-4 x \left (-2 \left (\frac {x^2}{8}-\frac {x}{2}+\frac {\log (x)}{4}\right )+c_1\right )}}{\sqrt {-\frac {1}{x}}}}\right \}\right \}\] Maple : cpu = 0.043 (sec), leaf count = 41

dsolve(diff(y(x),x) = -1/2*y(x)^2*(x^2*y(x)-2*x-2*x*y(x)+y(x))/(-2+x*y(x)-2*y(x))/x,y(x))
 

\[y \left (x \right ) = \frac {4}{\sqrt {c_{1}-8 \ln \left (x \right )}+2 x -4}\]