Proving $ z^n + \frac{1}{z^n} = 2\cos(n\theta) $ for $z = \cos (\theta) + i\sin(\theta)$

setting the value of $z=\cos\theta+i\sin\theta$, $$z^n+\frac{1}{z^n}$$$$=z^n+z^{-n}$$ $$=(\cos\theta+i\sin\theta)^n+(\cos\theta+i\sin\theta)^{-n}$$ Using d-Moivre's theorem, $$=\cos(n\theta)+i\sin(n\theta)+\cos(-n\theta)+i\sin(-n\theta)$$ $$=\cos(n\theta)+i\sin(n\theta)+\cos(n\theta)-i\sin(n\theta)$$ $$=2\cos(n\theta)$$


Hint: To simplify $\dfrac{1}{\cos(n\theta)+i\sin(n\theta)}$, multiply top and bottom by $\cos(n\theta)-i\sin(n\theta)$.


Hint. If $$z=\cos (\theta) + i\sin(\theta)= e^{i\theta}$$ then $$ \frac1{z^n}=z^{-n}=e^{-in\theta}=\cos (n\theta) - i\sin(n\theta). $$