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