\[ \int \frac {\left (8 x^2-50 x^3-2 x^4-16 x^5+100 x^6+4 x^7\right ) \log ^2\left (\frac {1}{x}\right )+\left (8-50 x-2 x^2\right ) \log \left (4-25 x-x^2\right )+\log \left (\frac {1}{x}\right ) \left (-50 x-4 x^2+\left (-8+50 x+2 x^2\right ) \log \left (4-25 x-x^2\right )\right )}{\left (-4 x^2+25 x^3+x^4\right ) \log ^2\left (\frac {1}{x}\right )} \, dx \]
Optimal antiderivative \[ x^{4}-2 x -\frac {2 \ln \! \left (4-x \left (x +25\right )\right )}{x \ln \! \left (\frac {1}{x}\right )} \]
command
integrate(((4*x**7+100*x**6-16*x**5-2*x**4-50*x**3+8*x**2)*ln(1/x)**2+((2*x**2+50*x-8)*ln(-x**2-25*x+4)-4*x**2-50*x)*ln(1/x)+(-2*x**2-50*x+8)*ln(-x**2-25*x+4))/(x**4+25*x**3-4*x**2)/ln(1/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^{4} - 2 x - \frac {2 \log {\left (- x^{2} - 25 x + 4 \right )}}{x \log {\left (\frac {1}{x} \right )}} \]