Trigonometric root of a polynomial 
If $4\cos^2 \left(\dfrac{k\pi}{j}\right)$ is the greatest root of the equation
  $$x^3-7x^2+14x-7=0$$
  where $\gcd(k,j)=1$   
Evaluate $k+j$

I tried factorizing the equation but it wasn't of much help. 
Btw, the answer given in my book is $k=1$ and $j=14$  
Any help will be appreciated.
Thanks!

Let $z=\frac{k\pi}{j}$. If $4\cos^2z$ is the root of $x^3−7x^2+14x−7=0$, then
$2\cos z$ is the root of $x^6−7x^4+14x^2−7=0$.
Let's plug $x=2\cos z=2\frac{e^{iz}+e^{-iz}}{2}$ in and see what happens.
The expression comes out to be $e^{-6 i z} \left(-e^{2 i z}+e^{4 i z}-e^{6 i z}+e^{8 i z}-e^{10 i z}+e^{12 i z}+1\right)=0$.
Let's change the variables again, $-e^{2 i z}=t$, so $-t^{-3}\left(1+t+t^2+t^3+t^4+t^5+t^6\right)=0 \iff \frac{t^7-1}{t^3(t-1)}=0$, so $-e^{2 i z}$ is the $7$th-root of unity: $-e^{2iz}=e^{i\frac{2\pi k}{7}}, \gcd(k,7)=1$.
$$2iz+\pi i=i\frac{2\pi k}{7}$$
$$z=-\frac{\pi}{2}+\frac{\pi k}{7}$$
Now we need $Re(t)$ to be maximal, so we select $k$ to $-\frac{\pi}{2}+\frac{\pi k}{7}$ be the closest to $0$: $z=\pm\frac{\pi}{14}$.
The answer is either $13$ or $15$.
