# Complex Numbers
Complex numbers are all numbers composed of a real component $\Re(z)$, together with an imaginary component $\Im (z)$. Complex numbers are often represented as $z = a+bi$, where $a=\Re(z)$, and $b = \Im (z)$.
When looking at the complex plane, complex numbers are represented as vectors, and the angle a number forms with the $x$ axis is called the *argument*.
Welch Labs created an amazing video series about complex and imaginary numbers. Here's the workbook from that series: [[imaginary_numbers_are_real_rev2_for_print.pdf]].
## Powers of $i$
By definition, $i^0 = 1, i^1 = \sqrt {-1}, i^2=-1, i^3=-i$. All following $i$ powers follow that pattern, so $i^n$ can easily be determined by dividing $n$ by 4 and looking at the remainder.
## Conjugates
The conjugate of a complex number $z$ is denoted as $\bar z$. If $z = x + yi, \bar z = x-yi$ i.e. the sign of the imaginary part is negated. Note that the conjugate of any real number equals the number, as the imaginary part is 0.
Therefore by definition $z+\bar z = 2\cdot\Re(z)$.
## Magnitude
Magnitude of a complex number $z$, denoted $|z|$, is the distance of the origin of the complex plane to the point representing the number. The magnitude is a real number by definition.
For complex number $z = a + bi$, its magnitude is $|z|=\sqrt {a^2 + b^2}$, as per Pythagoras' theorem.
The magnitude of a difference between two points e.g. $|z-w|$ represents the distance between the two points on the complex plane.
Do not confuse the magnitude and the absolute value. Although the two share the same notation and some properties (both are always positive real numbers for instance), they are not exactly the same. Do not assume absolute value rules apply to magnitudes.
## Identities
- $z+\bar z = 2\cdot\Re(z)$ by definition of a conjugate
- $\overline{z + w} = \overline z + \overline w$
- $z \bar z = |z|^2 = a^2 + b^2$
- $|zw| = |z|\,|w|$
- $\overline {z \, w} = \overline z \, \overline w$
- $|z + w| \le |z| + |w|$. This is known as the [[Absolute Value#The Triangle Inequality|triangle inequality]]. The two sides are equal if the two points and the origin all lie on the same line.
- $|z - w| \le |z| + |w|$. This follows from the identity above if we replace $w$ with $-w$.
- $\frac{1}{z} = \frac{a-bi}{a^2+b^2}$ ($z=a+bi$)
## Identity Proofs
#### $\overline{z + w} = \overline z + \overline w$
$
\begin{align}
\overline{z + w} &= \overline{a+bi + c+di} \\
&= \overline{(a+c) + (b+d)i} \\
&= (a+c) - (b+d)i \\
&= a-bi + c-di \\
&= \overline z + \overline w
\end{align}
$
#### $|zw| = |z| \, |w|$
$
\begin{align}
\ |zw| &= |(a+bi)(c+di)| \\
&= |ac-bd+(ad+bc)i | \\
&= \sqrt{(ac-bd)^2 + (ad+bc)^2} \\
&= \sqrt{a^2c^2 - 2abcd + b^2d^2 + a^2d^2 + 2abcd + b^2c^2} \\
&= \sqrt{a^2(c^2+d^2)+b^2(c^2+d^2)} \\
&= \sqrt{(a^2+b^2)(c^2+d^2)} \\
&= \sqrt{(a^2+b^2)}\sqrt{(c^2+d^2)} \qquad \text{(sum of squares is always positive)} \\
&= |z| \, |w|
\end{align} \\
$
#### $\overline z \, \overline w = \overline {z \, w}$
$
\begin{align}
\ |z \, w| &= |z| \, |w| \\
\ |z \, w|^2 &= |z|^2 \, |w|^2 \\
zw \cdot \overline {zw} &= z\overline z \; w\overline w \\
\overline {zw} &= \overline z \; \overline w \\
\end{align}
$
## Addition of Two Complex Numbers
Think of addition of two complex number as adding vectors from the origin of the complex plane to the points the numbers represent.
## Multiplication of Two Complex Numbers
When multiplying two complex numbers their magnitudes are multiplied and the angles their vectors form with the real axis are added.
This can be proven by converting the two numbers into their polar forms (see [[Polar Coordinates]]).
$
\begin {align}
z_1 &= |z_1| (\cos \alpha + i \sin \alpha) \\
z_2 &= |z_2| (\cos \beta + i \sin \beta) \\
z_1z_2 &= |z_1||z_2| (\cos \alpha + i \sin \alpha)(\cos \beta + i \sin \beta) \\
&= |z_1||z_2| (\cos \alpha \cos \beta + i\cos\alpha\sin\beta + i\sin\alpha\cos \beta - \sin\alpha \sin\beta) \\
&= |z_1||z_2| (\cos \alpha \cos \beta - \sin\alpha \sin\beta + i(\sin\alpha\cos \beta + \cos\alpha\sin\beta)) \\
&= |z_1||z_2| (\cos (\alpha + \beta) + i\cos (\alpha + \beta)
\end {align}
$
The above is what is know as [De Moivre's Theorem](https://brilliant.org/wiki/de-moivres-theorem/).
## Exponentiation by Complex Numbers Is Nonsensical
Although seemingly common in physics, exponentiation by a complex number is nonsensical (what does it mean to multiply a number by itself $i$ times?). This misconception is prominent due to the similar properties of [[The Exponential Function]] to exponentiation (for real numbers the two are actually the same!).
Whenever presented with complex exponents one should instead think of [[The Exponential Function]]. See [[Euler's Formula]] for more.