I intend to calculate $\cos\left(\frac{2\pi}{5}\right)$ via the formula $$\sin\left(\frac{\pi}{5}\right)=\sqrt{\frac{1-\cos\left(\frac{2\pi}{5}\right)}{2}}$$ This could be expressed as:
$\sqrt{\frac{5-\sqrt{5}}{8}}=\sqrt{\frac{1-\cos\left(\frac{2\pi}{5}\right)}{2}}$. Squaring both sides and manipulate a bit, this will give $\cos\left(\frac{2\pi}{5}\right)=-\frac{1-\sqrt{5}}{4}$. However, the true result is $\frac{\sqrt{5}-1}{4}$. What is wrong with my derivation?
Note that
$$-\frac{1-\sqrt{5}}{4}=(-1)\cdot\frac{1-\sqrt{5}}{4}=\frac{(-1)\cdot1-(-1)\cdot(\sqrt{5})}{4}=\frac{\sqrt{5}-1}{4}$$