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$$

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 $$
