Prove the trigonometric identity $(35)$ Prove that 
\begin{equation}
\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)=  \left\{
      \begin{aligned}
       \sqrt{n} \space \space \text{for $n$ odd}\\
       \\
        \ 1 \space \space \text{for $n$ even}\\
      \end{aligned}
    \right.
\end{equation}
I found this identity here at$(35)$. At the moment I don't know where I should start from.
Thanks!

$$\tan nx=\frac{^nC_1t-^nC_3t^3+^nC_5t^5-\cdots }{^nC_0t^0-^nC_2t^2+^nC_4t^4-\cdots }$$ where $t=\tan x$
If $\tan nx=0, x=\frac {k\pi}n$  where $0\le k< n$, clearly, the roots of this $n$-degree equation are $\tan\frac{k\pi}n$
If $n$ is odd,
$^nC_n(-1)^{\frac{n-1}2}t^n+^nC_{n-2}(-1)^{\frac{n-3}2}t^{n-2}+\cdots-^nC_3t^3+^nC_1t=0$
$^nC_n(-1)^{\frac{n-1}2}t^{n-1}+^nC_{n-2}(-1)^{\frac{n-3}2}t^{n-3}+\cdots-^nC_3t^2+^nC_1=0$ if we exclude $k=0$
So, $\prod_{k=1}^{n-1}\tan \left(\frac{k \pi}{n}\right)=n(-1)^{\frac{n-1}2}$ (applying Vieta's formula)
Now, $\tan \left(\frac{(n-k) \pi}{n}\right)=\tan \left(\pi-\frac{k \pi}{n}\right)=-\tan \left(\frac{k \pi}{n}\right)$
So, there are $\frac{n-1}2$ such pairs and $\lfloor \frac{n-1}2  \rfloor=\frac{n-1}2$ as $n$ is odd.
$\prod_{k=1}^{n-1}\tan \left(\frac{k \pi}{n}\right)$
$=(-1)^{\frac{n-1}2}\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan^2 \left(\frac{k \pi}{n}\right) $
$\implies (-1)^{\frac{n-1}2}\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan^2 \left(\frac{k \pi}{n}\right)=n(-1)^{\frac{n-1}2} $
$\implies \left(\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)\right)^2=n$
$\implies \prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)=\sqrt n$ as all the angles lies in $(0,\frac \pi 2)$
If $n$ is even, 
$ ^nC_1t^{n-1}-^nC_3t^{n-3}+^nC_5t^{n-5}-\cdots+^nC_{n-1}(-1)^{\frac n 2}t=0$ which has roots $\tan\frac{k\pi}n$ where $0\le k<n$ and $k\ne \frac n 2$ as $k=\frac n 2$ corresponds to $\tan \frac \pi 2(=\infty)$ which has occurred as the co-efficient of $t^n$ is $0$.
So, $ ^nC_1t^{n-2}-^nC_3t^{n-4}+^nC_5t^{n-6}-\cdots+^nC_{n-1}(-1)^{\frac n 2}=0$  if we exclude $k=0$ i.e., $(n-2)$ degree equation in $t$.
So, $$\prod_{\substack{k=1 \\ k\neq \frac{n}{2}}}^{n-1}\tan \left(\frac{k \pi}{n}\right)=-(-1)^{\frac n 2}$$
Now, $\tan \left(\frac{(n-k) \pi}{n}\right)=\tan \left(\pi-\frac{k \pi}{n}\right)=-\tan \left(\frac{k \pi}{n}\right)$
So, there are $\frac{n-2}2=(\frac n 2 -1)$ such pairs and $\lfloor \frac{n-1}2  \rfloor=\frac{n-2}2$ as $n$ is even.
$-(-1)^{\frac n 2}$
$={\displaystyle\prod_{\substack{k=1 \\ k \neq \frac{n}{2}}}^{n-1}} \tan \left(\frac{k \pi}{n}\right)$
$=(-1)^{\frac{n-2}2}\left(\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)\right)^2$
$\implies \left(\prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)\right)^2=1$
$\implies \prod_{k=1}^{\lfloor (n-1)/2  \rfloor}\tan \left(\frac{k \pi}{n}\right)=1$ as all the angles lies in $(0,\frac \pi 2)$
