<s>[INST] Prove that, $\int_0^{\pi/2}\frac{\sin (2n+1)x}{\sin x}~dx=\frac{\pi}{2}$ Prove that, $$\int_0^{\pi/2}\dfrac{\sin (2n+1)x}{\sin x}~dx=\dfrac{\pi}{2}$$  For every integer $n\ge 0$
I tried using induction without any help. Possibly my method of application was not right. Please help me!
 [/INST] First, note that for any positive integer $n$, $$ \int_{x=0}^{\pi/2} \cos 2nx \, dx = \left[ \frac{\sin 2nx}{2n} \right]_{x=0}^{\pi/2} = 0.$$  Now let $$ \begin{align*} f_n(x) &= \frac{\sin(2n+1)x}{\sin x} = \frac{\sin(2n-1)x \cos 2x + \cos(2n-1)x \sin 2x}{\sin x} \\ &= f_{n-1}(x) (1 - 2 \sin^2 x) + 2 \cos(2n-1)x \cos x \\ &= f_{n-1}(x) + 2(\cos(2n-1)x \cos x - \sin(2n-1)x \sin x) \\ &= f_{n-1}(x) + 2 \cos 2nx. \end{align*}$$  Therefore, $$I_n =  \int_{x=0}^{\pi/2} f_n(x) \, dx = \int_{x=0}^{\pi/2} f_{n-1}(x) \, dx + 2 \int_{x=0}^{\pi/2} \cos 2nx \, dx = I_{n-1}. $$  Since $I_0 = \frac{\pi}{2}$ trivially, the result immediately follows.
</s>