A closed form for $ \int_{0}^{\frac{\pi}{2}}{\left(\frac{\sin{\left(nx\right)}}{\sin{x}}\right)^{2p}\,\mathrm{d}x} $? For $ n,p\in\mathbb{N} $, define $ I_{p}\left(n\right) $ as follows : $$ I_{p}\left(n\right)=\int_{0}^{\frac{\pi}{2}}{\left(\frac{\sin{\left(nx\right)}}{\sin{x}}\right)^{2p}\,\mathrm{d}x} $$
A closed form can be found for $ I_{0}\left(n\right) $, $ I_{1}\left(n\right) $ and $ I_{2}\left(n\right) $, for any $ n\in\mathbb{N} $, we have the following identities : \begin{aligned} I_{0}\left(n\right)&=\frac{\pi}{2} \\I_{1}\left(n\right)&=\frac{n\pi}{2} \\I_{2}\left(n\right)&=\frac{n\pi\left(2n^{2}+1\right)}{6}\end{aligned}
Can we generalise the result for all $ p\in\mathbb{N} $ ?
 A: By symmetry, we have $\int_0^{\pi/2}=\frac12\int_{-\pi/2}^{\pi/2}$. Substituting $z=e^{2\mathrm{i}x}$, we get (using the "coefficient-of" notation) $$I_p(n)=\frac{1}{4\mathrm{i}}\oint_{|z|=1}\left(\frac{z^n-1}{z-1}\right)^{2p}\frac{\mathrm{d}z}{z^{(n-1)p+1}}=\frac{\pi}{2}[z^{(n-1)p}](1+z+\ldots+z^{n-1})^{2p}.$$ For a fixed $p$, a closed form is easy to obtain. But for a fixed $n$, even the case $n=3$ is hard enough.
A: You can use somme proprieties of Fejér Kernel. So we have:
$$F_n(2x)=\frac{1}{n}\biggl(\frac{\sin (nx)}{\sin x}\biggr)^2=\sum_{k=-n}^n\biggl(1-\frac{|k|}{n}\biggr)e^{2ikx}$$
Then we have,
$$I_p(n)=n\sum_{k_1=-n}^n\sum_{k_2=-n}^n...\sum_{k_p=-n}^n\prod_{j=1}^p\biggl(1-\frac{|k_j|}{n}\biggr)\int_0^{\pi/2}e^{2xi\sum_{j=1}^pk_j}dx$$
Therefore we get,
$$I_p(n)=n\sum_{k_1=-n}^n\sum_{k_2=-n}^n...\sum_{k_p=-n}^n\prod_{j=1}^p\biggl(1-\frac{|k_j|}{n}\biggr)\biggl(\frac{(-1)^{\sum_{j=1}^pk_j}-1}{2i\sum_{j=1}^pk_j}\biggr)$$
For more information about Fejér Kernel see this link https://en.wikipedia.org/wiki/Fej%C3%A9r_kernel.
