computation of $\sum_{k=0}^{2p-1}( \cos(x+\frac{k \pi}{2p}))^{2p}$ Let $p \in \mathbb{N^*}, x \in \mathbb{R}$, someone I know was trying to compute the following sum:
$$\sum_{k=0}^{2p-1}\left( \cos\left(x+\frac{k \pi}{2p}\right)\right)^{2p}$$
It seems that the result is  $\frac{2p}{4^p} {2p \choose p}$ (which is notably independent of $x$) but the proof I encountered (by using Euler's formula and expanding with Newton binom) does not seem very natural to me. I wonder if someone here has an elegant way of computing this sum and if it can be generalized to other sums with $\sin$ for instance or other powers.
 A: I thought I would try
to derive your result.
After a number of mistakes,
here it is.
I agree - a simpler proof would be nice.
Using
$\cos(x)
=\frac12(e^{ix}+e^{-ix})
$,
$\begin{array}\\
s_p(x)
&=\sum_{k=0}^{2p-1}\left( \cos\left(x+\frac{k \pi}{2p}\right)\right)^{2p}\\
&=\dfrac1{2^{2p}}\sum_{k=0}^{2p-1}\left( e^{i\left(x+\frac{k \pi}{2p}\right)}+e^{-i\left(x+\frac{k \pi}{2p}\right)}\right)^{2p}\\
&=\dfrac1{4^{p}}\sum_{k=0}^{2p-1}\sum_{j=0}^{2p}\binom{2p}{j}\left( e^{ij\left(x+\frac{k \pi}{2p}\right)}e^{-i(2p-j)\left(x+\frac{k \pi}{2p}\right)}\right)\\
&=\dfrac1{4^{p}}\sum_{k=0}^{2p-1}\sum_{j=0}^{2p}\binom{2p}{j}\left( e^{ij\left(x+\frac{k \pi}{2p}\right)-i(2p-j)\left(x+\frac{k \pi}{2p}\right)}\right)\\
&=\dfrac1{4^{p}}\sum_{k=0}^{2p-1}\sum_{j=0}^{2p}\binom{2p}{j}\left( e^{2ij\left(x+\frac{k \pi}{2p}\right)-i2p\left(x+\frac{k \pi}{2p}\right)}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\sum_{k=0}^{2p-1}\sum_{j=0}^{2p}\binom{2p}{j}\left( e^{2ij\left(x+\frac{k \pi}{2p}\right)-ik\pi}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\sum_{j=0}^{2p}\sum_{k=0}^{2p-1}\binom{2p}{j}\left( e^{2ij\left(x+\frac{k \pi}{2p}\right)-ik\pi}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\sum_{j=0}^{2p}e^{2ijx}\binom{2p}{j}\sum_{k=0}^{2p-1}\left( e^{2ij\left(\frac{k \pi}{2p}\right)-ik\pi}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\sum_{j=0}^{2p}e^{2ijx}\binom{2p}{j}\sum_{k=0}^{2p-1}\left( e^{\left(\frac{ijk \pi}{p}\right)-ik\pi}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\sum_{j=0}^{2p}e^{2ijx}\binom{2p}{j}\sum_{k=0}^{2p-1}\left( e^{k\pi i\left(\frac{j}{p}-1\right)}\right)\\
&=\dfrac1{4^{p}}e^{-2ipx}\left(2pe^{2ipx}\binom{2p}{p}+\sum_{j=0,j\ne p}^{2p}e^{2ijx}\binom{2p}{j}\dfrac{1-e^{2p\pi i\left(\frac{j}{p}-1\right)}}{1-e^{\pi i\left(\frac{j}{p}-2\right)}}\right)\\
&=\dfrac{1}{4^{p}}e^{-2ipx}\left(2pe^{2ipx}\binom{2p}{p}+\sum_{j=0,j\ne p}^{2p}e^{2ijx}\binom{2p}{j}\dfrac{1-e^{2\pi i\left(j-p\right)}}{1-e^{\pi i\left(\frac{j}{p}-2\right)}}\right)\\
&=\dfrac{2p}{4^p}\binom{2p}{p}\\
\end{array}
$
A: This is not an answer.
What seems to happen is that the result of the summation includes at the same time powers of sines and cosines which combine and finally simplify because $\sin^2(x)+\cos^2(x)=1$ $\large (!!)$
Replacing the cosines by the sines leads to the same beautiful result $\frac{2p}{4^p} {2p \choose p}$
