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