I am "reminded" at the beginning of the exercise that $\cos\left(\dfrac{\pi}{4}\right)=\dfrac{\sqrt2}{2}$ and that $\cos (2x)=2\cos^{2}(x)- 1$. I have been trying to figure this out:
$$\cos\dfrac\pi8 = \dfrac{\sqrt{2 + \sqrt2}}2$$
for hours but keep going round in circles and it's driving me crazy. It is probably extremely obvious to solve but I just can't seem to be able to.
Let $\cos{\frac{\pi}{8}} = c$
You know that $\frac12 \sqrt 2 = \cos {\frac{\pi}{4}} = 2c^2 - 1$
So you can set up the quadratic $2c^2 - 1 = \frac 12\sqrt 2$
$c^2 = \frac 14 (2 + \sqrt 2)$
$c = \frac 12 \sqrt{2 +\sqrt 2}$ (taking the positive root based on the argument being in the first quadrant).