how to calculate the exact value of $\tan \frac{\pi}{10}$ I have an extra homework: to calculate the exact value of $ \tan \frac{\pi}{10}$. 
From WolframAlpha calculator I know that it's $\sqrt{1-\frac{2}{\sqrt{5}}} $, but i have no idea how to calculate that.
Thank you in advance,
Greg

$\newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert #1 \right\vert}%
 \newcommand{\yy}{\Longleftrightarrow}$
$$
\cos\pars{\bracks{n + 1}\theta} + \cos\pars{\bracks{n - 1}\theta}
=
2\cos\pars{n\theta}\cos\pars{\theta}
$$
$$
\cos\pars{\bracks{n + 1}\theta}
=
2\cos\pars{n\theta}\cos\pars{\theta}
-
\cos\pars{\bracks{n - 1}\theta}
$$
Let's $\theta = \pi/10$ and $x = \cos\pars{\theta}$:
\begin{align}
\cos\pars{2\theta}
&=
2x^{2} - 1
\tag{1}
\\
\cos\pars{3\theta}
&=
\bracks{2\cos\pars{2\theta} - 1}x
\tag{2}
\\
\cos\pars{4\theta}
&=
2\cos\pars{3\theta}x - \cos\pars{2\theta}
\tag{3}
\\
0
&=
2\cos\pars{4\theta}x - \cos\pars{3\theta}
\tag{4}
\end{align}
$\pars{3}$ and $\pars{4}$ yield:
$$
0 = \pars{4x^{2} - 1}\cos\pars{3\theta} - 2\cos\pars{2\theta}x
\tag{5}
$$
$\pars{2}$ and $\pars{5}$ yield:
$$
0 = \pars{4x^{2} - 1}\bracks{2\cos\pars{2\theta} - 1}x - 2\cos\pars{2\theta}x
=
\pars{8x^{3} - 4x}\cos\pars{2\theta} - 4x^{3} + x
$$
$$
4\pars{2x^{2} - 1}\cos\pars{2\theta} - 4x^{2} + 1 = 0
\tag{6}
$$
$\pars{1}$ and $\pars{6}$ yield:
$$
0 = 4\pars{2x^{2} - 1}^{2} - 4x^{2} + 1
=
4\pars{2x^{2} - 1}^{2} - 2\pars{2x^{2} - 1} - 1
$$
Then,
$$
\pars{2x^{2} - 1}_{\pm}
=
{2 \pm \sqrt{\pars{-2}^{2} - 4\times 4\times\pars{-1}} \over 2\times 4}
=
{1 \pm \sqrt{5} \over 4}
$$
Obviously, we take the "$+$ sign" as a solution:
$$
2x^{2} - 1
=
{1 + \sqrt{5} \over 4}
\quad\imp\quad
x = \cos\pars{\pi \over 10}
=
\sqrt{{1 \over 2}\bracks{1 + {1 + \sqrt{5} \over 4}}}
=
\sqrt{{5 + \sqrt{5} \over 8}}
$$
Then,
\begin{align}
\tan\pars{\pi \over 10}
&=
\sqrt{\bracks{1 \over \cos\pars{\pi/10}}^{2} - 1}
=
\sqrt{{8 \over 5 + \sqrt{5\,}} - 1}
=
\sqrt{3 - \sqrt{5\,} \over 5 + \sqrt{5\,}}
=
\sqrt{1 - 2\,{1 + \sqrt{5\,} \over 5 + \sqrt{5}}}
\\[3mm]&=
\sqrt{1 - 2\,{\pars{1 + \sqrt{5\,}}\pars{5 - \sqrt{5\,}} \over 20}}
=
\sqrt{1 - {4\sqrt{5\,} \over 10}}
=
\sqrt{1 - {2 \over \sqrt{5\,}}}
\\[5mm]&
\end{align}
$${\large%
\tan\pars{\pi \over 10} = \sqrt{1 - {2 \over \sqrt{5\,}}}}
$$
