4.11.13 \(x y(x) y'(x)=x^2-x y(x)+y(x)^2\)

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

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

Book solution method
Homogeneous equation

Mathematica
cpu = 0.281566 (sec), leaf count = 20

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

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

\[\left [y \left (x \right ) = {\mathrm e}^{-\LambertW \left (\frac {{\mathrm e}^{-\textit {\_C1}} {\mathrm e}^{-1}}{x}\right )-\textit {\_C1} -1}+x\right ]\] Mathematica raw input

DSolve[x*y[x]*y'[x] == x^2 - x*y[x] + y[x]^2,y[x],x]

Mathematica raw output

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

Maple raw input

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

Maple raw output

[y(x) = exp(-LambertW(1/exp(_C1)*exp(-1)/x)-_C1-1)+x]