Solve integral $\int_0^{2\pi}\frac{\sin^2\frac{(N+1)x}{2}}{2\pi(N+1)\sin^2\frac x2} dx $ My question is to solve
$$\int_0^{2\pi}\frac{\sin^2\left(\frac{N+1}{2}x\right)}{2\pi(N+1)\sin^2(x/2)} dx  $$
Up to $1000$ or more, Wolfram-Alpha solves this integral and gives the value $1$ for every integer. But, I couldn't prove that this is the case for any $N\in\mathbb{N}$.
I know if we didn't have the $N+1$ part and squares, this integral should be $1$. We also have
$$ \frac{\sin^2\left(\frac{N+1}{2}x\right)}{\sin^2(x/2)}=\frac{\cos((N+1)x)-1}{\cos(x)-1}=\sum_{n=0}^N\left(\sum_{k=-n}^n e^{inx} \right)$$
and
$$ \frac{\sin\left((N+\frac{1}{2})x\right)}{\sin(x/2)}=\sum_{n=-N}^Ne^{inx}= \sum_{k=1}^N2\cos(kx)+1$$
 A: Apply
$$\frac{\sin \frac{(N+1)x}2- \sin\frac{(N-1)x}2}{\sin \frac x2}=2\cos\frac{Nx}2 
$$
to the integral
\begin{align}
I_{N+1}&
= \int_{0}^{\pi}{\frac{\sin^2\frac{(N+1)x}2}{\sin^2\frac x2}}dx
 =\int_{0}^{\pi}\left({\frac{\sin\frac{(N-1)x}2}{\sin\frac x2}}+2\cos\frac{Nx}2 \right)^2dx\tag1
\end{align}
Note that the integration over the cross terms vanishes as shown below
\begin{align}
&\int_{0}^{\pi} {\frac{2\sin\frac{(N-1)x}2 \cos\frac{Nx}2 }{\sin\frac x2}}dx\\
=&\int_{0}^{\pi} \left( {\frac{\sin{(N-\frac12)x}}{\sin\frac x2}}-1\right)dx
=\int_{0}^{\pi}\sum_{k=1}^{N-1}2\cos kx dx=0
\end{align}
and (1) establishes a recursive relationship
\begin{align}
I_{N+1}= I_{N-1}+2\pi
\end{align}
which, with $I_1=\pi$ and $I_2 =2 \pi$, leads to $I_{N}=N\pi$. As a result
$$\int_0^{2\pi}\frac{\sin^2\frac{(N+1)x}{2}}{2\pi(N+1)\sin^2\frac x2} dx =\frac{2I_{N+1}}{2\pi(N+1)}=1 $$
A: \begin{align}
\frac{1}{2\pi(N+1)}\int_0^{2\pi}\frac{\sin^2\left(\frac{N+1}{2}x\right)}{\sin^2\left(\frac{x}{2}\right)} dx &\overset{\color{blue}{u = \frac{x}{2}}, \, \color{green}{n=N+1}}{=}\frac{1}{2\pi n}\color{blue}{2}\int_0^{\color{blue}{\pi}}\frac{\sin^2(nu)}{\sin^2(u)} du\\
& \overset{(\color{purple}{\text{Even})}}{=} \frac{1}{2\pi n}\int_{\color{purple}{-\pi}}^{\pi}\frac{\sin^2(nu)}{\sin^2(u)} du\\
& \overset{\color{blue}{s = u +\pi}}{=} \frac{1}{2\pi n}\int_{\color{blue}{0}}^{\color{blue}{2\pi}}\frac{(-1)^{2n}\sin^2(ns)}{(-1)^{2n}\sin^2(s)} ds\\
& = \frac{1}{2\pi n}2n\pi =1
\end{align}
where on the last step you use $\int_{0}^{2\pi} \frac{\sin^2(nx)}{\sin^2(x)} dx=2n\pi$ with $n \in \mathbb{N}$.
