<s>[INST] Why do the sum-of-angles and half-angle formulas return different answers for $\cos\frac\pi{12}$? Suppose I want to calculate $\cos\frac{\pi}{12}$. Using the sum-of-angles formula and using the half-angle formula results in different answers.
$$
\cos\frac{\pi}{12} = \cos\frac{\pi/6}{2} = \sqrt{\frac{1}{2}+\frac{\cos\frac{\pi}{6}}{2}} = \sqrt{\frac{1}{2}+\frac{\sqrt{3}}{4}} 
$$$$
\cos\frac{\pi}{12} = \cos\frac{\pi}{3}\cos\frac{\pi}{4}+\sin\frac{\pi}{3}\sin\frac{\pi}{4} = \left(\frac{1}{2}\right)\left(\frac{\sqrt{2}}{2}\right)+\left(\frac{\sqrt{3}}{2}\right)\left(\frac{\sqrt{2}}{2}\right) = \frac{\sqrt{2}+\sqrt{6}}{4}
$$
Why does this happen? Shouldn't these be the same?

Context: I'm writing up a common student question nicely as a Q&A here. If anyone has ideas how this could be re-tagged or edited to be more easily find-able by a person with this question (that is, more appropriately be indexed by search engines), please feel free to edit.
 [/INST] Those may not look the same, but they are equal! Notice the first one is wrapped completely in a square root, so rewrite the second one so that it too is wrapped in a single square root:
$$
\frac{\sqrt{2}+\sqrt{6}}{4} = 
\sqrt{\left(\frac{\sqrt{2}+\sqrt{6}}{4}\right)^2} = 
\sqrt{\frac{2 + 2\sqrt{2}\sqrt{6} + 6}{16}} = 
\sqrt{\frac{8 + 4\sqrt{3}}{16}} = 
\sqrt{\frac{1}{2} + \frac{\sqrt{3}}{4}} 
$$
</s>