Compute without calculator, $ \frac{1}{\cos^{2}(10)} + \frac{1}{\sin^{2}(20)} + \frac{1}{\sin^{2}(40)} - \frac{1}{\cos^{2}(45)} $

\begin{align*} &\;\frac{1}{\cos^{2}10^{\circ}} + \frac{1}{\sin^{2}20^{\circ}} + \frac{1}{\sin^{2}40^{\circ}} - \frac{1}{\cos^{2}45^{\circ}} \\ =&\;\frac {16\sin^210^\circ\cos^220^\circ}{16\sin^210^\circ\cos^210^\circ\cos^220^\circ}+\frac{4\cos^220^\circ}{4\sin^220^\circ\cos^220^\circ}+ \frac{1}{\sin^{2}40^{\circ}} -2\\ =&\;\frac{4(1-\cos20^\circ)(1+\cos40^\circ)+2(1+\cos40^\circ)+1}{\sin^240^\circ}-2\\ =&\;\frac{7-4\cos20^\circ+6\cos40^\circ-4\cos20^\circ\cos40^\circ}{\sin^240^\circ}-2\\ =&\;\frac{7-4\cos20^\circ+6\cos40^\circ-2\cos60^\circ-2\cos20^\circ}{\sin^240^\circ}-2\\ =&\;\frac{6-6\cos20^\circ+6\cos40^\circ}{\sin^240^\circ}-2\\ =&\;\frac{6-12\sin30^\circ\sin 10^\circ}{\sin^240^\circ}-2\\ =&\;\frac{6-6\cos 80^\circ}{\frac12(1-\cos80^\circ)}-2\\ =&\;10 \end{align*}


I believe this is how the problem came into being.

Observe that

$\dfrac1{\cos^210^\circ}=1+\tan^210^\circ$

$\dfrac1{\sin^220^\circ}=\dfrac1{\cos^270^\circ}=1+\tan^270^\circ$

$\dfrac1{\sin^240^\circ}=\dfrac1{\cos^250^\circ}=1+\tan^2(-50^\circ)$

Observe that the angles differ by $60^\circ$

Now if $\tan3x=\tan3A,3x=180^\circ n+3A$ where $n$ is any integer

$x=60^\circ n+A$ where $n=-1,0,1$ or more generally $n\equiv-1,0,1\pmod3$

Again, $\tan3A=\tan3x=\dfrac{3t-t^3}{1-3t^2}$

$\implies t^3-(3\tan3A)t^2-3t+\tan3A=0$ where $t=\tan x$

whose roots are $t_r=\tan(60^\circ r+A)$ where $r=-1,0,1$

$\displaystyle\implies S(A)$

$\displaystyle=\sum_{r=-1}^1t_r^2 =\left(\sum_{r=-1}^1t_r\right)^2-2(t_{-1}t_0+t_0t_1+t_1t_{-1}) =\left(\dfrac{3\tan3A}1\right)^2-2\left(\dfrac{-3}1\right)=6+9\tan^23A$

Here $3A=30^\circ\equiv-150^\circ\equiv210^\circ\pmod{180^\circ}$

So, $\tan3A=\tan30^\circ=\dfrac1{\sqrt3}$

$\implies S(10^\circ)=6+9\left(\dfrac1{\sqrt3}\right)^2=?$