Summation related to $\tan^2$ What is $\displaystyle\sum _{n=1}^3 \tan^2 (\frac {n\pi}{7}) $. 
I substituted $7x=n\pi $, thus the summation changed to 
$$\tan^2 (x)+\tan^2 (n\pi-5x)+\tan^2(n\pi-4x)$$
which even on expanding doesn't prove useful . 
I also did $\tan (n\pi-x)= -\tan x $ . But that doesn't help either. Any hints will be useful. Thanks!
 A: Using the relation$$\tan^2A=\frac2{1+\cos2A}-1,$$we can write the sum as $$S=2\frac{2+2s_1+s_2}{1+s_1+s_2+s_3}-3,$$where $s_1,$ $s_2$, and $s_3$ are respectively the sum of $$\cos\frac{2k\pi}7\quad (k=1,2,3),$$the sum of their pairwise products, and their product (i.e. the $s_k$ are the three elementary symmetric forms in the three cosines).
Now, looking at the real parts of the roots of $z^7=1$ in the Argand diagram, we see that $s_1=-\frac12$. Further, using the formula $2\cos A\cos B=\cos(A+B)+\cos(A-B)$, we can write $$s_2=\frac12\sum_{k=1}^6\cos\frac{2k\pi}7=-\frac12$$(getting the latter equality from looking at the same Argand diagram). Finally, the previous cosine product identity gives$$s_3=\frac12\!\left(\cos\frac{8\pi}7+\cos\frac{4\pi}7\right)\cos\frac{4\pi}7=\frac14\left(\cos\frac{4\pi}7+\cos\frac{12\pi}7+\cos\frac{8\pi}7+1\right)=\frac18,$$where the last identity follows by considering the same argument as for $s_1$ but taking into account that the cosine is an even function so that all the roots except $1$ pair off. Substituting the values $s_1=s_2=-\frac12$ and $s_3=\frac18$ then gives the result $S=21$.
