\[ \int \cos ^3(c+d x) (a+b \sin (c+d x))^m \, dx \]
Optimal antiderivative \[ -\frac {\left (a^{2}-b^{2}\right ) \left (a +b \sin \left (d x +c \right )\right )^{1+m}}{b^{3} d \left (1+m \right )}+\frac {2 a \left (a +b \sin \left (d x +c \right )\right )^{2+m}}{b^{3} d \left (2+m \right )}-\frac {\left (a +b \sin \left (d x +c \right )\right )^{3+m}}{b^{3} d \left (3+m \right )} \]
command
integrate(cos(d*x+c)**3*(a+b*sin(d*x+c))**m,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} \]_____________________________________________________