\[ \int \cos ^5(c+d x) (a+b \sin (c+d x))^m \, dx \]
Optimal antiderivative \[ \frac {\left (a^{2}-b^{2}\right )^{2} \left (a +b \sin \left (d x +c \right )\right )^{1+m}}{b^{5} d \left (1+m \right )}-\frac {4 a \left (a^{2}-b^{2}\right ) \left (a +b \sin \left (d x +c \right )\right )^{2+m}}{b^{5} d \left (2+m \right )}+\frac {2 \left (3 a^{2}-b^{2}\right ) \left (a +b \sin \left (d x +c \right )\right )^{3+m}}{b^{5} d \left (3+m \right )}-\frac {4 a \left (a +b \sin \left (d x +c \right )\right )^{4+m}}{b^{5} d \left (4+m \right )}+\frac {\left (a +b \sin \left (d x +c \right )\right )^{5+m}}{b^{5} d \left (5+m \right )} \]
command
integrate(cos(d*x+c)^5*(a+b*sin(d*x+c))^m,x, algorithm="giac")
Giac 1.9.0-11 via sagemath 9.6 output
\[ \text {output too large to display} \]
Giac 1.7.0 via sagemath 9.3 output \[ \text {Timed out} \]_______________________________________________________