\[ \int \frac {e^{\frac {9+123 x+30 x^2}{10 \log \left (\frac {2+x^2}{x}\right )}} \left (18+246 x+51 x^2-123 x^3-30 x^4+\left (246 x+120 x^2+123 x^3+60 x^4\right ) \log \left (\frac {2+x^2}{x}\right )+\left (20+10 x^2\right ) \log ^2\left (\frac {2+x^2}{x}\right )\right )}{\left (20+10 x^2\right ) \log ^2\left (\frac {2+x^2}{x}\right )} \, dx \]
Optimal antiderivative \[ x \,{\mathrm e}^{\frac {3 x +3 \left (3+x \right ) \left (\frac {1}{10}+x \right )}{\ln \left (x +\frac {2}{x}\right )}} \]
command
integrate(((10*x**2+20)*ln((x**2+2)/x)**2+(60*x**4+123*x**3+120*x**2+246*x)*ln((x**2+2)/x)-30*x**4-123*x**3+51*x**2+246*x+18)*exp(1/10*(30*x**2+123*x+9)/ln((x**2+2)/x))/(10*x**2+20)/ln((x**2+2)/x)**2,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Exception raised: TypeError} \]
Sympy 1.8 under Python 3.8.8 output
\[ x e^{\frac {3 x^{2} + \frac {123 x}{10} + \frac {9}{10}}{\log {\left (\frac {x^{2} + 2}{x} \right )}}} \]