\[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )^3}{x} \, dx \]
Optimal antiderivative \[ -\frac {35 \left (-1+\frac {1}{x^{2}}\right )^{\frac {3}{2}} x^{2}}{48}-\frac {7 \left (-1+\frac {1}{x^{2}}\right )^{\frac {5}{2}} x^{4}}{24}-\frac {\left (-1+\frac {1}{x^{2}}\right )^{\frac {7}{2}} x^{6}}{6}-\frac {35 \arctan \left (\sqrt {-1+\frac {1}{x^{2}}}\right )}{16}+\frac {35 \sqrt {-1+\frac {1}{x^{2}}}}{16} \]
command
integrate((x**2-1)**3*(-1+1/x**2)**(1/2)/x,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ - \frac {x^{6} \left (-1 + \frac {1}{x^{2}}\right )^{\frac {3}{2}}}{6} - \frac {5 x^{4} \sqrt {-1 + \frac {1}{x^{2}}} \cdot \left (2 - \frac {1}{x^{2}}\right )}{16} + \frac {3 x^{2} \sqrt {-1 + \frac {1}{x^{2}}}}{2} + \sqrt {-1 + \frac {1}{x^{2}}} - \frac {35 \operatorname {atan}{\left (\sqrt {-1 + \frac {1}{x^{2}}} \right )}}{16} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________