Need help to understand how to deduce the value of $\cos^2\displaystyle\big(\frac{\pi}{5}\big)+\cos^2\big(\frac{2\pi}{5}\big)$ I have some trouble understanding the steps provided in the book on solving the last part of the question.
For context purposes (and to provide the full picture), the whole question (with solution) is as follows:

Prove de Moivre's theorem for positive integer exponents.
  (I have no problem with this)



Using de Moivre's theorem, show that $\sin5\theta=a \sin^5\theta+b \cos^2\theta\sin^3\theta+c\cos^4\theta\sin\theta$ , where $a,b$ and $c$ are integers to be determined. (No issue with this either)



Express $\displaystyle\frac{\sin5\theta}{\sin\theta}$ in terms of $\cos\theta$, where $\theta$ is not a multiple of $\pi$. (Still no problem)



Hence, find the roots of the equation $16x^4-12x^2+1=0$ in trigonometric form. (I understand this part)



Deduce the value of $\displaystyle\cos^2\Big(\frac{\pi}{5}\Big)+\cos^2\Big(\frac{2\pi}{5}\Big)$. (I don't understand the working given by the book)


My question is, since it is found that $\displaystyle\cos^2\theta=\frac{3\pm\sqrt5}{8}$, how to tell that $\displaystyle\cos^2\frac{\pi}{5}=\frac{3+\sqrt5}{8}$ and how is it known that $\displaystyle\cos^2\frac{2\pi}{5}=\frac{3-\sqrt5}{8}$?
 A: Since what you asked seems to be answered in comments, here is an alternative way in case you are interested, it uses Euler's formula $$e^{it}=\cos t +i \sin t.\tag{*}$$
First notice that (*) implies $\cos t = \frac{1}{2}(e^{it}+e^{-it})$. Now put $z=e^{i\frac{\pi}{5}}$, and notice that $z^5=e^{i\pi}=-1$. Subsequently, we get $z^{-2}=z^{3}/z^5=-z^3$, and similarly $z^{-4}=z/z^5=-z$.  
Then finally we have
\begin{align}
\cos^2 \frac{\pi}{5}+\cos^2 \frac{2\pi}{5}&= \left(\frac{1}{2}(e^{i\frac{\pi}{5}}+e^{-i\frac{\pi}{5}})\right)^2+\left(\frac{1}{2}(e^{i\frac{2\pi}{5}}+e^{-i\frac{2\pi}{5}})\right)^2\\
&=\frac{1}{4}((z+z^{-1})^2+(z^2+z^{-2})^2)\\
&=\frac{1}{4}(z^2+2+z^{-2}+z^4+2+z^{-4})\\
&=\frac{1}{4}(z^2+2-z^3+z^4+2-z)\\
&=\frac{1}{4}(3+1-z+z^2-z^3+z^4)\\
&=\frac{1}{4}\left(3+\frac{z^5+1}{z+1}\right)\\
&=\frac{3}{4}
\end{align}
where we have used $(z+1)(1-z+z^2-z^3+z^4)=z^5+1=0$.
A: $$t=\pi/10 \implies 5t=\pi/2 \implies 2t=\pi/2-3t \implies \sin 2t= \sin(\pi/2-3t)$ \implies \sin 2t= \cos 3t$$
$$\implies 2\sin t \cos t=4 \cos^2 t-3 \cos t \implies 4\sin^2t+2 \sin t+1=0 \implies \sin t =\frac{\pm\sqrt{5}-1}{4}$$
Since $t=\pi/10$ is acute angle so its $\sin$ value should be positive. hence.
$$\sin \pi/10=\frac{\sqrt{5}-1}{4}~~~~(1)$$
using $$\cos 2t=1-\sin^2 t \implies \cos \pi/5=\frac{\sqrt{5}+1}{4}~~~(2)$$
Let $$F=\cos^2(\pi/5)+\cos^2(2\pi/5)=\cos^2(\pi/5)+[\cos(\pi/2-\pi/10)]^2=\cos^2(\pi/5)+\sin^2(\pi/10)$$
Using (1) and (2), we get
$$F=\left(\frac{\sqrt{5}+1}{4}\right)^2+\left(\frac{\sqrt{5}-1}{4}\right)^2=2(5/16+1/16)=3/4.$$
