\[ \int x^2 (a+b x)^n \left (c+d x^3\right )^2 \, dx \]
Optimal antiderivative \[ \frac {a^{2} \left (-a^{3} d +b^{3} c \right )^{2} \left (b x +a \right )^{1+n}}{b^{9} \left (1+n \right )}-\frac {2 a \left (-4 a^{3} d +b^{3} c \right ) \left (-a^{3} d +b^{3} c \right ) \left (b x +a \right )^{2+n}}{b^{9} \left (2+n \right )}+\frac {\left (28 a^{6} d^{2}-20 a^{3} b^{3} c d +b^{6} c^{2}\right ) \left (b x +a \right )^{3+n}}{b^{9} \left (3+n \right )}+\frac {4 a^{2} d \left (-14 a^{3} d +5 b^{3} c \right ) \left (b x +a \right )^{4+n}}{b^{9} \left (4+n \right )}-\frac {10 a d \left (-7 a^{3} d +b^{3} c \right ) \left (b x +a \right )^{5+n}}{b^{9} \left (5+n \right )}+\frac {2 d \left (-28 a^{3} d +b^{3} c \right ) \left (b x +a \right )^{6+n}}{b^{9} \left (6+n \right )}+\frac {28 a^{2} d^{2} \left (b x +a \right )^{7+n}}{b^{9} \left (7+n \right )}-\frac {8 a \,d^{2} \left (b x +a \right )^{8+n}}{b^{9} \left (8+n \right )}+\frac {d^{2} \left (b x +a \right )^{9+n}}{b^{9} \left (9+n \right )} \]
command
integrate(x**2*(b*x+a)**n*(d*x**3+c)**2,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {output too large to display} \]
Sympy 1.8 under Python 3.8.8 output \[ \text {Timed out} \]_____________________________________________________