\[ \int (c x)^{-1-2 n-n p} \left (a+b x^n\right )^p \, dx \]
Optimal antiderivative \[ -\frac {\left (a +b \,x^{n}\right )^{1+p} \left (c x \right )^{-n \left (2+p \right )}}{a c n \left (1+p \right )}+\frac {\left (a +b \,x^{n}\right )^{2+p} \left (c x \right )^{-n \left (2+p \right )}}{a^{2} c n \left (1+p \right ) \left (2+p \right )} \]
command
integrate((c*x)**(-n*p-2*n-1)*(a+b*x**n)**p,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ - \frac {b^{p} c^{- 2 n} c^{- n p} p x^{- 2 n} \left (\frac {a x^{- n}}{b} + 1\right )^{p} \Gamma \left (- p - 2\right )}{c n \Gamma \left (- p\right )} - \frac {b^{p} c^{- 2 n} c^{- n p} x^{- 2 n} \left (\frac {a x^{- n}}{b} + 1\right )^{p} \Gamma \left (- p - 2\right )}{c n \Gamma \left (- p\right )} - \frac {b b^{p} c^{- 2 n} c^{- n p} p x^{- n} \left (\frac {a x^{- n}}{b} + 1\right )^{p} \Gamma \left (- p - 2\right )}{a c n \Gamma \left (- p\right )} + \frac {b^{2} b^{p} c^{- 2 n} c^{- n p} \left (\frac {a x^{- n}}{b} + 1\right )^{p} \Gamma \left (- p - 2\right )}{a^{2} c n \Gamma \left (- p\right )} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________