Finding roots of the equation $8x^3+4x^2-4x-1=0$ which are in form of cosine of angles. So, I start this by reducing it to a cubic with 0 coefficient of the 2nd degree term which gives me :
$$\left(x + \frac{1}{6}\right)^3 - \frac{7}{12}\left(x + \frac{1}{6}\right)-\frac{7}{216}=0$$
Replacing $\left(x + \frac{1}{6}\right)$ by $y$:
$$y^3-\frac{7}{12}y -\frac{7}{216}=0$$
Then replacing $y$ by $r \cos(\alpha)$ and comparing the equation with :
$$\cos^3 (\alpha) - \frac{3}{4}\cos(\alpha)-\frac{1}{4}\cos(3\alpha)=0$$
I get:
$$r = \sqrt{\frac{7}{3}}, \alpha = \frac{1}{3}\cos^{-1}\left(\frac{1}{2\sqrt{7}}\right)$$
which finally give:
$$\theta = \cos^{-1}\left(\frac{\sqrt{7}}{9}\cos^{-1} \left(\frac{1}{2\sqrt{7}}\right)-\frac{1}{6}\right)$$
which is approximately 1.329 on putting it in the calculator.
But if I consider the common problem:
$8x^3-4x^2-4x+1=0$ having roots $\cos(\pi/7), \cos(3\pi/7), \cos(5\pi/7)$.
If I replace $x$ by $-x$ in this equation, we get:
$$8x^3+4x^2-4x-1=0$$
which is same the expression in the actual problem. So its roots must be $-\cos(\pi/7), -\cos(3\pi/7), -\cos(5\pi/7)$. This clearly doesn't matches with the answer I got.
Where I go wrong? Also can someone confirm while comparing coefficients in $cos(\alpha)$ variable cubic equation, we treat $\cos(3\alpha)$ as a constant. My book give a special section in which it shows this method of comparing in this way. So I guess its probably right? But I am not sure how is it right, isn't $\cos(3\alpha)$ also dependent on the main variable $\cos(\alpha)$.

if we take $t=2x$   we have $t^3 + t^2 - 2t - 1$
next, take complex number $w$   with $w \neq 1$  but $w^7 = 1.$   Factoring out a $w-1$ tells us $1 + w + w^2 + w^3 + w^4 + w^5 + w^6 = 0.$   Now take $t = w + w^6$  which is the same as $w + \frac{1}{w}.$   We find $ t^2 = w^2 + 2 + w^5,$   while $t^3 = w^3 + 3 w + \frac{3}{w}  + \frac{1}{w^3} = w^3 + 3 w + 3 w^6 + w^4 $
Adding,
$$  t^3 + t^2 =    w^3 + 3 w + 3 w^6 + w^4  +  w^2 + 2 + w^5  ,$$
in order
$$ t^3 + t^2 = 3 w^6 + w^5 + w^4 + w^3 + w^2 + 3w + 2$$   so that
$$ t^3 + t^2 -2t =  w^6 + w^5 + w^4 + w^3 + w^2 + w + 2$$   and
$$ t^3 + t^2 -2t - 1 =  w^6 + w^5 + w^4 + w^3 + w^2 + w + 1$$
finally
$$ t^3 + t^2 -2t - 1 =  0$$
Taking $w = \cos \frac{2\pi}{7}  + i \sin \frac{2\pi}{7},$   so that
$ 1/w =  \cos \frac{2\pi}{7}  - i \sin \frac{2\pi}{7},$  we see
$$    t = 2\cos \frac{2\pi}{7} $$
is one of the roots $t.$   Next we may take $w = \cos \frac{4\pi}{7}  + i \sin \frac{4\pi}{7},$  so that  $    t = 2\cos \frac{4\pi}{7} $  is another root. The last one can be $w = \cos \frac{8\pi}{7}  + i \sin \frac{8\pi}{7},$so that  $    t = 2\cos \frac{8\pi}{7} $  is the third root.
