\[ \boxed { {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) - \left ( y \left ( x \right ) \right ) ^{2}+ \left ( {x}^{2}+1 \right ) y \left ( x \right ) -2\,x=0} \]
Mathematica: cpu = 0.789600 (sec), leaf count = 48 \[ \left \{\left \{y(x)\to \frac {e^{\frac {x^3}{3}+x}}{c_1-\int _1^x e^{\frac {K[1]^3}{3}+K[1]} \, dK[1]}+x^2+1\right \}\right \} \]
Maple: cpu = 0.062 (sec), leaf count = 34 \[ \left \{ y \left ( x \right ) ={x}^{2}+1+{1{{\rm e}^{{\frac {{x}^{3}}{3} }+x}} \left ( {\it \_C1}-\int \!{{\rm e}^{{\frac {{x}^{3}}{3}}+x}} \,{\rm d}x \right ) ^{-1}} \right \} \]
Sage: cpu = 0.244 (sec), leaf count = 0 \[ \left [\left [y\left (x\right ) = \frac {c x^{2} + {\left (x^{2} + 1\right )} \int e^{\left (\frac {1}{3} \, x^{3} + x\right )}\,{d x} + c - e^{\left (\frac {1}{3} \, x^{3} + x\right )}}{c + \int e^{\left (\frac {1}{3} \, x^{3} + x\right )}\,{d x}}\right ], \text {\texttt {riccati}}\right ] \]