<s>[INST] If complex $z$ satisfies $z+\frac{1}{z}=\cos x$, then evaluate $z^n+\frac{1}{z^n}$ for integer $n$ 
Let $z$ be a complex number such that
$$
z + \frac{1}{z} = \cos x
$$
Then what is the value of the expression
$$
z^n + \frac{1}{z^n}
$$
where $n$ is an integer?

Please help me. I have tried somehow using the trigonometric way of defining complex numbers but still didn't manage to get anywhere.
 [/INST] \begin{cases}
z+\frac1z=\cos x\\
z\cdot\frac1z=1
\end{cases}
Considering $t^2-\cos x\cdot t+1=0$, and we get
\begin{equation}
\{z,\frac1z\}=\{\frac{\cos x+\sqrt{\cos^2x-4}}{2},\frac{\cos x-\sqrt{\cos^2x-4}}{2}\}
\end{equation}
So
\begin{align}
z^n+\frac{1}{z^n} 
&= (\frac{\cos x+\sqrt{\cos^2x-4}}{2})^n+(\frac{\cos x-\sqrt{\cos^2x-4}}{2})^n\\
&= \frac{\sum_{k=0}^{\lfloor{n/2}\rfloor}\cos^{n-2k}x\cdot(\cos^2x-4)^k}{2^n}.
\end{align}
not so beautiful :(
</s>