\[ \int x^{-1-7 n} \left (a+b x^n\right )^5 \, dx \]
Optimal antiderivative \[ -\frac {\left (a +b \,x^{n}\right )^{6} x^{-7 n}}{7 a n}+\frac {b \left (a +b \,x^{n}\right )^{6} x^{-6 n}}{42 a^{2} n} \]
command
integrate(x**(-1-7*n)*(a+b*x**n)**5,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} - \frac {a^{5} x^{- 7 n}}{7 n} - \frac {5 a^{4} b x^{- 6 n}}{6 n} - \frac {2 a^{3} b^{2} x^{- 5 n}}{n} - \frac {5 a^{2} b^{3} x^{- 4 n}}{2 n} - \frac {5 a b^{4} x^{- 3 n}}{3 n} - \frac {b^{5} x^{- 2 n}}{2 n} & \text {for}\: n \neq 0 \\\left (a + b\right )^{5} \log {\left (x \right )} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________