Let $x=2 \cos \frac{2 \pi}{5}$ and $y=2 \cos \frac{4 \pi}{5}$. It is given that $x+y+1=0$. Calculate $x$ and $y$.
Let's explain why $x+y+1=0$.

Using $2 \sin a \cos b=\sin (a+b)-\sin (b-a)$, we get $\sin \frac{\pi}{5}(x+y) = \sin \frac{3 \pi}{5} - \sin \frac{\pi}{5} + \sin \pi - \sin \frac{3 \pi}{5} = -\sin \frac{\pi}{5}$, so $\left(\sin \frac{\pi}{5}\right)(x+y+1)=0$.

According to the formula $\cos 2 \theta=2 \cos ^{2} \theta-1$, we have $y=x^{2}-2$, so $0=x+x^{2}-2+1 = x^{2}+x-1$.

We deduce that $x=\frac{-1 \pm \sqrt{5}}{2}$. Since $x>0$, we have $x=\frac{-1+\sqrt{5}}{2}$. Therefore, $y=\frac{-1-\sqrt{5}}{2}$.