4.9.42 \((x-y(x)) y'(x)=y(x) (2 x y(x)+1)\)

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

[[_homogeneous, `class D`], _rational, [_Abel, `2nd type``class A`]]

Book solution method
Exact equation, integrating factor

Mathematica
cpu = 0.0192396 (sec), leaf count = 24

\[\left \{\left \{y(x)\to -\frac {x}{W\left (x \left (-e^{x^2-c_1}\right )\right )}\right \}\right \}\]

Maple
cpu = 0.012 (sec), leaf count = 25

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

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

Mathematica raw output

{{y[x] -> -(x/ProductLog[-(E^(x^2 - C[1])*x)])}}

Maple raw input

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

Maple raw output

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