Question: How would you find the roots of the cubic$$x^3+x^2-10x-8=0\tag{1}$$
I'm not too sure where to begin. I'm thinking of somehow, implementing $\cos 3\theta=4\cos^3\theta-3\cos\theta$.
I've tried substituting $x$ with $t+t^{-1}$, but didn't get anywhere, and using Vieta's trigonometric solution formula, I got $$x_1=\frac {2\sqrt{31}}3\cdot\cos\left(\frac {\arccos \frac {2}{\sqrt{31}}}3\right)-\frac 13\\x_2=\frac {2\sqrt{31}}3\cdot\cos\left(\frac {2\pi+\arccos\frac {2}{\sqrt{31}}}3\right)-\frac 13\\x_3=\frac {2\sqrt{31}}{3}\cdot\cos\left(\frac {4\pi+\arccos\frac 2{\sqrt{31}}}3\right)-\frac 13$$ But that's not the form I want. I'm looking for a form of $2\left(\cos\frac {\text{something}}{31}+\cos\frac {\text{something}}{31}+\cos\frac {\text{something}}{31}\right)$.
I've spent so much time, that I'm practically burnt out. -.-
If you wish to express as roots of cubics the sums of trigonometric functions with arguments that use a prime of form $p=6\color{blue}n+1$, then the number of addends is $\color{blue}n$. Thus, the reason you couldn't find $p=31$ was that you should have used $\color{blue}5$ addends.
A root of $$x^3+x^2-(2\times\color{blue}5)x-8=0\tag1$$ (note the $5$) is given by $$x_1 = 2\left(\cos\tfrac {2\pi}{31}+\cos\tfrac {4\pi}{31}+\cos\tfrac {8\pi}{31}+\cos\tfrac {16\pi}{31}+\cos\tfrac {32\pi}{31}\right) =3.083872\dots$$ More succinctly, let $\displaystyle\beta=\frac{2\pi}{31}$, then, $$x_1=2\sum_{k=1}^5\cos\big(2^k\times\beta\big)=3.083872\dots\\x_2=2\sum_{k=1}^5\cos\big(2^k\times3\beta\big)=-0.786802\dots\\x_3=2\sum_{k=1}^5\cos\big(2^k\times5\beta\big)=-3.29707\dots$$
Similarly, given the cubic, $$x^3+x^2-(2\times\color{blue}7)x+8=0\tag2$$ Let $\displaystyle\gamma=\frac{2\pi}{43}$, then the roots are, $$x_1=2\sum_{k=1}^7\cos\big(2^k\times\gamma\big)=2.88824\dots\\x_2=2\sum_{k=1}^7\cos\big(2^k\times3\gamma\big)=0.615072\dots\\x_3=2\sum_{k=1}^7\cos\big(2^k\times7\gamma\big)=-4.50331\dots$$ though not all primes $p=6n+1$ will have such neat cubic roots. The family $p=31,43,109,\dots$ is discussed in this post.
P.S. See also mercio's general answer here which uses cosets.