Evaluate $\int^{2\pi}_0\frac{\cos(2022x)\sin(10050x)\sin(10251x)}{\sin(50x)\sin(51x)}dx$ This horrible integral (shown in the title) comes from MIT Integration Bee 2022 Final Round. I have tried to use product to sum formulae, and also Feynman's trick by introducing $$I(b)=\int^{2\pi}_0e^{b\sin(50x)\sin(51x)}\cdot\frac{\cos(2022x)\sin(10050x)\sin(10251x)}{\sin(50x)\sin(51x)}dx$$
However, it seems the approach does not work. Does anyone suggest a good solution? Thank you!
(Final answer from the official website: $6\pi$.)
 A: Note that
$$\frac{\sin(10050x)}{\sin(50x)}
=1+2\sum_{k=1}^{100} \cos(100k x)
$$
$$\frac{\sin(10251x)}{\sin(51x)}
=1+2\sum_{j=1}^{100} \cos(102 j x)
$$
Then
\begin{align}
&I=\int^{2\pi}_0\frac{\cos(2022x)\sin(10050x)\sin(10251x)}{\sin(50x)\sin(51x)}dx\\
=&\sum_{k,j=1}^{100}\int^{2\pi}_0 
4\cos(2022x) \cos(100k x)\cos(102j x)dx\\
=&\sum_{k,j=1}^{100}\int^{2\pi}_0 
[ \cos(1011+50k +51j)2x\\
& \hspace{20mm} + \cos(1011-50k -51j)2x\\
& \hspace{20mm} + \cos(1011+51j -50k)2x\\
& \hspace{20mm}  + \cos(1011-51j +50k)2x] \ dx\\
\end{align}
The surviving terms are those with \begin{align}
50k+ 51j=& 1011 \implies (k,j)=(9,11)\\
50k- 51j=& 1011 \implies (k,j)=(60,39)\\
51j -50k=& 1011 \implies (k,j)=(42,61)\\
\end{align}
As a result
$$I= \int_0^{2\pi}(1+1+1) \ dx=6\pi
$$
A: Partial Answer
Observe that:
$$10050 = 50 \cdot 201$$
$$10251 = 51 \cdot 201$$
Let $a = 50$ and $b = 51$. Then:
$$2i\sin(10050x) = (\exp(aix))^{201}-(\exp(-aix))^{201}$$
$$2i\sin(10251x) = (\exp(bix))^{201}-(\exp(-bix))^{201}$$
But now, notice that:
$$2i\sin(10050x) = (\exp(aix)-\exp(-aix))((\exp(aix))^{200} + \ldots + (\exp(-aix))^{200})$$
$$2i\sin(10251x) = (\exp(bix)-\exp(-bix))((\exp(bix))^{200} + \ldots+(\exp(-bix))^{200})$$
It follows that:
$$\frac{\sin(10050x)\sin(10251x)}{\sin(50x)\sin(51x)} =(\exp(200aix)+\ldots+ \exp(-200aix))(\exp(200bix)+\ldots+\exp(-200bix))$$
It now follows, overall, that:
$$\int_{0}^{2\pi} \cos(2022x) \frac{\sin(10050x)\sin(10251x)}{\sin(50x)\sin(51x)} \ dx = \frac{1}{2}\int_{0}^{2\pi} (\exp(2022ix)+\exp(-2022ix))\left(\sum_{k=-200}^{200} \exp(ikax) \right) \left(\sum_{k=-200}^{200} \exp(ikbx) \right) \ dx$$
Okay this looks really, really ugly BUT it's actually also really, really good because, now, we can take advantage of the fact that $\int_{0}^{2\pi} \exp(ikax) \ dx = 0$ whenever $ka$ is a non-zero integer. So, my idea here was to actually split the integral up into two bits:
$$I_1 = \int_{0}^{2\pi} \left(\sum_{k=-200}^{200} \exp((2022+ka)ix) \right)\left(\sum_{k=-200}^{200} \exp(ikb) \right) \ dx$$
$$I_2 = \int_{0}^{2\pi} \left(\sum_{k=-200}^{200} \exp((-2022+kb)ix) \right)\left(\sum_{k=-200}^{200} \exp(ikb) \right) \ dx$$
Once again, these may look disgusting but the idea, now, is to look for the constant terms in each integrand (possibly by solving a Diophantine equation or two). These constant terms will just be $1$ so I'm thinking that for each integral, we'll get $3$ of them and that will amoung to $6\pi$ as the answer for the entire integral (don't forget the factor of $\frac{1}{2}$).
