4.2.15 \(y'(x)=-x^3+\left (2 x^2+1\right ) y(x)-x y(x)^2-x+1\)

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

[_Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.0645825 (sec), leaf count = 35

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

Maple
cpu = 0.136 (sec), leaf count = 56

\[ \left \{ y \left ( x \right ) ={1 \left ( {\it \_C1}\, \left ( {x}^{2}-x+1 \right ) {{\rm e}^{{\frac {x \left ( {x}^{2}+3 \right ) }{3}}}}+{{\rm e}^{{\frac {{x}^{3}}{3}}}}x \right ) \left ( {\it \_C1}\,{{\rm e}^{{\frac {x \left ( {x}^{2}+3 \right ) }{3}}}} \left ( -1+x \right ) +{{\rm e}^{{\frac {{x}^{3}}{3}}}} \right ) ^{-1}} \right \} \] Mathematica raw input

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

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