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