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