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