Answer :

To find the exact value of [tex]\(\cos \frac{\pi}{8}\)[/tex] in the form [tex]\(\sqrt{a + \sqrt{b}}\)[/tex], let's go through a detailed, step-by-step solution.

First, we can use the half-angle identity for cosine. The half-angle identity for cosine is:
[tex]\[ \cos \frac{\theta}{2} = \sqrt{\frac{1 + \cos \theta}{2}} \][/tex]

Let's set [tex]\(\theta = \frac{\pi}{4}\)[/tex] because we know the value of [tex]\(\cos \frac{\pi}{4}\)[/tex]:
[tex]\[ \cos \frac{\pi}{4} = \frac{\sqrt{2}}{2} \][/tex]

Now, applying the half-angle identity to find [tex]\(\cos \frac{\pi}{8}\)[/tex]:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{\frac{1 + \cos \frac{\pi}{4}}{2}} \][/tex]
Substitute the known value of [tex]\(\cos \frac{\pi}{4}\)[/tex]:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{\frac{1 + \frac{\sqrt{2}}{2}}{2}} \][/tex]

Simplify inside the square root:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{\frac{2 + \sqrt{2}}{4}} \][/tex]

Further simplification leads us to:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{\frac{2 + \sqrt{2}}{4}} = \frac{\sqrt{2 + \sqrt{2}}}{\sqrt{4}} = \frac{\sqrt{2 + \sqrt{2}}}{2} \][/tex]

We can see that:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{\frac{1 + \frac{\sqrt{2}}{2}}{2}} = \sqrt{\frac{1}{2} + \frac{\sqrt{2}}{4}} \][/tex]

Matching this with the format [tex]\(\sqrt{a + \sqrt{b}}\)[/tex], we identify:
[tex]\[ a = 1 \][/tex]
[tex]\[ b = 2 \][/tex]

So, the exact value of [tex]\(\cos \frac{\pi}{8}\)[/tex] is in the form:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{1 + \sqrt{2}} \][/tex]

Thus, we have:
[tex]\[ \cos \frac{\pi}{8} = \sqrt{1 + \sqrt{2}} \][/tex]