Evaluate $\int_0^\pi \frac{\sin\frac{21x}{2}}{\sin \frac x2} dx$ (from MIT Integration Bee)

Note

$$2\sin\frac x2(\cos x + \cos2x+\cos3x+...+\cos10x) = \sin\frac{21x}2-\sin\frac x2 $$

Then,

$$\begin{align} \int_0^\pi \frac{\sin\frac{21x}{2}}{\sin \frac x2}{\rm d}x =&\int_0^\pi(1+2\cos x + 2\cos2x+...+2\cos10x){\rm d}x\\ =&\pi + (0+0+...+0)\\ =&\pi \end{align}$$


Note that if we call $a=e^{ix/2}$, then we have $$\frac{\sin(21x/2)}{\sin(x/2)} = \frac{a^{21}-a^{-21}}{a-a^{-1}} = a^{-20}\frac{a^{42}-1}{a^2-1}=a^{-20}\frac{(a^2-1)(a^{40}+a^{38}+a^{36}+\cdots+1)}{a^2-1}=(a^{20}+a^{18}+\cdots+a^{-18}+a^{-20})$$

Then since $a^n+a^{-n}=2\cos(nx/2)$ and $\int_0^\pi \cos(nx/2) dx=0$ for $n$ even, all but the $a^0$ term of the above product vanishes under integration. Hence the integral is just $\int_0^\pi 1 dx=\pi$


Define $$I_m= \int_{0}^{\pi} \frac{\sin{(\frac{mx}{2})}}{\sin{(\frac{x}{2})}} dx $$ for each $m\in\mathbb{N}$. Clearly, we have $I_1=\pi$. Now, for $m\in\mathbb{N}$, we have \begin{align} I_{m+2}-I_m = \int_{0}^{\pi} \frac{\sin{(\frac{mx+2x}{2})}-\sin{(\frac{mx}{2})}}{\sin{(\frac{x}{2})}} dx &= \int_{0}^{\pi} 2\cos{\left(\frac{(m+1)x}{2}\right)} dx \\ &= \left(\frac{4}{m+1}\right) \sin{\frac{(m+1)\pi}{2}}\end{align}

Letting $m=2k-1$ for $k\in\mathbb{N}$ and summing over $k$, it follows that $I_{2k-1}=I_1=\pi$ for all $k\in\mathbb{N}$. Now, letting $k=11$ solves the problem.