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.

From @Archisman Panigrahi,
\begin{eqnarray}
I&=&\frac{1}{2} \int_0^{2\pi} \left(\frac{\cos{x}\cos{15x}}{\cos{3x}\cos{5x}}\right)^2 dx= \frac{1}{2} \int_0^{2\pi} \left(\frac{\cos{14x}+\cos{16x}}{\cos{2x}+\cos{8x}}\right)^2 dx\\
&=&\frac{1}{4} \int_0^{4\pi} \left(\frac{\cos{7x}+\cos{8x}}{\cos{x}+\cos{4x}}\right)^2 dx=\frac{1}{2} \int_0^{2\pi} \left(\frac{\cos{7x}+\cos{8x}}{\cos{x}+\cos{4x}}\right)^2 dx.
\end{eqnarray}
Using
$$ \cos\theta=\frac12(z+z^{-1}),z=e^{i\theta} $$
one has
\begin{eqnarray}
&&\frac{\cos{7x}+\cos{8x}}{\cos{x}+\cos{4x}}=\frac{z^7+z^{-7}+z^8+z^{-8}}{z+z^{-1}+z^4+z^{-4}}\\
&=&\frac{1+z+z^{15}+z^{16}}{z^4(1+z^3+z^5+z^8)}=-1-(z+z^{-1})+(z^3+z^{-3})+(z^4+z^{-4})\\
&=&-1-2\cos x+2\cos3x+2\cos4x 
\end{eqnarray}
and hence
$$I=\frac{1}{2} \int_0^{2\pi} \left(\frac{\cos{7x}+\cos{8x}}{\cos{x}+\cos{4x}}\right)^2 dx=\frac12\int_0^{2\pi}(-1-2\cos x+2\cos3x+2\cos4x)^2=7\pi.$$
