Evaluate $$
\int_0^\pi\frac{\sin\Big(n+\frac{1}{2}\Big)x}{\sin \frac{x}{2}}dx
$$
$$
\int_0^\pi\frac{\sin\Big(n+\frac{1}{2}\Big)x}{\sin \frac{x}{2}}dx=\int_0^\pi\frac{\sin\Big(nx+\frac{x}{2}\Big)}{\sin \frac{x}{2}}dx=\int_0^\pi\frac{\sin nx.\cos\frac{x}{2}+\cos nx.\sin\frac{x}{2}}{\sin\frac{x}{2}}dx\\
=\int_0^\pi\sin nx.\cot\frac{x}{2}.dx+\int_0^\pi\cos nx.dx\\
$$
I don't think it is leading anywhere, anyone could possibly help with how to approach this definite integral ?
Note: The solution given in my reference is $\pi$
Best Answer
Note that
$$2\sin\frac x2\cos x = \sin\frac32x -\sin\frac12x$$
$$2\sin\frac x2\cos 2x = \sin\frac52x -\sin\frac32x$$ $$…$$
$$2\sin\frac x2\cos nx =\sin(n+\frac12)x -\sin(n-\frac12)x $$
Sum up both sides,
$$2\sin\frac x2 (\cos x + \cos 2x + … +\cos nx )= \sin(n+\frac12)x - \sin\frac x2 $$
Therefore,
$$ \int_0^\pi\frac{\sin\left(n+\frac{1}{2}\right)x}{\sin \frac{x}{2}}dx$$ $$=2\int_0^{\pi}(\cos x + \cos 2x + … +\cos nx )dx+\int_0^{\pi}dx= \pi$$
where all the cosine integrals vanish.