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