If $\cos\frac \pi{n+1}$ is a root of the equation $8x^3+4x^2-4x-1=0$, then find n $(n\in\mathbb N)$
My Attempt:
Let $\theta=\frac\pi{n+1}$, therefore,
$$8\cos^3\theta+4\cos^2\theta-4\cos\theta-1=0$$
Also, $\cos3\theta=4\cos^3\theta-3\cos\theta$ and $\cos2\theta=2\cos^2\theta-1$, so,
$$2(\cos3\theta+3\cos\theta)+2(1+\cos2\theta)-4\cos\theta-1=0\\\implies\cos3\theta+\cos2\theta+\cos\theta=-\frac12\\\implies\frac{\sin\frac{3\theta}2}{\sin\frac\theta2}\cos2\theta=-\frac12\\\implies\frac{\sin\frac{3\pi}{2(n+1)}}{\sin\frac\pi{2(n+1)}}\cos\frac{2\pi}{n+1}=-\frac12$$
How to proceed from here?
EDIT:
Taking hint from Marcos's answer.
$(y+\frac1y)^3+(y+\frac1y)^2-2(y+\frac1y)-1=0$
Adding $1$ to both side,
$(y+\frac1y)^3-1+(y+\frac1y)^2-2(y+\frac1y)+1=1$
$(y+\frac1y-1)((y+\frac1y)^2+(y+\frac1y)+1)+(y+\frac1y-1)^2=1$
$(y+\frac1y-1)((y+\frac1y)^2+2(y+\frac1y))=1$
$(y+\frac1y-1)(y+\frac1y)(y+\frac1y+2)=1$
Not sure what to do with it.