# De Moivre's formula

In mathematics, de Moivre's formula (also known as de Moivre's theorem and de Moivre's identity) states that for any real number x and integer n it holds that

${\displaystyle {\big (}\cos x+i\sin x{\big )}^{n}=\cos nx+i\sin nx,}$

where i is the imaginary unit (i2 = −1). The formula is named after Abraham de Moivre, although he never stated it in his works.[1] The expression cos x + i sin x is sometimes abbreviated to cis x.

The formula is important because it connects complex numbers and trigonometry. By expanding the left hand side and then comparing the real and imaginary parts under the assumption that x is real, it is possible to derive useful expressions for cos nx and sin nx in terms of cos x and sin x.

As written, the formula is not valid for non-integer powers n. However, there are generalizations of this formula valid for other exponents. These can be used to give explicit expressions for the nth roots of unity, that is, complex numbers z such that zn = 1.

Using the standard extensions of the sine and cosine functions to complex numbers, the formula is valid even when x is an arbitrary complex number.

## Example

For ${\displaystyle x=30^{\circ }}$ and ${\displaystyle n=2}$, de Moivre's formula asserts that ${\displaystyle \left(\cos(30^{\circ })+i\sin(30^{\circ })\right)^{2}=\cos(2\cdot 30^{\circ })+i\sin(2\cdot 30^{\circ }),}$ or equivalently that ${\displaystyle \left({\frac {\sqrt {3}}{2}}+{\frac {i}{2}}\right)^{2}={\frac {1}{2}}+{\frac {i{\sqrt {3}}}{2}}.}$ In this example, it is easy to check the validity of the equation by multiplying out the left side.

## Relation to Euler's formula

De Moivre's formula is a precursor to Euler's formula ${\displaystyle e^{ix}=\cos x+i\sin x,}$ with x expressed in radians rather than degrees, which establishes the fundamental relationship between the trigonometric functions and the complex exponential function.

One can derive de Moivre's formula using Euler's formula and the exponential law for integer powers

${\displaystyle \left(e^{ix}\right)^{n}=e^{inx},}$

since Euler's formula implies that the left side is equal to ${\displaystyle \left(\cos x+i\sin x\right)^{n}}$ while the right side is equal to ${\displaystyle \cos nx+i\sin nx.}$

## Proof by induction

The truth of de Moivre's theorem can be established by using mathematical induction for natural numbers, and extended to all integers from there. For an integer n, call the following statement S(n):

${\displaystyle (\cos x+i\sin x)^{n}=\cos nx+i\sin nx.}$

For n > 0, we proceed by mathematical induction. S(1) is clearly true. For our hypothesis, we assume S(k) is true for some natural k. That is, we assume

${\displaystyle \left(\cos x+i\sin x\right)^{k}=\cos kx+i\sin kx.}$

Now, considering S(k + 1):

{\displaystyle {\begin{alignedat}{2}\left(\cos x+i\sin x\right)^{k+1}&=\left(\cos x+i\sin x\right)^{k}\left(\cos x+i\sin x\right)\\&=\left(\cos kx+i\sin kx\right)\left(\cos x+i\sin x\right)&&\qquad {\text{by the induction hypothesis}}\\&=\cos kx\cos x-\sin kx\sin x+i\left(\cos kx\sin x+\sin kx\cos x\right)\\&=\cos((k+1)x)+i\sin((k+1)x)&&\qquad {\text{by the trigonometric identities}}\end{alignedat}}}

We deduce that S(k) implies S(k + 1). By the principle of mathematical induction it follows that the result is true for all natural numbers. Now, S(0) is clearly true since cos(0x) + i sin(0x) = 1 + 0i = 1. Finally, for the negative integer cases, we consider an exponent of n for natural n.

{\displaystyle {\begin{aligned}\left(\cos x+i\sin x\right)^{-n}&={\big (}\left(\cos x+i\sin x\right)^{n}{\big )}^{-1}\\&=\left(\cos nx+i\sin nx\right)^{-1}\\&=\cos nx-i\sin nx\qquad \qquad (*)\\&=\cos(-nx)+i\sin(-nx).\\\end{aligned}}}

The equation (*) is a result of the identity

${\displaystyle z^{-1}={\frac {\bar {z}}{|z|^{2}}},}$

for z = cos nx + i sin nx. Hence, S(n) holds for all integers n.

## Formulae for cosine and sine individually

For an equality of complex numbers, one necessarily has equality both of the real parts and of the imaginary parts of both members of the equation. If x, and therefore also cos x and sin x, are real numbers, then the identity of these parts can be written using binomial coefficients. This formula was given by 16th century French mathematician François Viète:

{\displaystyle {\begin{aligned}\sin nx&=\sum _{k=0}^{n}{\binom {n}{k}}(\cos x)^{k}\,(\sin x)^{n-k}\,\sin {\frac {(n-k)\pi }{2}}\\\cos nx&=\sum _{k=0}^{n}{\binom {n}{k}}(\cos x)^{k}\,(\sin x)^{n-k}\,\cos {\frac {(n-k)\pi }{2}}.\end{aligned}}}

In each of these two equations, the final trigonometric function equals one or minus one or zero, thus removing half the entries in each of the sums. These equations are in fact valid even for complex values of x, because both sides are entire (that is, holomorphic on the whole complex plane) functions of x, and two such functions that coincide on the real axis necessarily coincide everywhere. Here are the concrete instances of these equations for n = 2 and n = 3:

{\displaystyle {\begin{alignedat}{2}\cos 2x&=\left(\cos x\right)^{2}+\left(\left(\cos x\right)^{2}-1\right)&{}={}&2\left(\cos x\right)^{2}-1\\\sin 2x&=2\left(\sin x\right)\left(\cos x\right)&&\\\cos 3x&=\left(\cos x\right)^{3}+3\cos x\left(\left(\cos x\right)^{2}-1\right)&{}={}&4\left(\cos x\right)^{3}-3\cos x\\\sin 3x&=3\left(\cos x\right)^{2}\left(\sin x\right)-\left(\sin x\right)^{3}&{}={}&3\sin x-4\left(\sin x\right)^{3}.\end{alignedat}}}

The right-hand side of the formula for cos nx is in fact the value Tn(cos x) of the Chebyshev polynomial Tn at cos x.

## Failure for non-integer powers, and generalization

De Moivre's formula does not hold for non-integer powers. The derivation of de Moivre's formula above involves a complex number raised to the integer power n. If a complex number is raised to a non-integer power, the result is multiple-valued (see failure of power and logarithm identities).

### Roots of complex numbers

A modest extension of the version of de Moivre's formula given in this article can be used to find the n-th roots of a complex number for a non-zero integer n. (This is equivalent to raising to a power of 1 / n).

If z is a complex number, written in polar form as

${\displaystyle z=r\left(\cos x+i\sin x\right),}$

then the n-th roots of z are given by

${\displaystyle r^{\frac {1}{n}}\left(\cos({\frac {x+2\pi k}{n}})+i\sin({\frac {x+2\pi k}{n}})\right)}$

where k varies over the integer values from 0 to |n| − 1.

This formula is also sometimes known as de Moivre's formula.[2]

### Complex numbers raised to an arbitrary power

Generally, if ${\displaystyle z=r\left(\cos x+i\sin x\right)}$ (in polar form) and w are arbitrary complex numbers, then the set of possible values is ${\displaystyle z^{w}=r^{w}\left(\cos x+i\sin x\right)^{w}=\lbrace r^{w}\cos(xw+2\pi kw)+ir^{w}\sin(xw+2\pi kw)|k\in \mathbb {Z} \rbrace \,.}$ (Note that if w is a rational number that equals p / q in lowest terms then this set will have exactly q distinct values rather than infinitely many. In particular, if w is an integer then the set will have exactly one value, as previously discussed.) In contrast, de Moivre's formula gives ${\displaystyle r^{w}(\cos xw+i\sin xw)\,,}$ which is just the single value from this set corresponding to k = 0.

## Analogues in other settings

### Hyperbolic trigonometry

Since cosh x + sinh x = ex, an analog to de Moivre's formula also applies to the hyperbolic trigonometry. For all integers n,

${\displaystyle (\cosh x+\sinh x)^{n}=\cosh nx+\sinh nx.}$

If n is a rational number (but not necessarily an integer), then cosh nx + sinh nx will be one of the values of (cosh x + sinh x)n.[3]

#### Proof by induction

Note that:

${\displaystyle \cosh(x)={\frac {e^{x}+e^{-x}}{2}}}$, ${\displaystyle \sinh(x)={\frac {e^{x}-e^{-x}}{2}}}$.

The following identities are needed for the proof:

{\displaystyle {\begin{aligned}\sinh(2x)=2\sinh(x)\cosh(x)\color {white}\sinh(y)\cosh(x)1(x)\\\cosh(2x)=\cosh ^{2}(x)+\sinh ^{2}(x)\color {white}\sinh x+\cosh(x)\\\sinh(x+y)=\sinh(x)\cosh(y)+\sinh(y)\cosh(x)\color {white}(\\\cosh(x+y)=\cosh(x)\cosh(y)+\sinh(x)\sinh(y)\color {white}(\end{aligned}}}

Induction Hypothesis:

${\displaystyle (\cosh(x)+\sinh(x))^{n}=\cosh(nx)+\sinh(nx)}$

Base case, ${\displaystyle n=2}$:

{\displaystyle {\begin{aligned}(\cosh(x)+\sinh(x))^{2}=\cosh ^{2}(x)+2\sinh(x)\cosh(x)+\sinh ^{2}(x){\color {white}[][]}\\(\cosh(x)+\sinh(x))^{2}=[\cosh ^{2}(x)+\sinh ^{2}(x)]+[2\sinh(x)\cosh(x)]\end{aligned}}}

Apply the double angle formulas.

${\displaystyle (\cosh(x)+\sinh(x))^{2}=\cosh(2x)+\sinh(2x)}$

Induction step:

Assuming that the induction hypothesis holds true for ${\displaystyle n}$, it must hold true for ${\displaystyle n+1}$.

${\displaystyle {\displaystyle (\cosh((n+1)x)+\sinh((n+1)x))=(\cosh((nx)+(x))+\sinh((nx)+(x))}}$

Apply the compound angle formulas.Apply the induction hypothesis:

{\displaystyle {\begin{aligned}(\cosh((n+1)x)+\sinh((n+1)x))=(\cosh(nx)+(x))+\sinh((nx)+(x)){\color {white}[[\sinh(nx)\cosh(x)(+\sinh(x)+\cosh(nx)]]}\\=[\cosh(nx)\cosh(x)+\sinh(nx)\sinh(x)]+[\sinh(nx)\cosh(x)+\sinh(x)\cosh(nx)]\\=[\cosh(nx)\cosh(x)+\sinh(x)\cosh(nx)]+[\sinh(nx)\sinh(x)+\sinh(nx)\cosh(x)]\\=(\cosh(nx))(\cosh(x)+\sinh(x))+(\sinh(nx))(\cosh(x)+\sinh(x)){\color {white}[[xx(y)\sinh()]]}\\=(\cosh(nx)+\sinh(nx))(\cosh(x)+\sinh(x)){\color {white}[[(x)(y)\sin()]]\sinh(x)\cosh(x)+++}\end{aligned}}}

Apply the induction hypothesis:

{\displaystyle {\begin{aligned}(\cosh((n+1)x)+\sinh((n+1)x))=(\cosh(x)+\sinh(x))^{n}(\cosh(x)+\sinh(x))\\(\cosh((n+1)x)+\sinh((n+1)x))=(\cosh(x)+\sinh(x))^{n+1}{\color {white}(\cosh(x)+\sinh()}\end{aligned}}}

This proves that De Moivre's Theorem extends to hyperbolic trigonometry.

### Extension to complex numbers

For any integer n, the formula holds for any complex number ${\displaystyle z=x+iy}$

${\displaystyle (\cos z+i\sin z)^{n}=\cos {nz}+i\sin {nz}.}$

where

{\displaystyle {\begin{aligned}\cos z=\cos(x+iy)&=\cos x\cosh y-i\sin x\sinh y\,,\\\sin z=\sin(x+iy)&=\sin x\cosh y+i\cos x\sinh y\,.\end{aligned}}}

### Quaternions

To find the roots of a quaternion there is an analogous form of de Moivre's formula. A quaternion in the form

${\displaystyle d+a\mathbf {\hat {i}} +b\mathbf {\hat {j}} +c\mathbf {\hat {k}} }$

can be represented in the form

${\displaystyle q=k(\cos \theta +\varepsilon \sin \theta )\qquad {\mbox{for }}0\leq \theta <2\pi .}$

In this representation,

${\displaystyle k={\sqrt {d^{2}+a^{2}+b^{2}+c^{2}}},}$

and the trigonometric functions are defined as

${\displaystyle \cos \theta ={\frac {d}{k}}\quad {\mbox{and}}\quad \sin \theta =\pm {\frac {\sqrt {a^{2}+b^{2}+c^{2}}}{k}}.}$

In the case that a2 + b2 + c2 ≠ 0,

${\displaystyle \varepsilon =\pm {\frac {a\mathbf {\hat {i}} +b\mathbf {\hat {j}} +c\mathbf {\hat {k}} }{\sqrt {a^{2}+b^{2}+c^{2}}}},}$

that is, the unit vector. This leads to the variation of De Moivre's formula:

${\displaystyle q^{n}=k^{n}(\cos n\theta +\varepsilon \sin n\theta ).}$[4]

#### Example

To find the cube roots of

${\displaystyle Q=1+\mathbf {\hat {i}} +\mathbf {\hat {j}} +\mathbf {\hat {k}} ,}$

write the quaternion in the form

${\displaystyle Q=2\left(\cos {\frac {\pi }{3}}+\varepsilon \sin {\frac {\pi }{3}}\right)\qquad {\mbox{where }}\varepsilon ={\frac {\mathbf {\hat {i}} +\mathbf {\hat {j}} +\mathbf {\hat {k}} }{\sqrt {3}}}.}$

Then the cube roots are given by:

${\displaystyle {\sqrt[{3}]{Q}}={\sqrt[{3}]{2}}(\cos \theta +\varepsilon \sin \theta )\qquad {\mbox{for }}\theta ={\frac {\pi }{9}},{\frac {7\pi }{9}},{\frac {13\pi }{9}}.}$

### 2 × 2 matrices

With matrices, ${\displaystyle {\begin{pmatrix}\cos \phi &-\sin \phi \\\sin \phi &\cos \phi \end{pmatrix}}^{n}={\begin{pmatrix}\cos n\phi &-\sin n\phi \\\sin n\phi &\cos n\phi \end{pmatrix}}}$ when n is an integer. This is a direct consequence of the isomorphism between the matrices of type ${\displaystyle {\begin{pmatrix}a&-b\\b&a\end{pmatrix}}}$ and the complex plane.

## References

• Abramowitz, Milton; Stegun, Irene A. (1964). Handbook of Mathematical Functions. New York: Dover Publications. p. 74. ISBN 0-486-61272-4..
1. ^ Lial, Margaret L.; Hornsby, John; Schneider, David I.; Callie J., Daniels (2008). College Algebra and Trigonometry (4th ed.). Boston: Pearson/Addison Wesley. p. 792. ISBN 9780321497444.
2. ^ "De Moivre formula", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
3. ^ Mukhopadhyay, Utpal (August 2006). "Some interesting features of hyperbolic functions". Resonance. 11 (8): 81–85. doi:10.1007/BF02855783. S2CID 119753430.
4. ^ Brand, Louis (October 1942). "The roots of a quaternion". The American Mathematical Monthly. 49 (8): 519–520. doi:10.2307/2302858. JSTOR 2302858.