<s>[INST] Evaluate $\int_0^\pi \left(\frac{\sin{2x}\sin{3x}\sin{5x}\sin{30x}}{\sin{x}\sin{6x}\sin{10x}\sin{15x}}\right)^2 dx$ (from MIT Integration Bee 2023) This is from the final round of MIT Integration Bee 2023.
$$\int_0^\pi \left(\frac{\sin{2x}\sin{3x}\sin{5x}\sin{30x}}{\sin{x}\sin{6x}\sin{10x}\sin{15x}}\right)^2 dx$$
The given answer is $7\pi$.

I found a way to do it using contour integrals (see answer below), but this is not a calculation I can finish within 4 minutes (the time limit in the competition). I am still looking for other elegant methods, possibly without using contour integrals.
 [/INST] $$A=\frac{\sin (2 x)\, \sin (3 x)\, \sin (5 x) \,\sin (30 x) }{\sin (x) \,\sin (6 x) \,\sin (10 x) \,\sin (15 x) }$$ Simplifying $$A=-1-2 \cos (2 x)+2 \cos (6 x)+2 \cos (8 x)$$ Squaring and simplifying again
$$A^2=7+8 \cos (2 x)-2 \cos (4 x)-8 \cos (6 x)-8 \cos (8 x)-4 \cos (10
   x)+$$ $$2 \cos (12 x)+4 \cos (14 x)+2 \cos (16 x)$$
$$\int A^2\, dx=7 x+4 \sin (2 x)-\frac{1}{2} \sin (4 x)-\frac{4}{3} \sin (6
   x)-\sin (8 x)-$$ $$\frac{2}{5} \sin (10 x)+\frac{1}{6} \sin (12
   x)+\frac{2}{7} \sin (14 x)+\frac{1}{8} \sin (16 x)$$
Edit (detailed steps for the simplication)
Use the half-angle formulae for $\sin(2x)$, $\sin(30x)$ in numerator and for $\sin(6x)$, $\sin(10x)$ in denominator. This gives
$$A=\frac {\cos (x)\, \cos (15 x) }{\cos (3 x)\, \cos (5 x) }$$
Using product to sum and let $x=\frac t 2$
$$A=\frac{\cos (14 x)+\cos (16 x)}{\cos (2 x)+\cos (8 x)}=\frac{\cos (7 t)+\cos (8 t)}{\cos (t)+\cos (4 t)}$$
Now, $t=\cos ^{-1}(z)$ and multiple angle formulae to make
$$A=\frac{128 z^8+64 z^7-256 z^6-112 z^5+160 z^4+56 z^3-32 z^2-7z+1 } {8 z^4-8 z^2+z+1 }$$
Factorization
$$A=\frac{ (z+1) (2 z-1) \left(4 z^2-2 z-1\right) \left(16 z^4+8 z^3-16 z^2-8
   z+1\right)} {(z+1) (2 z-1) \left(4 z^2-2 z-1\right) }$$
Simplify and back to $t$
$$A=16 \cos ^4(t)+8 \cos ^3(t)-16 \cos ^2(t)-8 \cos (t)+1$$
Now, using
$$\cos^2(t)=\frac 12(1+\cos(2t))$$
$$\cos^3(t)=\frac 14 (3 \cos (t)+\cos (3 t))$$
$$\cos^4(t)=\frac{1}{8} (3+4 \cos (2 t)+\cos (4 t))$$
Replace, make $t=2x$ to find the result.
</s>