Prove $4\sin^{2}\frac{\pi}{9}-2\sqrt{3}\sin\frac{\pi}{9}+1=\frac{1}{4}\sec^{2}\frac{\pi}{9}$. While attempting to algebraically solve a trigonometry problem in (Question 3535106), I came across the interesting equation

$$
4\sin^{2}\frac{\pi}{9}-2\sqrt{3}\sin\frac{\pi}{9}+1=\frac{1}{4}\sec^{2}\frac{\pi}{9}
$$

which arose from the deduction that $\frac{1}{4}\sqrt{\frac{256\sin^{4}40^{\circ}-80\sin^{2}40^{\circ}+12-\ 8\sqrt{3}\sin40^{\circ}}{\left(16\sin^{4}40^{\circ}-4\sin^{2}40^{\circ}+1\right)}}=\cos50^{\circ}$. Despite the apparent simplicity of the relationship, it seems quite tricky to prove. I managed to prove it by solving the equation as a quadratic in $(\sin\frac{\pi}{9})$ and then using the identity $\sqrt{\sec^2 x-1}=|\tan x|$, the double angle formulae and finally that $\frac{\sqrt{3}}{2}\cos x-\frac{1}{2}\sin x$ can be written in the form $\sin\left(x+\frac{2\pi}{3}\right)$.
But it seems like quite a neat problem. So, does anyone have a better way of proving it?

We need to prove that:
$$4\sin^220^{\circ}-4\sin60^{\circ}\sin20^{\circ}+1=\frac{1}{4\cos^220^{\circ}}$$ or
$$4\sin^240^{\circ}-8\sin60^{\circ}\sin40^{\circ}\cos20^{\circ}+4\cos^220^{\circ}=1$$ or
$$2-2\cos80^{\circ}-4\sin60^{\circ}(\sin60^{\circ}+\sin20^{\circ})+2+2\cos40^{\circ}=1$$ or
$$\cos40^{\circ}-\cos80^{\circ}-2\sin60^{\circ}\sin20^{\circ}=0,$$ which is obvious.
