UC SCI 111, sep 18, 2002
Notebook 4
Complex Numbers

Initializations

PlotRoots[f_, x_Symbol, opts___Rule] := 
      Module[{sols, a, pts}, 
sols = 
          NSolve[f == 0, x]; 
a = 
          1.05*Max[Abs[x] /. sols]; 
pts = {Re[x], Im[x]} /. 
            sols; 
Show[
          Graphics[{PointSize[ .025], Hue[ .7], Point /@ pts}], opts, 
          Axes -> True, PlotRange -> {{-a, a}, {-a, a}}, 
          AspectRatio -> Automatic]
]

ShowProduct[z_, w_, opts___Rule] := 
      Module[{zw, a, pts, b, blu}, 
zw = 
          z*w; 
blu = 
          RGBColor[ .1,  .1, 1]; 
mags = 
          Abs /@ {z, w, zw}; 
a = 
          1.1*Max[mags]; 
b = 
          Min[mags]; 
pts = {Re[#], Im[#]} & /@ {z, w, 
              zw}; 
lines = {#, {0, 0}} & /@ 
            pts; 
Show[
Graphics[{GrayLevel[ .7], Circle[{0,  0}, b]}], 
Graphics[{blu, 
              Line /@ Take[lines, 2]}], 
Graphics[{Hue[0], 
              Line[lines[[3]]]}], 
          Graphics[{blu, PointSize[ .025], Point /@ Take[pts, 2]}], 
          Graphics[{Hue[ .1], PointSize[ .025], Point[pts[[3]]]}], 
          opts, 
Frame -> True, Axes -> True, 
          PlotRange -> {{-a, a}, {-a, a}}, 
          AspectRatio -> Automatic]
]

Complex numbers in Mathematica

In Mathematica we can work with complex numbers just as easily as real numbers. In the standard input palet there is the symbol i, that can be used for (Sqrt[-1]). Or you can simply type I.

Exercise.
Calculate the following complex numbers:
a) (1-3 i) (2+i)
b) (((1 + i))^8)
c) (3+I)/(5+I)
d) (e^(π i))

Multiplication of complex numbers

This notebook has a command ShowProduct, which displays a graphic illustrating the position in the complex plane of the product of any given pair of complex numbers. For instance:

ShowProduct[1 + I, 2 + I]

The two factors are each shown in blue, and the product is shown in orange. A grey circle is also shown whose radius matches the lesser of the magnitudes of the two factors (this is simply a visual aid for measuring lengths and angles).

Exercise.
a) Use ShowProduct to convince yourself that multiplication by i really causes a rotation about a 90 degree angle.
b) Using the ShowProduct command (and your mathematical wits), find a complex number whose square is i.
c) Find a second complex number whose square is i.
d) Argue that there can be no others. You may use a geometric argument, or you may cite the fundamental theorem of algebra.

Roots of unity

Suppose z is a complex number satisfying the equation (z^n) = 1 (where n is a positive integer). We say that z is an nth root of unity. For instance, when n = 2, we have the square roots of unity 1 and -1.

Exercise. (In parts a, b, c, the computer is optional)
Let z be an 8th root of unity.
a) Consider the magnitude |z| of z. What equation must it satisfy? Use the fact that |z| is a non-negative real number to solve this equation and find |z|.
b) Consider the argument θ of z. What equation(s) must it satisfy? Can you find 8 distinct solutions for θ? 
c) Find the 8th roots of unity.
d) Verify your answers with Mathematica by raising each to the 8th power.

Roots of polynomials

We first summarize the two main theoretical results from class:

1. (The Fundamental Theorem of Algebra) A polynomial f of degree n factors completely over the complex numbers. In other words, f has precisely n zeros, if we count the zeros with their  multiplicity

2. If z is a root of a polynomial f with real coefficients, then the conjugate of z is also a root of f.

We now introduce the Mathematica command PlotRoots, which simply plots the roots of a polynomial. The first argument is a polynomial, and the second names the variable occuring in the polynomial. For instance (and this should look familiar):

PlotRoots[(x^8) - 1, x]

Exercise.
Consider the output of PlotRoots for the polynomial f(x) = 3  (x^6) - 3  x - 2. Two of the roots appear from the plot to be real numbers. (But of course one cannot be sure from a plot; either or both might perhaps be complex numbers with imaginary components close to, but not equal to, zero). 
a) Using the Solve and NSolve commands, try to find the roots of f. Explain why you still cannot be certain (using these two commands) that f has two real roots.
b) Using PlotRoots and the two theoretical results from class, make a formal argument proving that these two roots are indeed real numbers. Hint: What would happen if one of these roots were not real?