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?
 A: Another way would be to use the double angle formula
$$\sin 2\theta=2\sin\theta\cos\theta$$
With $\theta=\frac {\pi}{12}$, then
$$\sin 2\theta=\sin\frac {\pi}6=\frac 12$$
Thus
\begin{align*}
\cos\frac {\pi}{12} & =\frac {\sin 2\theta}{2\sin\theta}\\
 & =\frac 1{4\sin\theta}\\
 & =\frac 1{\sqrt 2(\sqrt 3-1)}
\end{align*}
Which is numerically equal to the answer you found. To get it into the form Wolfram Alpha produces, multiply the fraction by $\sqrt 3+1$.
A: Let $$\sqrt{2+\sqrt{3}}=\sqrt{x}+\sqrt{y}\implies x+y=2. xy=3/4 \implies x=3/2, y=1/2.$$
So $$\cos(\pi/12)=\frac{\sqrt{3}+1}{2\sqrt{2}}$$
OP is  right.
A: 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}$$
A: You can also use $$\cos(x)+\sin(x)=\sqrt{2}\sin(x+\frac{\pi}4)$$
In this instance with $x=\frac{\pi}{12}$ you get to calculate $\sin(\frac{\pi}3)$ which is known.
The advantage is that you don't get nested root, nor have to rationalize $\sqrt{3}-1$ on denominator, just fraction addition.
