\[ \int x^{-1-n} \left (a+b x^n\right )^8 \, dx \]
Optimal antiderivative \[ -\frac {a^{8} x^{-n}}{n}+\frac {28 a^{6} b^{2} x^{n}}{n}+\frac {28 a^{5} b^{3} x^{2 n}}{n}+\frac {70 a^{4} b^{4} x^{3 n}}{3 n}+\frac {14 a^{3} b^{5} x^{4 n}}{n}+\frac {28 a^{2} b^{6} x^{5 n}}{5 n}+\frac {4 a \,b^{7} x^{6 n}}{3 n}+\frac {b^{8} x^{7 n}}{7 n}+8 a^{7} b \ln \left (x \right ) \]
command
integrate(x**(-1-n)*(a+b*x**n)**8,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} a^{8} x + 8 a^{7} b \log {\left (x \right )} - \frac {28 a^{6} b^{2}}{x} - \frac {28 a^{5} b^{3}}{x^{2}} - \frac {70 a^{4} b^{4}}{3 x^{3}} - \frac {14 a^{3} b^{5}}{x^{4}} - \frac {28 a^{2} b^{6}}{5 x^{5}} - \frac {4 a b^{7}}{3 x^{6}} - \frac {b^{8}}{7 x^{7}} & \text {for}\: n = -1 \\\left (a + b\right )^{8} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {105 a^{8} n}{105 n^{2} x^{n} + 105 n x^{n}} - \frac {105 a^{8}}{105 n^{2} x^{n} + 105 n x^{n}} - \frac {840 a^{7} b n x^{n} \log {\left (x^{- n} \right )}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {840 a^{7} b n x^{n}}{105 n^{2} x^{n} + 105 n x^{n}} - \frac {840 a^{7} b x^{n} \log {\left (x^{- n} \right )}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2940 a^{6} b^{2} n x^{2 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2940 a^{6} b^{2} x^{2 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2940 a^{5} b^{3} n x^{3 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2940 a^{5} b^{3} x^{3 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2450 a^{4} b^{4} n x^{4 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {2450 a^{4} b^{4} x^{4 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {1470 a^{3} b^{5} n x^{5 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {1470 a^{3} b^{5} x^{5 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {588 a^{2} b^{6} n x^{6 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {588 a^{2} b^{6} x^{6 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {140 a b^{7} n x^{7 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {140 a b^{7} x^{7 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {15 b^{8} n x^{8 n}}{105 n^{2} x^{n} + 105 n x^{n}} + \frac {15 b^{8} x^{8 n}}{105 n^{2} x^{n} + 105 n x^{n}} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________