proving $\csc^2 \left( \frac{\pi}{7}\right)+\csc^2 \left( \frac{2\pi}{7}\right)+\csc^2 \left( \frac{4\pi}{7}\right)=8$ How can I prove the following identity using complex variables
$$
\begin{align*}
1) & \csc^2 \left( \frac{\pi}{7}\right)+\csc^2 \left( \frac{2\pi}{7}\right)+\csc^2 \left( \frac{4\pi}{7}\right)=8 \\ 
2) & \tan^2 \left( \frac{\pi}{16}\right) + \tan^2\left( \frac{3\pi}{16}\right) + \tan^2\left( \frac{5\pi}{16}\right)+ \tan^2\left( \frac{7\pi}{16}\right) = 28
\end{align*}
$$
On earlier problem, I was given,  $\displaystyle (z+a)^{2m}-(z-a)^{2m}=4maz  \prod_{k=1}^{m-1} \left(z^2+a^2 \cot^2 \left(\frac{k\pi}{2m} \right )\right ) $ for integer $m>1$. I am not sure if I can use this is helpful. I am stumped please help. 
 A: I am going to answer the question 2 by grouping terms.
Firstly, we are going to evaluate the sum $\displaystyle  \sum_{k=1}^{7} \tan ^{2}\left(\frac{k \pi}{16}\right). $
$\begin{aligned}\because  \tan \frac{(8-k) \pi}{16} &=\tan \left(\frac{\pi}{2}-\frac{k \pi}{16}\right) =\frac{1}{\tan \frac{k\pi}{16}} \\\therefore  \tan ^{2} \frac{k \pi}{16}+\tan ^{2} \frac{(8-k) \pi}{16}&=\tan ^{2} \frac{k \pi}{16}+\frac{1}{\tan ^{2} \frac{k \pi}{16}} \\&=\frac{\sin ^{4} \frac{k \pi}{16}+\cos ^{4} \frac{k \pi}{16}}{\cos ^{2} \frac{k \pi}{16} \cdot \sin ^{2} \frac{k \pi}{16}} \\&=\frac{1-2 \sin ^{2} \frac{k \pi}{16} \cos ^{2} \frac{k \pi}{16}}{\cos ^{2} \frac{k \pi}{16} \cdot \sin ^{2} \frac{k \pi}{16}} \\&=\frac{4}{\sin ^2\left(\frac{k \pi}{8}\right)}-2\end{aligned} \tag*{} $
$\begin{aligned}   \sum_{k=1}^{7} \tan ^{2} \frac{k \pi}{16}=&  \sum_{k=1}^{3}\left(\tan ^{2} \frac{k \pi}{16}+\tan ^{2} \frac{(8-k) \pi}{16}\right)+\tan ^{2} \frac{\pi}{4} \\=& \sum_{k=1}^{3}\left(\frac{4}{\sin ^{2} \frac{k \pi}{8}}-2\right)+1 \\=& 4 \sum_{k=1}^{3} \frac{1}{\sin ^{2} \frac{k \pi}{8}}-5\end{aligned} \tag*{} $
Now let’s evaluate the three terms one by one and get
$\displaystyle \sin ^{2}\left(\frac{\pi}{8}\right) =\frac{1-\cos \frac{\pi}{4}}{2} =\frac{1-\frac{\sqrt{2}}{2}}{2} =\frac{2-\sqrt{2}}{4} \tag*{} $
$\displaystyle \sin ^{2}\left(\frac{2 \pi}{8}\right)=\frac{1}{2} \tag*{} $
$\displaystyle \sin ^{2}\left(\frac{3 \pi}{8}\right) =\sin ^{2}\left(\frac{\pi}{2}-\frac{\pi}{8}\right) =\cos ^{2} \frac{\pi}{8} =1-\frac{2-\sqrt{2}}{4} =\frac{2+\sqrt{2}}{4} \tag*{} $
Summing them up yields
$\displaystyle \sum_{k=1}^{7} \tan ^{2}\left(\frac{k \pi}{16}\right)=4\left(\frac{4}{2-\sqrt{2}}+2+\frac{4}{2+\sqrt{2}}\right)-5 =35 \tag*{} $
Moreover,
$$\tan \left(\frac{2\pi}{16}\right)=\sqrt{2}-1 \Rightarrow \tan ^{2}\left(\frac{2\pi}{16}\right)=3-2 \sqrt{2} $$
$$\begin{aligned} \tan \left(\frac{6 \pi}{16}\right) &=\tan \left(\frac{\pi}{2}-\frac{\pi}{8}\right) =\frac{1}{\tan \frac{\pi}{8}} =\sqrt{2}+1 \end{aligned}\Rightarrow \tan ^{2}\left(\frac{6 \pi}{16}\right)=3+2 \sqrt{2}$$
Now we can conclude that
$$ \displaystyle \tan ^{2}\left(\frac{\pi}{16}\right)+\tan ^{2}\left(\frac{3 \pi}{16}\right)+\tan ^{2}\left(\frac{5 \pi}{16}\right)+\tan ^{2}\left(\frac{7 \pi}{16}\right)=35-(3-2\sqrt 2)-1-(3+2\sqrt 2)=28$$
