\[ \int \frac {1+2 x+x^2+x^{\frac {-x-2 x^2}{1+x}} \left (-1-x+2 x^2+2 x^3+\left (x+4 x^2+2 x^3\right ) \log (x)\right )}{1+2 x+x^2} \, dx \]
Optimal antiderivative \[ -5-x \,{\mathrm e}^{\ln \left (x \right ) \left (\frac {x^{2}}{-1-x}-x \right )}+x \]
command
integrate((((2*x**3+4*x**2+x)*ln(x)+2*x**3+2*x**2-x-1)*exp((-2*x**2-x)*ln(x)/(1+x))+x**2+2*x+1)/(x**2+2*x+1),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Timed out} \]
Sympy 1.8 under Python 3.8.8 output
\[ - x e^{\frac {\left (- 2 x^{2} - x\right ) \log {\left (x \right )}}{x + 1}} + x \]