4.12.21 \(x (x y(x)+2) y'(x)=2 x^3-x y(x)^2-2 y(x)+3\)

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

[_exact, _rational, [_Abel, `2nd type``class B`]]

Book solution method
Exact equation

Mathematica
cpu = 0.0138217 (sec), leaf count = 62

\[\left \{\left \{y(x)\to -\frac {\sqrt {x^2 \left (c_1+x^4+6 x+4\right )}+2 x}{x^2}\right \},\left \{y(x)\to \frac {\sqrt {x^2 \left (c_1+x^4+6 x+4\right )}-2 x}{x^2}\right \}\right \}\]

Maple
cpu = 0.014 (sec), leaf count = 27

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

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

Mathematica raw output

{{y[x] -> -((2*x + Sqrt[x^2*(4 + 6*x + x^4 + C[1])])/x^2)}, {y[x] -> (-2*x + Sqr
t[x^2*(4 + 6*x + x^4 + C[1])])/x^2}}

Maple raw input

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

Maple raw output

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