de Moivre's theorem

De Moivre's theorem, named after Abraham de Moivre, is a theorem that links complex numbers and trigonometry. It states that for any real number x and any integer n,


(cos x + isin x)n = cos(nx) + isin(nx)


By expanding the left hand side and then comparing real and imaginary parts, it is possible to derive useful expressions for cos(nx) and sin(nx) in terms of sin(x) and cos(x). Furthermore, the formula can be used to find explicit expressions for the nth roots of unity: complex numbers z such that zn = 1. It can be derived from (but historically preceded) Euler's formula eix = cos x + i sin x and the exponential law (eix)n = einx.