Answer
$$ \cos \frac{\pi}{8} =\sqrt{\frac{1}{2}+\frac{1}{2 \sqrt{2}}}$$
Work Step by Step
Since
$$\cos2\theta =\frac{1}{2}\left(1+\cos 2\theta \right) $$
Then
\begin{aligned}
\cos ^{2} \frac{\pi / 4}{2} &=\frac{1+\cos \pi / 4}{2} \\
\cos ^{2} \frac{\pi}{8} &=\frac{1+\frac{1}{\sqrt{2}}}{2} \\
&=\frac{1}{2}+\frac{1}{2 \sqrt{2}}
\end{aligned}
Hence
$$ \cos \frac{\pi}{8} =\sqrt{\frac{1}{2}+\frac{1}{2 \sqrt{2}}}$$