<s>[INST] Prove $\cos(2\pi/7)$, $\cos(4\pi/7)$, and $\cos(6\pi/7)$ are roots of the equation $8x^3 + 4x^2 - 4x - 1 = 0$. The first part of the question asked you to show that $\theta = 0, 2\pi/7, 4\pi/7, 6\pi/7$ when $\cos(4\theta) = \cos(3\theta)$. By using $\cos(\theta) = \frac{1}{2} \left(z + \frac{1}{z} \right)$, I have managed to show that $$(z - 1)\left(z^3 - \frac{1}{z^4} \right) = 0$$ which gives you the seventh roots of unity. It is showing that those cosines are roots of the equation that I'm stuck on. The textbook has done similar problems, but those are conveniently much easier.
First, I tried expanding $$\cos(4\theta) = 8\cos^4(\theta) - 8\cos^2(\theta) + 1$$ and $$\cos(3\theta) = 4\cos^3(\theta) - 3\cos(\theta)$$ as powers of cosine, but am unable to get the cubic equation above (by substituting $x = \cos(\theta)$).
(Those cosines of multiples of $2\pi/7$are indeed roots of the cubic, I checked them.)
Next, I attempted to brute-force the cubic by expanding $(x - \cos(2\pi/7))(x - \cos(4\pi/7))(x - \cos(6\pi/7))$, giving you $$x^3 - \left(\cos\left(\frac{2\pi}{7}\right) + \cos\left(\frac{4\pi}{7}\right) + \cos\left(\frac{6\pi}{7}\right)\right)x^2 + \left(\cos\left(\frac{2\pi}{7}\right)\cos\left(\frac{4\pi}{7}\right) + \cos\left(\frac{2\pi}{7}\right)\cos\left(\frac{6\pi}{7}\right) + \cos\left(\frac{4\pi}{7}\right)\cos\left(\frac{6\pi}{7}\right)\right)x - \left(\cos\left(\frac{2\pi}{7}\right)\cos\left(\frac{4\pi}{7}\right)\cos\left(\frac{6\pi}{7}\right)\right).$$ The coefficient of $x^2$ equals $-0.5$, but again, the values of the coefficient of $x$ and the constant term evade me (not allowed to use decimals).
How could I find their values? Or is there another, simpler way of solving the question?
 [/INST] Using your work, note that $\cos(4 \theta) = \cos(3 \theta)$ gives:
$$(8u^4 - 8u^2 + 1) - (4u^3 - 3u) = 0 \implies 8u^4 - 4u^3 - 8u^2 + 3u + 1 = 0$$
where $u = \cos \theta$. $u = 1$ is a root, and hence dividing through by $u - 1$ we get:
$$\begin{array}{c|rrrr} 1 & 8 & -4 & -8 & 3 & 1 \\ & \downarrow & 8 & 4 & -4 & -1 \\ \hline & 8 & 4 & -4 & -1 & 0 \end{array}$$
or $8u^3 + 4u^2 - 4u - 1 = 0$.
</s>