Complex Numbers: Evision Otes
Complex Numbers: Evision Otes
Complex Numbers
Instructors:
Marc Deisenroth
1 Complex Numbers 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 Imaginary Number . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.3 Complex Numbers as Elements of R2 . . . . . . . . . . . . . . 3
1.1.4 Closure under Arithmetic Operators . . . . . . . . . . . . . . 3
1.2 Representations of Complex Numbers . . . . . . . . . . . . . . . . . . 4
1.2.1 Cartesian Coordinates . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Euler Representation . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.4 Transformation between Polar and Cartesian Coordinates . . 6
1.2.5 Geometric Interpretation of the Product of Complex Numbers 8
1.2.6 Powers of Complex Numbers . . . . . . . . . . . . . . . . . . 8
1.3 Complex Conjugate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.1 Absolute Value of a Complex Number . . . . . . . . . . . . . . 10
1.3.2 Inverse and Division . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 De Moivre’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.1 Integer Extension to De Moivre’s Theorem . . . . . . . . . . . 12
1.4.2 Rational Extension to De Moivre’s Theorem . . . . . . . . . . 12
1.5 Triangle Inequality for Complex Numbers . . . . . . . . . . . . . . . 13
1.6 Fundamental Theorem of Algebra . . . . . . . . . . . . . . . . . . . . 14
1.6.1 nth Roots of Unity . . . . . . . . . . . . . . . . . . . . . . . . 14
1.6.2 Solution of zn = a + ib . . . . . . . . . . . . . . . . . . . . . . 15
1.7 Complex Sequences and Series* . . . . . . . . . . . . . . . . . . . . . 16
1.7.1 Limits of a Complex Sequence . . . . . . . . . . . . . . . . . . 16
1.8 Complex Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.8.1 A Generalized Euler Formula . . . . . . . . . . . . . . . . . . 18
1.9 Applications of Complex Numbers . . . . . . . . . . . . . . . . . . . . 18
1.9.1 Trigonometric Multiple Angle Formulae . . . . . . . . . . . . 18
1.9.2 Summation of Series . . . . . . . . . . . . . . . . . . . . . . . 19
1.9.3 Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2
Chapter 1
Complex Numbers
1.1 Introduction
We can see need for complex numbers by looking at the shortcomings of all the
simpler (more obvious) number systems that preceded them. In each case the next
number system in some sense fixes a perceived problem or omission with the previ-
ous one:
Z Integers, the natural numbers with 0 and negative numbers, not closed under
division
Q Rational numbers, closed under arithmetic operations but cannot represent the
solution of all non-linear equations, e.g., x2 = 2
R Real numbers, solutions to some quadratic equations with real roots and some
higher-order equations, but not all, e.g., x2 + 1 = 0
C Complex numbers, we require these to represent all the roots of all polynomial
equations.1
Another important use of complex numbers is that often a real problem can be solved
by mapping it into complex space, deriving a solution, and mapping back again: a
direct solution may not be possible or would be much harder to derive in real space,
e.g., finding solutions to integration or summation problems, such as
Z x n
X
aθ
I= e cos bθ dθ or S= ak cos kθ . (1.1)
0 k=0
1.1.1 Applications
Complex numbers are important in many areas. Here are some:
1 Complex numbers form an algebraically closed field, where any polynomial equation has a root.
1
1.1. Introduction Chapter 1. Complex Numbers
• Machine learning: Using a pair of uniformly distributed random numbers (x, y),
we can generate random numbers in polar form (r cos(θ), r sin(θ)). This can
lead to efficient sampling methods like the Box-Muller transform (Box and
Muller, 1958).2 The variant of the Box-Muller transform using complex num-
bers was proposed by Knop (1969).
x2 + 1 = 0, (1.2)
There is no way√of squeezing this into R, it cannot be compared with a real number
(in contrast to 2 or π, which we can compare with rationals and get arbitrarily
accurate approximations in the rationals). We call i the imaginary number/unit,
orthogonal to the reals.
1 1
4. In general i −2n = i 2n
= (−1)n
= (−1)n , i −(2n+1) = i −2n i −1 = (−1)n+1 i for all n ∈ N
5. i 0 = 1
2 This is a pseudo-random number sampling method, e.g., for generating pairs of independent,
standard, normally distributed (zero mean, unit variance) random numbers, given a source of uni-
formly distributed random numbers.
2
Chapter 1. Complex Numbers 1.1. Introduction
Im
z = (x, y) = x + iy
iy
1 x Re
Figure 1.1: Complex plane (Argand diagram). A complex number can be represented
in a two-dimensional Cartesian coordinate system with coordinates x and y. x is the real
part and y is the imaginary part of a complex number z = x + iy.
C := {a + ib : a, b ∈ R, i 2 = −1} (1.4)
as the set of tuples (a, b) ∈ R2 with the following definition of addition and multipli-
cation:
In this context, the element i := (0, 1) is the imaginary number/unit. With the
complex multiplication defined in (1.6), we immediately obtain
3
1.2. Representations of Complex Numbers Chapter 1. Complex Numbers
Im
z2
Re
z1 + z2
z1
Figure 1.2: Visualization of complex addition. As known from geometry, we simply add
the two vectors representing complex numbers.
4
Chapter 1. Complex Numbers 1.2. Representations of Complex Numbers
i r
φ
Im
r sin φ
φ r
r cos φ Re
z = r exp(iφ) (1.12)
where r and φ are the polar coordinates. We already know that z = r(cos φ + i sin φ),
i.e., it must also hold that r exp(iφ) = r(cos φ+i sin φ). This can be proved by looking
at the power series expansions of exp, sin, and cos:
∞
X (iφ)k (iφ)2 (iφ)3 (iφ)4 (iφ)5
exp(iφ) = = 1 + iφ + + + + + ··· (1.13)
k! 2! 3! 4! 5!
k=0
φ2 iφ3 φ4 iφ5
= 1 + iφ − − + + ∓ ··· (1.14)
2! 3! 4! 5!
5
1.2. Representations of Complex Numbers Chapter 1. Complex Numbers
φ2 φ4 φ3 φ5
! !
= 1− + ∓ ··· + i φ − + ∓ ··· (1.15)
2! 4! 3! 5!
∞ ∞
X (−1)k φ2k X (−1)k φ2k+1
= +i = cos φ + i sin φ . (1.16)
(2k)! (2k + 1)!
k=0 k=0
Therefore, z = exp(iφ) is a complex number, which lives on the unit circle (|z| = 1)
and traces out the unit circle in the complex plane as φ ranges through the real
numbers.
p
x = r cos φ r r = x2 + y 2
y
y = r sin φ tan φ = xy + quadrant
z = x + iy = r(cos φ + i sin φ)
Figure 1.5: Transformation between Cartesian and polar coordinate representations of
complex numbers.
Figure 1.5 summarizes the transformation between Cartesian and polar coordinate
representations of complex numbers z. We have to pay some attention when com-
puting Arg (z) when transforming Cartesian coordinates into polar coordinates.
6
Chapter 1. Complex Numbers 1.2. Representations of Complex Numbers
y
z r=2 Im
φ= 2π
3
Re
x
z = 2 − 2i
2π
(a) (r, φ) = (2, 3 ) (b) (x, y) = (2, −2)
z = −1 + i Im Im
1 1
Re Re
z= − 32 i
that y/x has two possible angles, which differ by π, see Figure 1.7. By looking at the
quadrant in which the complex number z lives we can resolve this ambiguity. Let us
have a look at some examples:
√ √
1. z = 2 − 2i. We immediately obtain r = 22 + 22 = 2 2. For the argument,
we obtain tan φ = − 22 = −1. Therefore, φ ∈ { 34 π, 74 π}. We identify the correct
argument by plotting the complex number and identifying the quadrant. Fig-
ure 1.6(b) shows that z lies in the fourth quadrant. Therefore, φ = 74 π.
2. z = −1 + i.
√ √
r = 1+1 = 2 (1.19)
−1
tan φ = = −1 ⇒ φ ∈ { 34 π, 74 π} . (1.20)
1
Figure 1.6(c) shows that z lies in the second quadrant. Therefore, φ = 43 π.
3. z = − 23 i.
3
r= 2 (1.21)
− 32 π 3
tan φ = ⇒ φ ∈ { , π} (1.22)
0 2 2
Figure 1.6(d) shows that z is between the third and fourth quadrant (and not
between the first and second). Therefore, φ = 23 π
7
1.2. Representations of Complex Numbers Chapter 1. Complex Numbers
φ1 φ2 = φ1 + π
Figure 1.7: Tangens. Since the tangens possesses a period of π, there are two solutions
for the argument 0 ≤ φ < 2π of a complex number, which differ by π.
8
Chapter 1. Complex Numbers 1.3. Complex Conjugate
Im
z1
Re
z2
z1 z2
Figure 1.8: Complex multiplication. When we multiply two complex numbers z1 , z2 ,
the corresponding distances r1 and r2 are multiplied while the corresponding arguments
φ1 , φ2 are summed up.
Im
z = x + iy
Re
z = x − iy
Figure 1.9: The complex conjugate z is a reflection of z about the real axis.
can be computed efficiently: The distance r to the origin is simply raised to the
power of n and the argument is scaled/multiplied by n. This also immediately gives
us the result
2. =(z) = −=(z)
3. z + z = 2x = 2<(z) ∈ R
9
1.3. Complex Conjugate Chapter 1. Complex Numbers
5. z1 + z2 = z1 + z2
Notice that the term ‘absolute value’ is the same as defined for real numbers when
=(z) = 0. In this case, |z| = |x|.
The absolute value of the product has the following nice property that matches the
product result for real numbers:
1 z z x − iy
= = 2= 2 . (1.31)
z zz |z| x + y2
This can be written z−1 = |z|−2 z, using only the complex operators multiply and add,
see (1.5) and (1.6), but also real division, which we already know. Complex division
is now defined by z1 /z2 = z1 z2−1 . In practice, we compute the division z1 /z2 by ex-
panding the fraction by the complex conjugate of the denominator. This ensures that
the denominator’s imaginary part is 0 (only the real part remains), and the overall
fraction can be written as
z1 z1 z2 z1 z2
= = (1.32)
z2 z2 z2 |z2 |2
10
Chapter 1. Complex Numbers 1.4. De Moivre’s Theorem
3 + 2i
z = x + iy = (1.34)
7 − 3i
Solution:
3 + 2i (3 + 2i)(7 + 3i) 15 + 23i 15 23
= = = +i (1.35)
7 − 3i (7 − 3i)(7 + 3i) 49 + 9 58 58
15 23
Now, the fraction can be written as z = x + iy with x = 58 and y = 58 .
The proof is done by induction (which you will see in detail in the course Reasoning
about Programs). A proof by induction allows you to prove that a property is true for
all values of a natural number n. To construct an induction proof, you have to prove
that the property, P (n), is true for some base value (say, n = 1). A further proof is
required to show that if it is true for the parameter n = k, then that implies it is also
true for the parameter n = k + 1: that is P (k) ⇒ P (k + 1) for all k ≥ 1. The two proofs
combined allow us to build an arbitrary chain of implication up to some value n = m:
11
1.4. De Moivre’s Theorem Chapter 1. Complex Numbers
Proof 1
We start the induction proof by checking whether de Moivre’s theorem holds for n = 1:
is trivially true, and we can now make the induction step: We assume that (1.36) is
true for k and show that it also holds for k + 1.
Assuming
we can write
We have tackled the case for n > 0 already, n = 0 can be shown individually. So we
take the case n < 0. We let n = −m for m > 0.
1
(cos φ + i sin φ)n =
(cos φ + i sin φ)m
1
= by de Moivre’s theorem
cos mφ + i sin mφ
cos mφ − i sin mφ
=
cos2 mφ + sin2 mφ
= cos(−mφ) + i sin(−mφ) Trig. identity: cos2 mφ + sin2 mφ = 1
= cos nφ + i sin nφ
12
Chapter 1. Complex Numbers 1.5. Triangle Inequality for Complex Numbers
p p
Hence cos q φ + i sin q φ is one of the qth roots of (cosφ + i sin φ)p .
The qth roots of cos φ + i sin φ are easily obtained. We need to use the fact that
(repeatedly) adding 2π to the argument of a complex number does not change the
complex number.
1 1
(cos φ + i sin φ) q = (cos(φ + 2nπ) + i sin(φ + 2nπ)) q (1.41)
φ + 2nπ φ + 2nπ
= cos + i sin for 0 ≤ n < q (1.42)
q q
We will use this later to calculate roots of complex numbers.
Finally, the full set of values for (cos +i sin φ)n for n = p/q ∈ Q is:
pφ + 2nπ pφ + 2nπ
cos + i sin for 0 ≤ n < q (1.43)
q q
13
1.6. Fundamental Theorem of Algebra Chapter 1. Complex Numbers
Proof 2
Let z1 = x1 + iy1 and z2 = x2 + iy2 . Squaring the left-hand side of (1.45) yields
The geometrical argument via the Argand diagram is a good way to understand the
triangle inequality.
A root z∗ of p(z) satisfies p(z∗ ) = 0. Bear in mind that complex roots include all real
roots as the real numbers are a subset of the complex numbers. Also some of the
roots might be coincident, e.g., for z2 = 0. Finally, we also know that if ω is a root
and ω ∈ C\R, then ω is also a root. So all truly complex roots occur in complex
conjugate pairs.
zn = 1 , n ∈ N, (1.53)
for which we want to determine the roots. The fundamental theorem of algebra tells
us that there exist exactly n roots, one of which is z = 1.
14
Chapter 1. Complex Numbers 1.6. Fundamental Theorem of Algebra
Im
1 Re
Figure 1.10: Then nth roots of zn = 1 lie on the unit circle and form a regular polygon.
Here, we show this for n = 8.
To find the other solutions, we write (1.53) in a slightly different form using the
Euler representation:
zn = 1 = eik2π , ∀k ∈ Z . (1.54)
The 3rd roots of 1 are z = e2kπi/3 for k = 0, 1, 2, i.e., 1, e2πi/3 , e4πi/3 . These are often
referred to as ω1 ω1 and ω3 , and simplify to
ω1 = 1
√
ω2 = cos 2π/3 + i sin 2π/3 = (−1 + i 3)/2 ,
√
ω3 = cos 4π/3 + i sin 4π/3 = (−1 − i 3)/2 .
Try cubing each solution directly to validate that they are indeed cubic roots.
1.6.2 Solution of zn = a + ib
Finding the n roots of zn = a + ib is similar to the approach discussed above: Let
a + ib = reiφ in polar form. Then, for k = 0, 1, . . . , n − 1,
15
1.7. Complex Sequences and Series* Chapter 1. Complex Numbers
Example
Determine the cube roots of 1 − i.
√
1. The polar coordinates of 1 − i are r = 2, φ = 74 π, and the corresponding Euler
representation is
√
z = 2 exp(i 7π
4 ). (1.57)
The only distinction here is the meaning of |zn − l|, which refers to the complex
absolute value and not the absolute real value.
16
Chapter 1. Complex Numbers 1.7. Complex Sequences and Series*
r
1
⇒n> −1 for ≤ 1 (1.66)
2
We have to be a tiny bit careful as N () needs to be defined for all > 0 and the
penultimate line of the limit inequality is true for all n > 0 if > 1. In essence this
was no different in structure from the normal sequence convergence proof. The only
difference was how we treated the absolute value.
Absolute Convergence
Similarly, a complex series ∞
P P∞
n=1 zn is absolutely convergent if n=1 |zn | converges.
Again the |zn | refers to the complex absolute value.
and diverges if
zn+1
lim > 1. (1.69)
n→∞ zn
We can prove that this will converge for some values of z ∈ C in the same way we
n
could for the real-valued series. Applying the complex ratio test, we get limn→∞ | azazn−1 | =
|z|. We apply the standard condition and get that |z| < 1 for this series to converge.
The radius of convergence is still 1 (and is an actual radius of a circle in the complex
plane). What is different here is that now any z-point taken from within the circle
centred on the origin with radius 1 will make the series converge, not just on the
real interval (−1, 1).
a
For your information, the limit of this series is 1−z , which you can show using
Maclaurin as usual, discussed below.
17
1.8. Complex Power Series Chapter 1. Complex Numbers
∀z ∈ C, n ∈ Z : z = rei(φ+2nπ) (1.74)
since ei2nπ = cos 2nπ + i sin 2nπ = 1. This is the same general form we used in the
rational extension to De Moivres theorem to access the many roots of a complex
number.
In terms of the Argand diagram, the points ei(φ+2nπ) for i ≥ 1 lie on top of each other,
each corresponding to one more revolution (through 2π).
The complex conjugate of eiφ is e−iφ = cos φ − i sin φ. This allows us to get useful
expressions for sin φ and cos φ:
18
Chapter 1. Complex Numbers 1.9. Applications of Complex Numbers
and
and, therefore,
1
cos6 φ = (cos 6φ + 6 cos 4φ + 15 cos 2φ + 10) . (1.84)
32
n
ak sin kφ. Then,
P
Let S =
k=1
n
X 1 − (aeiφ )n+1
C + iS = ak eikφ = . (1.86)
k=0
1 − aeiφ
Hence,
19
1.9. Applications of Complex Numbers Chapter 1. Complex Numbers
1.9.3 Integrals
We can determine integrals
Z x
C= eaφ cos bφdφ , (1.91)
Z0x
S= eaφ sin bφdφ (1.92)
0
20
Bibliography
Knop, R. (1969). Remark on Algorithm 334 [G5]: Normal Random Deviates. Com-
munications of the ACM, 12(5):281. pages 2
21