\[ \int \sin ^2(a+b x) \sin ^5(2 a+2 b x) \, dx \]
Optimal antiderivative \[ \frac {4 \left (\sin ^{8}\left (b x +a \right )\right )}{b}-\frac {32 \left (\sin ^{10}\left (b x +a \right )\right )}{5 b}+\frac {8 \left (\sin ^{12}\left (b x +a \right )\right )}{3 b} \]
command
integrate(sin(b*x+a)**2*sin(2*b*x+2*a)**5,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} \frac {5 x \sin ^{2}{\left (a + b x \right )} \sin ^{5}{\left (2 a + 2 b x \right )}}{32} + \frac {5 x \sin ^{2}{\left (a + b x \right )} \sin ^{3}{\left (2 a + 2 b x \right )} \cos ^{2}{\left (2 a + 2 b x \right )}}{16} + \frac {5 x \sin ^{2}{\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )} \cos ^{4}{\left (2 a + 2 b x \right )}}{32} + \frac {5 x \sin {\left (a + b x \right )} \sin ^{4}{\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{16} + \frac {5 x \sin {\left (a + b x \right )} \sin ^{2}{\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )} \cos ^{3}{\left (2 a + 2 b x \right )}}{8} + \frac {5 x \sin {\left (a + b x \right )} \cos {\left (a + b x \right )} \cos ^{5}{\left (2 a + 2 b x \right )}}{16} - \frac {5 x \sin ^{5}{\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )}}{32} - \frac {5 x \sin ^{3}{\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )} \cos ^{2}{\left (2 a + 2 b x \right )}}{16} - \frac {5 x \sin {\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )} \cos ^{4}{\left (2 a + 2 b x \right )}}{32} - \frac {65 \sin ^{2}{\left (a + b x \right )} \sin ^{4}{\left (2 a + 2 b x \right )} \cos {\left (2 a + 2 b x \right )}}{128 b} - \frac {2 \sin ^{2}{\left (a + b x \right )} \sin ^{2}{\left (2 a + 2 b x \right )} \cos ^{3}{\left (2 a + 2 b x \right )}}{3 b} - \frac {167 \sin ^{2}{\left (a + b x \right )} \cos ^{5}{\left (2 a + 2 b x \right )}}{640 b} + \frac {11 \sin {\left (a + b x \right )} \sin ^{5}{\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )}}{64 b} + \frac {\sin {\left (a + b x \right )} \sin ^{3}{\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )} \cos ^{2}{\left (2 a + 2 b x \right )}}{4 b} + \frac {19 \sin {\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )} \cos ^{4}{\left (2 a + 2 b x \right )}}{192 b} + \frac {\sin ^{4}{\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{128 b} - \frac {11 \cos ^{2}{\left (a + b x \right )} \cos ^{5}{\left (2 a + 2 b x \right )}}{1920 b} & \text {for}\: b \neq 0 \\x \sin ^{2}{\left (a \right )} \sin ^{5}{\left (2 a \right )} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________