4.12.22 \(x (2-x y(x)) y'(x)-x (x y(x)+1) y(x)^2+2 y(x)=0\)

ODE
\[ x (2-x y(x)) y'(x)-x (x y(x)+1) y(x)^2+2 y(x)=0 \] ODE Classification

[[_homogeneous, `class G`], _rational, [_Abel, `2nd type`, `class C`]]

Book solution method
Change of Variable, new dependent variable

Mathematica
cpu = 0.0164487 (sec), leaf count = 81

\[\left \{\left \{y(x)\to \frac {2}{\sqrt {-\frac {1}{x^3}} x^2 \sqrt {-x \left (4 c_1-4 \log (x)+1\right )}+x}\right \},\left \{y(x)\to \frac {2}{\left (-\frac {1}{x^3}\right )^{3/2} x^5 \sqrt {-x \left (4 c_1-4 \log (x)+1\right )}+x}\right \}\right \}\]

Maple
cpu = 0.017 (sec), leaf count = 24

\[ \left \{ \ln \left ( x \right ) -{\it \_C1}+{\frac {1-xy \left ( x \right ) }{{x}^{2} \left ( y \left ( x \right ) \right ) ^{2}}}=0 \right \} \] Mathematica raw input

DSolve[2*y[x] - x*y[x]^2*(1 + x*y[x]) + x*(2 - x*y[x])*y'[x] == 0,y[x],x]

Mathematica raw output

{{y[x] -> 2/(x + Sqrt[-x^(-3)]*x^2*Sqrt[-(x*(1 + 4*C[1] - 4*Log[x]))])}, {y[x] -
> 2/(x + (-x^(-3))^(3/2)*x^5*Sqrt[-(x*(1 + 4*C[1] - 4*Log[x]))])}}

Maple raw input

dsolve(x*(2-x*y(x))*diff(y(x),x)+2*y(x)-x*y(x)^2*(1+x*y(x)) = 0, y(x),'implicit')

Maple raw output

ln(x)-_C1+(1-x*y(x))/x^2/y(x)^2 = 0