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.286474 (sec), leaf count = 35

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

Maple
cpu = 0.128 (sec), leaf count = 61

\[\left [y \left (x \right ) = \frac {\left (\textit {\_C1} \,x^{2}-\textit {\_C1} x +\textit {\_C1} \right ) {\mathrm e}^{\frac {x \left (x^{2}+3\right )}{3}}+{\mathrm e}^{\frac {x^{3}}{3}} x}{\left (\textit {\_C1} x -\textit {\_C1} \right ) {\mathrm e}^{\frac {x \left (x^{2}+3\right )}{3}}+{\mathrm e}^{\frac {x^{3}}{3}}}\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))

Maple raw output

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