Hard summation with cosine I am trying to compute $\sum_{j=1}^{n} (-1)^{j-1} \cos^{2k} (\frac {j \pi}{2n+2}).$ Setting $a = e^{\frac {jπ}{2n+2}}$ (and hence satisfying $a^{2n+2}=e^{j \pi}=-1$) we obtain that the left hand-side is the same as
$ \sum_{j=1}^{n} (-1)^{j-1} (\frac{a^j + a^{-j}}{2})^{2k} = \frac {1}{2^{2k}} \sum_{j=1}^{n} (-1)^{j-1} (a^j + a^{-j})^{2k} $
and so we are left to prove
$S = \sum_{j=1}^{n} (-1)^{j-1} (a^j + a^{-j})^{2k} = 2^{2k-1} .$
Now denote $f_n (x) = \sum_{j=1}^{n} (-x)^j.$ We have $f_n (-1) = n$ and $f_n (x) = \frac {1- (-x)^n}{1+x},$ for all $x≠-1.$ By the Binomial Theorem we have
$S = \sum_{j=1}^{n} (-1)^{j-1} (a^j + a^{-j})^{2k} = \sum_{j=1}^{n} (-1)^{j-1} \sum_{m=0}^{2k} \binom {2k}m a^{2j(m-k)},$
or
$S = \sum_{j=1}^{n} \sum_{m=0}^{2k} (-1)^{j-1}  \binom {2k}m a^{2j(m-k)},$
or
$S = \sum_{m=0}^{2k} \sum_{j=1}^{n} (-1)^{j-1}  \binom {2k}m a^{2j(m-k)},$
or,
$S = \sum_{m=0}^{2k} \binom {2k}m  \sum_{j=1}^{n} (-1)^{j-1} a^{2j(m-k)}.$
or,
$S = \sum_{m=0}^{2k} \binom {2k}m  f(a^{2j(m-k)}).$
I stuck there. Am I right so far? Thank you
 A: Note that
$$\cos ^{2k}\theta ={\frac {1}{2^{2k}}}\sum _{i=0}^{2k}{\binom {2k}{i}}\cos {{\big (}(2k-2i)\theta {\big )}}$$
Define
\begin{align}
S_{n,k}&=\sum_{j=1}^{n-1} (-1)^{j-1} \cos^{2k} \frac {j \pi}{2n}\\
&=\sum_{j=1}^{n} (-1)^{j-1} \cos^{2k} \frac {j \pi}{2n}=\sum_{j=1}^{n}a_j
\end{align}
where
$$a_j=(-1)^{j-1}\cos^{2k} \frac {j \pi}{2n}=(-1)^{j-1}{\frac {1}{2^{2k}}}\sum _{l=0}^{2k}{\binom {2k}{l}}\cos {{\big (}(k-l)\frac{j\pi}{n} {\big )}}$$
We have then
\begin{align}
S_{n,k}&={\frac {1}{2^{2k}}}\sum _{l=0}^{2k}{\binom {2k}{l}}\sum_{j=1}^{n}(-1)^{j-1}\cos {{\big (}(k-l)\frac{j\pi}{n} {\big )}}\\
&=-{\frac {1}{2^{2k}}}\mathrm{Re}\;\sum _{l=0}^{2k}{\binom {2k}{l}}\sum_{j=1}^{n}(-1)^{j}\exp {{\big (}i(k-l)\frac{j\pi}{n} {\big )}}
\end{align}
Since
$$
\sum_{j=0}^{n}(-1)^{j}\exp {{\big (}i(k-l)\frac{j\pi}{n} {\big )}}=\frac{1+(-1)^{k-l+n}\exp {{\big (}i(k-l)\frac{\pi}{n} {\big )}}}{1+\exp {{\big (}i(k-l)\frac{\pi}{n} {\big )}}}=b_l=
\begin{cases}
1\quad\text{if $k-l+n$ is even}\\
b'_l\quad\text{if $k-l+n$ is odd}
\end{cases}
$$
we have
\begin{align}
S_{n,k}=-{\frac {1}{2^{2k}}}\mathrm{Re}\;\sum _{l=0}^{2k}{\binom {2k}{l}}(b_l-1)&={\frac {1}{2^{2k}}}\sum _{l=0}^{2k}{\binom {2k}{l}}-{\frac {1}{2^{2k}}}\mathrm{Re}\;\sum _{l=0}^{2k}{\binom {2k}{l}}b_l\\
&=1-\frac12-{\frac {1}{2^{2k}}}\mathrm{Re}\;\sum _{l}{\binom {2k}{l}}b'_l\\
&=\frac12\tag{If $n\ge k)\quad(*$}
\end{align}
$(*):$ Assuming $n\ge k$, then $\forall l$, $1+\exp {{\big (}i(l-k)\frac{\pi}{n} {\big )}}\neq0$, and
$$b'_{2k-l}=\frac{1-\exp {{\big (}i(l-k)\frac{\pi}{n} {\big )}}}{1+\exp {{\big (}i(l-k)\frac{\pi}{n} {\big )}}}=-b'_l$$
which yields
$$\mathrm{Re}\;\sum _{l}{\binom {2k}{l}}b'_l=0$$
