Proving $\frac{1}{\cos^2\frac{\pi}{7}}+ \frac {1}{\cos^2\frac {2\pi}{7}}+\frac {1}{\cos^2\frac {3\pi}{7}} = 24$ Someone gave me the following problem, and using a calculator I managed to find the answer to be $24$.

Calculate $$\frac {1}{\cos^2\frac{\pi}{7}}+ \frac{1}{\cos^2\frac{2\pi}{7}}+\frac {1}{\cos^2\frac{3\pi}{7}}\,.$$

The only question left is, Why? I've tried using Euler's Identity, using a heptagon with Law of Cosine w/ Ptolemy's, etc. but the fact that the cosine values are all squared and in the denominator keeps getting me stuck.
If $\zeta=e^{\frac{2\pi i}{7}}$, then the required expression is
$$4\left(\frac{\zeta^2}{(\zeta+1)^2}+\frac{\zeta^4}{(\zeta^2+1)^2}+\frac{\zeta^6}{(\zeta^3+1)^2}\right).$$
How do we simplify this result further?

In this lovely answer, @joriki establishes the identity
$$
\sum _{l=1}^{n}\tan^2 \frac {l\pi } {2n+1}=n(2n+1)\;.
$$
With $n=3$ this gives
$$
\tan^2\frac\pi7+\tan^2\frac{2\pi}7 + \tan^2\frac{3\pi}7=21.
$$
The desired result follows from the identity $\sec^2\theta=1+\tan^2\theta$.
