Prove that $\sum\limits_{k=1}^{n-1}\tan^{2}\frac{k \pi}{2n} = \frac{(n-1)(2n-1)}{3}$
By a well know formula we have $$ \left(\cos{\frac{k\pi}{2n}} + i\sin{\frac{k\pi}{2n}}\right)^{2n}=(-1)^{k} $$ Hence by Binomial theorem we have ($[x]$ is not an integer part, brackets are added for clarity) $$ \sum_{t=0}^{2n}\binom{2n}{t}\left[\cos{\frac{k\pi}{2n}}\right]^t \cdot \left[i\sin{\frac{k\pi}{2n}}\right]^{2n-t}=(-1)^{k} $$ Now we consider only imaginary part of this: $$ \sum_{r=0}^{n-1}\binom{2n}{2r+1}\left[\cos{\frac{k\pi}{2n}}\right]^{2r+1} \cdot \left[i\sin{\frac{k\pi}{2n}}\right]^{2n-2r-1}=0 $$ Divide it by $[\cos{\frac{k\pi}{2n}}]^{2n}$: $$ \sum_{r=0}^{n-1}\binom{2n}{2r+1}\left[i\tan{\frac{k\pi}{2n}}\right]^{2n-2r-1}=0 $$ Now multiply by $i\tan{\frac{k\pi}{2n}}$: $$ \sum_{r=0}^{n-1}\binom{2n}{2r+1}\left[i\tan{\frac{k\pi}{2n}}\right]^{2n-2r}=0 $$ So $[\tan{\frac{k\pi}{2n}}]^2$ are roots of the following polynomial: $$ \sum_{r=0}^{n-1}\binom{2n}{2r+1}\left[-x\right]^{n-r}=0 $$ Hence by Vieta's_formulas sum of it roots is equal to $$ \frac{\binom{2n}{3}}{\binom{2n}{1}} =\frac{(2n-1)(n-1)}{3} $$
This problem is over 3 years old, but I was just made aware of it, so I thought I would add a new method of attack, similar to this answer.
Here we use the function $\dfrac{2n/z}{z^{2n}-1}$ which has residue $1$ at each $2n^\text{th}$ root of unity and residue $-2n$ at $0$.
Since $\tan^2\left(\dfrac\theta2\right)=-\left(\dfrac{z-1}{z+1}\right)^2$ for $z=e^{i\theta}$, define $$ f(z)=-\left(\frac{z-1}{z+1}\right)^2\frac{2n/z}{z^{2n}-1} $$ The sum of the residues of $f$ is $0$ since $|f(z)|\sim2n/z^{2n+1}$ as $|z|\to\infty$ and so an integral around a large circle vanishes.
On the other hand, the sum of the residues is twice the sum we want plus the residue at $0$ and the residue at $-1$.
$\hspace{32mm}$
Thus, $$ \begin{align} \sum_{k=1}^{n-1}\tan^2\left(\frac{k\pi}{2n}\right) &=-\frac12\left(\operatorname*{Res}_{z=0}(f(z))+\operatorname*{Res}_{z=-1}(f(z))\right)\\ &=-\frac12\left(2n-\frac23(2n^2+1)\right)\\ &=\frac{2n^2-3n+1}{3} \end{align} $$
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.