> For the complete documentation index, see [llms.txt](https://isubasinghe.gitbook.io/isithas-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isubasinghe.gitbook.io/isithas-wiki/math/complex_numbers/basics.md).

# Complex Numbers

## Basic idea

Numbers of the form $z=a+bi$ with $i^2=-1$. They unify rotation and scaling via polar form $z=re^{i\theta}$ and make the reals algebraically closed.

## Key formulas

* $i^2=-1$, $i^3=-i$, $i^4=1$
* Sum/product: $(a+bi)+(c+di)=(a+c)+(b+d)i$; $(a+bi)(c+di)=(ac-bd)+(ad+bc)i$
* Conjugate: $\bar z = a - bi$; $z\bar z=|z|^2$
* Modulus: $|z|=\sqrt{a^2+b^2}$
* Argument: $\arg z = \operatorname{atan2}(b,a)$
* Polar form: $z = r(\cos\theta+i\sin\theta)=re^{i\theta}$
* Euler's formula: $e^{i\theta}=\cos\theta+i\sin\theta$; Euler's identity: $e^{i\pi}+1=0$
* de Moivre: $(\cos\theta+i\sin\theta)^n=\cos(n\theta)+i\sin(n\theta)$
* Multiplication in polar: $r\_1 e^{i\theta\_1}\cdot r\_2 e^{i\theta\_2}=r\_1 r\_2 e^{i(\theta\_1+\theta\_2)}$
* $n$-th roots of unity: $z\_k=e^{2\pi i k/n}$ for $k=0,\dots,n-1$
