Notebook 13 – Math 2121, Fall 2020

In this notebook we will explore how to draw complex numbers and then discuss a visual proof of the fundamental theorem of algebra.

The way we can visualize complex numbers is very similar to how we draw vectors in R2.

7.6 μs
14.2 s
848 ms
693 μs

In lecture, we defined the complex number a+bi to be literally the 2×2 matrix

[abba].

A very useful way of visualizing the number a+bi is by drawing the vector

[ab]R2

which is the first column of the matrix above.

This first column determines the second column, so there is no loss of information.

11.2 μs
plot_vector (generic function with 2 methods)
58 μs
plot_sum (generic function with 2 methods)
77.8 μs
complex_product (generic function with 1 method)
39.3 μs
plot_multiple (generic function with 2 methods)
67 μs

We draw such vectors as arrows in the xy-plane in the usual way.

7.3 μs
u
8.6 μs

This represents the complex number u = -2 + 2i.

8.3 ms
v
3.6 μs

This represents the complex number v = 4 + 2i.

11.6 μs

The sum of these complex numbers is u+v = 2 + 4i.

In terms of arrows, the sum u+v corresponds to translating the start of v to the end of u and the following the origin to the endpoint of the translated copy of v.

27.3 μs
6.1 s

There is also a simple of way of visualizing the product of two complex numbers.

The length or norm of z=a+bi is |z|=a2+b2.

This is also how we define the length of the vector [ab].

The angle of the vector [ab] is the angle that the vector makes with the positive x-axis.

The angle of z=a+bi is defined to be the angle of [ab]

The complex number z is uniquely determined by its length and angle:

  • If these are r and θ, respectively, then z=rcosθ+irsinθ.

Here is a method to compute the angle of z:

14.6 μs
angle (generic function with 1 method)
43.5 μs

Here is how to interpret the product of two complex numbers y and z in terms of arrows:

  • The vector in R2 representing yz is the vector whose angle is the sum of the angles of y and z, and whose length is the product of the lengths of y and z.

6.9 μs

Recall that u = -2 + 2i and v = 4 + 2i.

11.3 μs
103 ms
7.5 μs
uv
12.5 ms
2×2 Array{Float64,2}:
 12.6491  2.81984
 12.6491  2.81984
27.8 μs
197 ms

Some more examples of products of complex numbers:

8.1 μs
y
1×2 Array{Float64,2}:
 1.414  1.414
86.3 ms
z
1×2 Array{Float64,2}:
 -0.3535  0.3535
53.1 ms

These vectors represent y = 1.414 + 1.414i and z = -0.3535 + 0.3535i

3.3 ms

These numbers have length 2 and 1/2, so the length of their product is 1.

The angle of y is π/4 and the angle of z is 3π/4, so the angle of yz is π/4+3π/4=π radians.

30.3 μs
159 ms
21.5 ms
331 ms
2.7 ms
2.7 ms

Multiplying by i corresponds to rotating by π/2 radians.

49.8 μs
12 ms

These pictures give us some visual intution about adding, multiplying, and taking powers zzn of complex numbers. The last operation corresponds to multiplying the angle of the arrow representing z by n and exponentiating the length.

Using these abilities together lets us imagine the output of a polynomial function

f(x)=z0+z1x+z2x2++znxn

where x is a variable and z0,z1,,znC.

We can encode such a function in Julia as a 2×(n+1) real matrix, whose columns record the coefficients z0,z1,,zn. Here are some methods to create polynomials encoded like this:

12.6 μs
random_real_polynomial (generic function with 1 method)
24.7 μs
random_complex_polynomial (generic function with 1 method)
25.8 μs
monomial (generic function with 1 method)
23.4 μs

Here is a very simple method to print a 2-row matrix as a polynomial in the usual way.

6.2 μs
print_polynomial (generic function with 1 method)
48.9 μs
f
1×6 Array{Int64,2}:
 6  -2  -8  4  6  -9
19.4 ms
(6) + (-2) * x + (-8) * x^2 + (4) * x^3 + (6) * x^4 + (-9) * x^5
40.8 ms
g
2×5 Array{Int64,2}:
 -5  -3  10    0  -2
 -7   0  -4  -10   1
4.9 ms
(-5 + -7i) + (-3 + 0i) * x + (10 + -4i) * x^2 + (0 + -10i) * x^3 + (-2 + 1i) * x^4
28.4 μs
h
1×8 Array{Float64,2}:
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.0
12 ms
(1.0) * x^7
37.9 ms

The following method evaluates our polynomial f at a complex number z=a+bi, assuming that f is inputted as a 1- or 2-row array and z is inputted as the 2-row vector [ab].

6.8 μs
evaluate_polynomial (generic function with 1 method)
50.2 μs
939 ms
3.1 ms

To visualize a set of complex numbers z=a+bi, we just draw the endpoints of the vectors [ab].

Below is a picture of the set {zC:|z|=2}, which forms a circle:

7.3 μs
circle_path (generic function with 2 methods)
48.1 μs
plot_path (generic function with 2 methods)
34.6 μs
479 ms

Below are the analogous pictures {f(z):|z|=2}, {g(z):|z|=2}, and {h(z):|z|=2}.

9.3 μs
compute_path (generic function with 1 method)
36.4 μs
1.5 s
2.8 ms
124 ms

The picture of {h(z):|z|=2} is also a circle, but of radius 128.

This makes sense because h(x)=xn for n = 7.

(Can you explain this using our visual interpretation of complex multiplication?)

4.7 ms

Fundamental theorem of algebra

The fundamental theorem of algebra result says that if n>0 then any polynomial

p(x)=z0+z1x+z2x2++znxn

with zn0 can be factored as

p(x)=zn(xα1)(xα2)(xαn)

for some complex numbers α1,α2,,αnC which do not need to be distinct.

We can sketch a visual proof of this fact, extending the discussion above.

17.8 μs
411 ns

Some preliminaries:

Fact. If p(0)=0 then p(x)=xq(x) for some polynomial q(x).

Proof: This is obvious since p(0)=z0.

Fact. If p(α)=0 then p(x)=(xα)q(x) for some polynomial q(x).

Proof: If p(α)=0 then the polynomial f(x)=p(x+α) has f(0)=0, so f(x)=xg(x).

But then p(x)=f(xα)=(xα)q(x) for the polynomial q(x)=g(xα).

Conclusion. To prove the fundamental theorem of algebra, it suffices to show that if n>0 then

p(α)=0

for some complex number αC.

A proof of this last property is what we will outline below.

19 μs
621 ns

Our proof involves the notion of the winding number of a curve in R2.

Consider a circle {zR2:|z|=r}. We order the points on this circle to start at the unique point the positive x-axis and travel counterclockwise.

Passing the points on the circle in order as inputs to p(x) traces a curve in R2. The winding number of this curve is the number of times the curves goes completely around the origin counter clockwise.

10.9 μs
winding_number (generic function with 1 method)
49.4 μs
plot_winding (generic function with 1 method)
45 μs

For example, p(x)=1+x+x2 has winding number 1 for r=1:

10.9 μs
572 ms

However, for r=2 the polynomial p(x)=1+x+x2 has winding number 2:

9.3 μs
5.7 ms

Whereas for r=0.5 the same polynomial has winding number 0:

7.8 μs
89.5 ms

Keys facts:

  • If p(0)0 and r is very small, the winding number will be zero.

  • If p(x)=xn then the winding number will always be n, for any r.

  • If p(x) has degree n and r is very large, then p(x) has the same winding number as xn.

7.8 μs
p
2×8 Array{Int64,2}:
 -9  -1  -1   10  -5  7  -3  -5
 -9  -9   9  -10   8  0  -5  -8
6.6 μs
"(-9 + -9i) + (-1 + -9i) * x + (-1 + 9i) * x^2 + (10 + -10i) * x^3 + (-5 + 8i) * x^4 + (7 + 0i) * x^5 + (-3 + -5i) * x^6 + (-5 + -8i) * x^7"
16.8 μs

parameter =

116 ms
r
1.87265
32.2 μs
winding
7
9.9 ms
10.6 ms

Why does this prove the fundamental theorem of algebra?

  • Winding number can only change as we vary r if {p(z):|z|=r} passes through the origin.

  • This must happen if p(x) has degree n>0 and p(0)0.

  • (Since the winding number is zero if r is small and the winding number is n if r is large.)

  • But this means for some real r>0 there is an αC with |α|=r and p(α)=0.

9 μs