Let $t = \frac{\pi}{13}$
then you know you want $$\cos(2t)+\cos(6t)+\cos(8t)$$
and if you call that $x$, square it, then you should have $$x^2 = \cos^2(2t)+\cos^2(6t)+\cos^2(8t)[\cos(2t)+\cos(4t)+\cos(6t)+\cos(8t)+\cos(10t)+\cos(12t)]$$
Note that,
$$[\cos(2t)+\cos(4t)+\cos(6t)+\cos(8t)+\cos(10t)+\cos(12t)] = -0.5$$
Hence,
$$x^2 = \cos^2(2t)+\cos^2(6t)+\cos^2(8t) - 0.5 $$
By the law of cosines,
$$x^2 = \frac{1}{2}(\cos(4t)+\cos(12t)+\cos(16t) + 3) - 0.5 $$
Hence,
$$2x^2 = \cos(4t)+\cos(12t)+\cos(16t) + 2 $$
and as we know $$x = \cos(2t) + \cos(6t) + \cos(8t)$$
Add $$2x^2 + x = \frac{-1}{2} +2 = \frac{3}{2}$$
Then we have,
$$4x^2 + 2x -3 = 0$$
Use Quadratic formula, then you will get two solutions, but you know the answer is positive.