<s>[INST] Find $\cos\frac{\pi}{12}$ given $\sin(\frac{\pi}{12}) = \frac{\sqrt{3} -1}{2 \sqrt{2}}$ 
Find $\cos\frac{\pi}{12}$ given $\sin(\frac{\pi}{12}) = \frac{\sqrt{3} -1}{2 \sqrt{2}}$

From a question I asked before this, I have trouble actually with the numbers manipulating part.
Using trigo identity, $\sin^2 \frac{\pi}{12} + \cos^2 \frac{\pi}{12} = 1$ so , $\cos^2 \frac{\pi}{12} = 1- \sin^2 \frac{\pi}{12}$
To find $\cos \frac{\pi}{12} = \sqrt{1- \sin^2 \frac{\pi}{12}}$
$\sin^2 \frac{\pi}{12} = (\frac{\sqrt{3} -1}{2 \sqrt{2}})^2 = \frac{(\sqrt{3}-1)^2}{(2\sqrt{2})^2} = \frac{2- \sqrt{3}}{4}$
$\cos \frac{\pi}{12} = \sqrt{1-(\frac{\sqrt{3} -1}{2 \sqrt{2}})^2} $
$\cos \frac{\pi}{12} = \sqrt{1- \frac{2-\sqrt{3}}{4}}$
$\cos \frac{\pi}{12} = \frac{\sqrt{2+\sqrt{3}}}{2}$
What is wrong with my steps?
 [/INST] Nothing wrong.
If you prefer, we can do some simplification.
Let me focus on $\sqrt{2+\sqrt3}$.
Let  $$\sqrt{2+\sqrt3}+\sqrt{2-\sqrt3}=x$$
$$2+\sqrt3+2-\sqrt3+2=x^2$$
Hence, we have  $$\sqrt{2+\sqrt3}+\sqrt{2-\sqrt3}=\sqrt6.$$
Similarly, we have $$\sqrt{2+\sqrt3}-\sqrt{2-\sqrt3}=\sqrt2$$
Hence $$\sqrt{2+\sqrt3}=\frac{\sqrt6+\sqrt2}{2}=\frac{\sqrt3+1}{\sqrt2}.$$
$$\cos \frac{\pi}{12}=\frac{\sqrt3+1}{2\sqrt2}$$
</s>