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