\[ \left (x^2+1\right ) y''(x)+4 x y'(x)+2 y(x)+2 x-2 \cos (x)=0 \] ✓ Mathematica : cpu = 0.0451849 (sec), leaf count = 33
\[\left \{\left \{y(x)\to -\frac {-3 c_2 x-3 c_1+x^3+6 \cos (x)}{3 x^2+3}\right \}\right \}\]
✓ Maple : cpu = 0.018 (sec), leaf count = 31
\[ \left \{ y \left ( x \right ) ={\frac {-{x}^{3}+3\,{\it \_C1}\,x-6\,\cos \left ( x \right ) +3\,{\it \_C2}}{3\,{x}^{2}+3}} \right \} \]