How to prove $2\sum_{k=1}^n{(-1)^{k-1} \cos\frac{k\pi}{2n+1}} = 1$ 
Prove $$2\sum_{k=1}^n{(-1)^{k-1} \cos\frac{k\pi}{2n+1}} = 1$$

I got this question when I was going through some basic trigonometric identities as follows
$2(\cos\frac{\pi}{5}-\cos\frac{2\pi}{5}) =1\tag1$
very much straightforward to recognise
$2(\cos\frac{\pi}{7}-\cos\frac{2\pi}{7} + \cos\frac{3\pi}{7})=1\tag2$
Following steps proves the identity
$8\cos\frac{\pi}{7}\cdot\cos\frac{2\pi}{7}\cdot\cos\frac{4\pi}{7} = -1$
$4\cos\frac{\pi}{7}[2\cos\frac{4\pi}{7}\cdot\cos\frac{2\pi}{7}] = -1$
$4\cos\frac{\pi}{7}[\cos\frac{6\pi}{7}+ \cos\frac{2\pi}{7}] =-1    $
$4\cos\frac{\pi}{7}[\cos\frac{2\pi}{7}-\cos\frac{\pi}{7}] =-1    $
$4\cos\frac{\pi}{7}\cdot\cos\frac{2\pi}{7} - 4\cos^{2}\frac{\pi}{7} = -1$
Further simplification will lead to equality 2
$2(\cos\frac{\pi}{9}-\cos\frac{\pi}{9} + \cos\frac{3\pi}{9}- \cos\frac{4\pi}{9}) = 1$
by using transformation formula we can prove above one also
But when it comes to following equalities
$2(\cos\frac{\pi}{11}-\cos\frac{2\pi}{11} + \cos\frac{3\pi}{11}- \cos\frac{4\pi}{11}+ \cos\frac{5\pi}{11} )= 1$
$2(\cos\frac{\pi}{13}-\cos\frac{2\pi}{13} + \cos\frac{3\pi}{13}- \cos\frac{4\pi}{13}+ \cos\frac{5\pi}{13} -\cos\frac{6\pi}{13} )= 1$
I was able to check the results with brute force in Wolfram|Alpha for above equalities, but not able to get the steps properly even though I tried manually
My question is how to generalise the summation formula and is there any method other than trigonometric approach?
$$2\sum_{k=1}^n{(-1)^{k-1} \cos\frac{k\pi}{2n+1}} = 1$$

Let $z=e^{\frac{\pi i}{2 n+1}}$ , then $$
\begin{aligned}
\sum_{k=1}^{n}(-1)^{k-1} z^{k} &=\frac{z\left[1-(-z)^{n}\right]}{1+z} \\
&=\frac{e^{\frac{\pi i}{2 n+1}}\left(1+(-1)^{n+1} e^{\frac{n \pi i}{2 n+1}}\right)}{1+e^{\frac{\pi i}{2 n+1}}}
\end{aligned}
$$
Multiplying both the numerator and denominator by $e^{-\frac{\pi i}{2(2 n+1)}}$ yields
$$
\begin{aligned}\sum_{k=1}^{n}(-1)^{k-1} z^{k}& = \frac{e^{\frac{\pi i}{2(2 n+1)}}+(-1) ^{n+1} e^{\left(\frac{\pi i}{2(2 n+1)}+\frac{n \pi i}{2 n+1}\right)}}{e^{\frac{\pi i}{2(2 n+1)}}+e^{-\frac{\pi i}{2(2 n+1)}}}\\ &= \frac{e^{\frac{\pi i}{2(2 n+1)}}+(-1)^{n+1} e^{\frac{\pi}{2} i}}{e^{\frac{\pi i}{2(2 n+1)}+} e^{-\frac{\pi i}{2(2 n+1)}}}\\&=  \frac{\cos \left(\frac{\pi}{2(2 n+1)}\right)+i \sin \left(\frac{\pi}{2(2 n+1)}\right)+(-1)^{n+1} i}{2 \cos \left(\frac{\pi}{2(2 n+1)}\right)} \qquad\qquad (*)
\end{aligned}  $$
Comparing the real parts of (*) yields
$$
\sum_{k=1}^{n}(-1)^{k-1} \cos \left(\frac{k \pi}{2 n+1}\right)=\frac{1}{2} $$
By the way, comparing the imaginary parts of (*) gives
$$
\sum_{k=1}^{n}(-1)^{k-1} \sin \left(\frac{k \pi}{2 n+1}\right)=\frac{1}{2}\left[\tan \left(\frac{\pi}{2(2 n+1)}\right)+(-1)^{n+1} \sec \left(\frac{\pi}{2(2 n+1)}\right)\right]
$$
