<s>[INST] Prove that $\sum\limits_{k=1}^{n-1}\tan^{2}\frac{k \pi}{2n} = \frac{(n-1)(2n-1)}{3}$ How can you prove that
$$
\sum_{k=1}^{n-1}\tan^{2}\left(\frac{k \pi}{2n}\right)
=
\frac{\left(n-1\right)\left(2n - 1\right)}{3}
$$
for every integer $n\geq 1$ > ?.
PS: no, it's not a homework... :-)
 [/INST] I am doing a similar thing for $\cot$ i hope you can reciprocate it.
We have $$(\cot(\theta)-i)^{n} = \frac{ \cos{n\theta} - \sin{n \theta}}{\sin^{n}(\theta)}$$
Equating the real and imaginary parts on both sides we have $$ \frac{\sin(n\theta)}{\sin{\theta}} = \sum\limits_{s} {n \choose 2s+1}  (-1)^{s} \cot^{n-2s-1}(\theta)$$
Now take $2n+1$ instead of $n$ we have, $$\sin{(2n+1)\theta} = \sin^{2n+1}(\theta)P_{n}\cot^{2}(\theta)$$
for $\displaystyle 0 < \theta < \frac{\pi}{2}$ and where $P_{n}$ is the polynomial given by $${ 2n+1 \choose 1}T^{n} - {2n+1 \choose 3}T^{n-1} + \cdots$$
Noting that the zeros of $P_{n}$ are precisely $\displaystyle \frac{r\pi}{2n+1},\ n =1,2,..$, we have the first identity from the sum of the roots formula. 
From the inequality $\sin{x} < x < \tan{x}$ we have $$\cot^{2m}(x) < \frac{1}{x^{2m}} < (1 + \cot^{2}(x))^{m}$$ we have $$ \sum\limits_{r=1}^{n} \cot^{2m} \frac{r\pi}{2n+1}  < \frac{(2n+1)^2m}{\pi^{2m}} \sum\limits_{r=1}^{n} \frac{1}{r^{2m}} < \sum\limits_{r=1}^{n} \Bigl( 1 + \cot^{2} \frac{r\pi}{2n+1} \Bigr)^{m}$$
Therefore, $$\sum\limits_{r=1}^{n} \Bigl(1+\cot^{2} \frac{r\pi}{2n+1} \Bigr)^{m} =  \sum\limits_{r=1}^{n} \cot^{2m} \frac{r\pi}{2n+1} + \mathcal{O}(n^{2m-1})$$
In other words to find $c_{2m}$ where $ \sum\limits_{r=1}^{n} \cot^{2m} \frac{r\pi}{2n+1} = c_{2m}n^{2m} + \mathcal{O}(n^{2m-1})$ it suffices to look at the sum, $$ \cot^{2m} \frac{\pi}{2n+1} + \cot^{2m} \frac{2\pi}{2n+1} + \cdots + cot^{2m} \frac{n\pi}{2n+1}$$
which is the sum $s_{m}$ of $m-th$ powers of the roots of the polynomial $P_{n}$. Then you can complete it using newtons formula for the sum of the roots.
</s>