Integral calculus sine functions: $\frac{1}{2\pi }\int_{-\pi }^{\pi }\frac{\sin\left((n+1/2)\,x\right)}{\sin\left(x/2\right)}\,dx = 1$ For an integer, $n$, how do I show the following?
$$
\frac{1}{2\pi }\int_{-\pi }^{\pi }\frac{\sin\left((n+1/2)\,x\right)}{\sin\left(x/2\right)}\,dx = 1.
$$
Can I use induction?
 A: Observe that
$$\frac{\sin\left(n+\frac12\right)x}{\sin\frac x2}=2\sum_{k=0}^n\cos kx+1\implies$$
$$\int_{-\pi}^\pi\frac{\sin\left(n+\frac12\right)x}{\sin\frac x2}dx=2\sum_{k=0}^n\int_{-\pi}^\pi\cos kx\,dx+2\pi=2\pi$$
and we're done.
A: You are integrating the Dirichlet kernel
$$ D_n(x) = \sum_{k=-n}^{n}e^{ikx} = 1+2\sum_{k=1}^{n}\cos(kx) = \frac{\sin\left((n+1/2)x\right)}{\sin(x/2)} \tag{1}$$
where the last equality follows from creative telescoping, since
$$ 2\cos(kx)\sin(x/2) = \sin\left((k+1/2)x\right)-\sin\left((k-1/2)x\right).\tag{2}$$
As a by-product of $(1)$,
$$ \int_{0}^{2\pi}D_n(x)\,dx = 2\pi+\sum_{k=1}^{n}\int_{0}^{2\pi}\cos(kx)\,dx = 2\pi.\tag{3} $$
A: To use induction, first establish a base case.  If $n=0$, then we see trivially that 
$$\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left((n+1/2)x\right)}{\sin(x/2)}\,dx=\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left(x/2\right)}{\sin(x/2)}\,dx=1$$
Next, we assume that for some integer $N\ge 1$ we have
$$\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left((N+1/2)x\right)}{\sin(x/2)}\,dx=1$$
We now examine the integral for $n=N+1$.  Proceeding, we have
$$\begin{align}
\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left((N+1+1/2)x\right)}{\sin(x/2)}\,dx&=\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left((N+1/2)x\right)+2\cos((N+1)x)\sin(x/2)}{\sin(x/2)}\,dx\\\\
&=\color{blue}{\frac{1}{2\pi}\int_{-\pi}^\pi \frac{\sin\left((N+1/2)x\right)}{\sin(x/2)}\,dx}+\color{red}{\frac1\pi \int_{-\pi}^\pi \cos((N+1)x)\,dx}\\\\
&=\color{blue}{1}+\color{red}{0}\\\\
&=1
\end{align}$$
as was to be shown!
