\section{Origin of Complex Numbers}
\label{sec:complexorigin}
The idea of a complex number arose out of the problem of finding solutions to the equation
\[p(z)=0\]
where $p(z)=a_nz^n+a_{n-1}z^{n-1}+\cdots+a_2z^2+a_1z+a_0$ is a polynomial of order $n$ (so $a_n\neq0$). The solutions of this equation, known as the roots or zeros of the polynomial $p(z)$, are useful for factoring and vice versa.  If $c$ is a solution of this equation (so $p(c)=0$) this implies $(z-c)$ is a factor of $p(z)$ and we can write $p(z)=(z-c)q(z)$ where $q(z)$ is a simpler polynomial of order $n-1$.  However not every polynomial equation has a real solution.  So a quadratic equation like
\[z^2-2z+5=0\]
has no solution since, using the quadratic formula,
\[z=\frac{-b\pm\sqrt{b^2-4ac}}{2a}=\frac{2\pm\sqrt{4-20}}{2}=1\pm\frac{1}{2}\sqrt{-16}\]
and no real number squares to get -16.  Assuming square root obeys the usual properties, namely $\sqrt{rs}=\sqrt{r}\sqrt{s}$, we could write $\sqrt{-16}=\sqrt{16}\sqrt{-1}=4\sqrt{-1}$ and the (non-real) solutions simplify to
\[z=1\pm4\sqrt{-1}\,.\]
Thus the lack of solution for all similar equations reduces to the lack of a square root to -1.  While solutions involving $\sqrt{-1}$ cannot represent anything physical, it was found, when seeking a general formula for the root of a cubic equation
\[az^3+bz^2+cz+d=0\,,\]
that if one pretended that $\sqrt{-1}$ behaved like any other number it worked, as an intermediary, to finding real-valued solutions to the cubic equation.  In this way $\sqrt{-1}$ had bookkeeping utility in generating actual (real) solutions to problems.  With the development of mathematics axiomatically and the proven utility of treating $\sqrt{-1}$ as a number, complex numbers were born.\footnote{It is to be noted that complex numbers are now at the heart of our physical theories.  In quantum mechanics, the physical theory describing atoms and other microscopic phenomenon, the wave function $\Psi$ is a \emph{complex} scalar field.  One manipulates this field of complex numbers to extract real numbers that describe actual physical measurements.}

\definition{A number of the form $z=x+iy$ where $x$ and $y$ are real numbers and $i = \sqrt{-1}$ is called a \textbf{complex number}.  Here
\begin{itemize}
\item $x$ is called the \textbf{real part} of $z$ and is denoted by $x=\Re(z)$\\
\item $y$ is called the \textbf{imaginary part} of $z$ and is denoted by $y=\Im(z)$
\end{itemize}}

\begin{example}
The solutions to the previous quadratic are the complex numbers
\[z_1=1+4i,\ \ \ \ \ \ z_2=1-4i\,,\]
with real and imaginary parts
\begin{align*}
&\Re(z_1)=1 &\Im(z_1)=4 & &\Re(z_2)=1 & &\Im(z_2)=-4\,.
\end{align*}
\end{example}

\section{Complex Conjugate}
Every complex number $z$ has a complex conjugate.
\definition{The \textbf{complex conjugate} of complex number $z=x+iy$ is denoted $\cc{z}$ and is given by
\[\boxed{\cc{z} = x-iy}\,.\]}
\begin{example}
Find the complex conjugates of
\begin{enumerate}
\item $z=4+3i$
\item $z=-3+5i$
\item $z=2i$
\end{enumerate}
Solution:
  \begin{enumerate}
    \item $z = 4+3i \implies \cc{z} = 4-3i$
    \item $z = -3+5i \implies \cc{z} = -3-5i$
    \item $z = 2i \implies \cc{z} = -2i$
  \end{enumerate}
\end{example}


\section{Operations on Complex Numbers}
Let $z_1 = x_1 + iy_1$ and $z_2 = x_2 + iy_2$ be complex numbers.  For addition and subtraction the $i$ behaves just like a variable or constant:
\begin{description}
\item[Addition:] $\boxed{z_1 + z_2 = (x_1 + x_2) + i(y_1+y_2)}$
\item[Subtraction:] $\boxed{z_1-z_2 = (x_1-x_2) + i(y_1-y_2)}$
\end{description}

For multiplication of two complex numbers one remembers that $i=\sqrt{-1}$ simplifies powers of $i$:

\begin{example}
  \begin{enumerate}
    \item $i=\sqrt{-1}$
    \item $i^2=-1$ (definition of square root)
    \item $i^3 = i^2i = -i$
    \item $i^4 = i^2i^2 = (-1)(-1) = 1$
  \end{enumerate}
\end{example}

With this in mind we have
\begin{description}
\item[Multiplication:] $\boxed{z_1z_2 = (x_1x_2 - y_1y_2) + i(x_1y_2 + x_2y_1)}$\\[.5em]
Since
\begin{align*}
  z_1z_2 &= (x_1+iy_1)(x_2+iy_2)\\
  &= x_1x_2 + ix_1y_2 + iy_1x_2 + i^2y_1y_2\\
  &= x_1x_2  + i(x_1y_2 + y_1x_2) - y_1y_2\\
  &= (x_1x_2 - y_1y_2) + i(x_1y_2 + y_1x_2)\,.
\end{align*}
\end{description}
Note that complex multiplication is commutative, $\boxed{z_1z_2=z_2z_1}$ just as for real numbers.

\theorem{The complex conjugate of a product is the product of the complex conjugates,
\[\boxed{\cc{z_1z_2}=\cc{z_1}\,\cc{z_2}}\,.\]
}

Evaluation of the quotient of two complex numbers, $z_1/z_2$ can be resolved by multiplying the fraction by $1=\cc{z_2}/\cc{z_2}$ as shown below.

\begin{description}
\item[Division:] $\boxed{\displaystyle\frac{z_1}{z_2} = \frac{x_1x_2+y_1y_2}{x_2^2+y_2^2} + i \frac{x_2y_1-x_1y_2}{x_2^2+y_2^2}}$\\[.5em]

Since:
\begin{align*}
\frac{z_1}{z_2} &=\frac{x_1+iy_1}{x_2+iy_2}\\
&=\frac{(x_1+iy_1)(x_2-iy_2)}{(x_2+iy_2)(x_2-iy_2)}\\
&= \frac{x_1x_2-ix_1y_2+ix_2y_1-i^2y_1y_2}{x_2^2-ix_2y_2+ix_2y_2-i^2y_2^2}\\
&= \frac{x_1x_2+i(x_2y_1-x_1y_2) + y_1y_2}{x_2^2 + y_2^2}\\
&= \frac{(x_1x_2 + y_1y_2) + i(x_2y_1-x_1y_2)}{x_2^2+y_2^2}\\
&= \frac{x_1x_2+y_1y_2}{x_2^2+y_2^2} + i \frac{x_2y_1-x_1y_2}{x_2^2+y_2^2}\,.
\end{align*}
\end{description}

Note that the form of the quotient shows every complex number $z$ has a multiplicative inverse
\[\boxed{z^{-1}=\frac{1}{z}=\frac{\cc{z}}{z\cc{z}}=\frac{x}{x^2+y^2}-i\frac{y}{x^2+y^2}}\]
provided $z=x+iy\neq 0$ since then $x^2+y^2\neq 0$, just like for real numbers.\footnote{Note this, in part, explains why we introduced $i$ such that $i^2=-1$ as opposed to something else.  If $i^2=1$ then there would be nonzero numbers having no multiplicative inverse.}

With this discussion in mind complex arithmetic is readily performed.  Note that the above formulas for multiplication and division need not be memorized. One need only remember that $i^2=-1$ for multiplication and to multiply by  $1=\cc{z}/\cc{z}$ to evaluate division by $z$.
\begin{example}
  If $z_1 = 3-2i$ and $z_2 = 2+i$, evaluate:
  \begin{enumerate}
    \item $z_1 + z_2$
    \item $z_1 - \cc{z_2}$
    \item $z_1z_2$
    \item $\cc{z_1}\,\cc{z_2}$
    \item $\displaystyle\frac{z_1}{z_2}$
  \end{enumerate}
Solution:
\begin{enumerate}
    \item $z_1 + z_2 = (3-2i)+(2+i) =5-i$
    \item $z_1 - \cc{z_2} = (3-2i)-(2-i)= 1-i$
    \item $z_1z_2 = (3-2i)(2+i)=6+3i-4i-2i^2 = 6-i-2(-1)= 6-i-2 = 8-i$
    \item $\cc{z_1}\,\cc{z_2} = (3+2i)(2-i) = 6-3i+4i-2i^2 = 6+i-2(-1)=6+i+2 = 8+i=\cc{z_1z_2}$
    \item $\displaystyle\frac{z_1}{z_2} = \frac{3-2i}{2+i} = \frac{(3-2i)(2-i)}{(2+i)(2-i)} = \frac{6-3i-4i+2i^2}{4-2i+2i-i^2} = \frac{6-7i+2(-1)}{4-(-1)} = \frac{6-7i-2}{4+1}$\\[.2em]
      $\displaystyle = \frac{4-7i}{5} = \frac{4}{5}-\frac{7}{5}i$
  \end{enumerate}
\end{example}

\section{Solving Complex Equations}
Equations involving complex variables and numbers can be solved using the usual algebraic manipulations.
\begin{example}
  Solve the following equations for $z$.
  \begin{enumerate}
    \item $2z + 3 + 2i = (2+i)^2$
    \item $3z + i-2(2z-i) = 2-i$
    \item $\displaystyle\frac{1}{z} = 2+3i$
    \item $2z - iz = 2+i$
    \item $z^2 = 4i$
  \end{enumerate} 

  Solution:\\
 \begin{enumerate}
    \item $2z + 3 + 2i = (2+i)^2$
    \begin{align*}
      2z &= (2+i)^2 -3 -2i\\
      2z &= 4+4i + i^2 - 3 - 2i\\
      2z &= 1+2i+(-1)\\
      2z &= 2i\\
      z &= i
    \end{align*}

\item $3z + i-2(2z-i) = 2-i$
    \begin{align*}
      3z + i-4z+2i &= 2-1\\
      -z &= 2-i-3i\\
      -z &= 2-4i\\
      z &= -2+4i
    \end{align*}
    
 \item $2z - iz = 2+i$
    \begin{align*}
      (2-i)z &= 2+i\\
      z &= \frac{2+i}{2-i}\\
      z &= \frac{(2+i)(2+i)}{(2-i)(2+i)}\\
      z &= \frac{4+4i+i^2}{4+2i-2i-i^2}\\
      z &= \frac{4+4i-1}{4+1}\\
      z &= \frac{3+4i}{5}\\
      z &= \frac{3}{5} + \frac{4}{5}i
    \end{align*}

\item $\displaystyle\frac{1}{z} = 2+3i$
    \begin{align*}
      z &= \frac{1}{2+3i}\\
      z &= \frac{2-3i}{(2+3i)(2-3i)}\\
      z &= \frac{2-3i}{4-6i+6i-9i^2}\\
      z &= \frac{2-3i}{4-9(-1)}\\
      z &= \frac{2-3i}{13}\\
      z &= \frac{2}{13}-\frac{3}{13}i
    \end{align*}

\item $z^2 = 4i$\\
Write $z=x+iy$ where $x$ and $y$ are real variables.  Then
    \begin{align*}
      z^2 &= 4i\\
      (x+iy)^2 &= 4i\\
      x^2+2ixy+i^2y^2 &= 4i\\
      x^2 + i(2xy) - y^2 &= 4i\\
      (x^2-y^2) + i(2xy) &= 4i\\
      \begin{cases}
        x^2-y^2 = 0\\
        2xy = 4\\
      \end{cases} &\Rightarrow \begin{cases}
        x^2-y^2 = 0\\
        xy = 2\\
      \end{cases}\\
      x^2-y^2 &= 0\\
      x^2 &= y^2\\
      x &= \pm y
    \end{align*}
    If $x=-y$, then substitution into $xy=2$ gives
    \begin{align*}
      (-y)(y) &= 2\\
      -y^2 &= 2\\
      y^2 &= -2
    \end{align*}
    No solution since $y$ is a real number.
    
    If $x=y$, then 
    \begin{align*}
      (y)(y) &= 2\\
      y^2 &= 2\\
      y &= \pm \sqrt{2}
    \end{align*}
    Since $x=y$, then solutions are $z=\sqrt{2}+i\sqrt{2}$ or $z=-\sqrt{2}-i\sqrt{2}$\,.
    
 \end{enumerate}
 As with any equations the solutions can be checked in the original equation.
\end{example}

\section{The Complex Plane}

Since a complex number $z=x+iy$ is composed of two real numbers $x$ and $y$ constituting its real and imaginary parts, we can consider $z$ to be represented by the ordered pair $(x,y)$.  With that in mind we consider complex numbers to live in the \textbf{complex plane}.
\begin{center}
\includegraphics[height=1.5in]{complexnumbers/complexplane}
\end{center}

A real number $x$, which is a special case of a complex number $z$ where $\Im(z)=0$, lives on the real axis line of the complex plane.

The distance from the origin of the complex plane to the point $z$ is its magnitude.
\begin{center}
\includegraphics[height=1.5in]{complexnumbers/complexlength}
\end{center}
\definition{The \textbf{magnitude} or \textbf{absolute value} or \textbf{modulus} of a complex number $z=x+iy$, denoted by $|z|$\,, is defined to be
\[|z| = \sqrt{x^2+y^2}\,.\]}

Note that when $z$ is real then $|z|=|x+0i|=\sqrt{x^2}=|x|$ reduces to the real absolute value.

\begin{example}
  Find the magnitude of the given complex number.
  \begin{enumerate}
    \item $z = 4+2i$
    \begin{align*}
      x &= 4 \, \, , \,\, y = 2\\
      |z| &= \sqrt{4^2+2^2} = \sqrt{20}\\
      |z| &= 2\sqrt{5}
      \end{align*}
      \item $z = -5+3i$
      \begin{align*}
        x&=-5 \, \, , \,\, y=3\\
        |z| &= \sqrt{(-5)^2+3^2}\\
        |z| &= \sqrt{34}
      \end{align*}
      \item $z = -2$
      \begin{align*}
        x&=-2\,\, , \, \, y=0\\
        |z| &= \sqrt{(-2)^2+0^2}\\
        |z| &=\sqrt{4}=2
      \end{align*}
  \end{enumerate}
\end{example}

Direct calculation shows the following.
\theorem{If $z$ is a complex number then $|z|^2=z\cc{z}$ and $|\cc{z}|=|z|$\,.}

Interpreting complex numbers as points in the plane we have the following.
\definition{The \textbf{distance} between two complex numbers $z_1 = x_1+iy_1$ and $z_2 = x_2+iy_2$ is given by:
\[|z_1-z_2| = \sqrt{(x_1-x_2)^2 + (y_1-y_2)^2}\,.\]}

\begin{example}
  Find the distance between the complex numbers $z_1=2-3i$ and $z_2=3+i$\,.\\[.5em]
  Solution:
  \[|z_1-z_2| = |(2-3i)-(3+i)|=|-1-4i|=\sqrt{(-1)^2 + (-4)^2}=\sqrt{17}\,.\]
\end{example}

\subsection{Polar Representation}

\begin{center}
\includegraphics[height=1.5in]{complexnumbers/polar}
\end{center}

A point in polar coordinates $(r,\theta)$ as shown above, satisfies
\begin{align*}
  \cos\theta &= \frac{x}{r} \ \Rightarrow\  \boxed{x = r\cos\theta}\\
  \sin\theta &= \frac{y}{r} \ \Rightarrow\ \boxed{y =r\sin\theta}
\end{align*}
To find $r$ and $\theta$ we solve the previous equations.
   \begin{align*}
  x^2+y^2 & = r^2\cos^2\theta + r^2\sin^2\theta= r^2(\cos^2\theta + \sin^2\theta)= r^2(1)=r^2\ \Rightarrow\ \boxed{r = \sqrt{x^2+y^2}=|z|}\\
 \frac{y}{x} & = \frac{r\sin\theta}{r\cos\theta}=\frac{\sin\theta}{\cos\theta}=\tan\theta \ \Rightarrow\ \boxed{\tan\theta=\frac{y}{x}}
\end{align*}
Note the quadrant for angle $\theta$ which solves this last equation is determined by the position of $(x,y)$ in the complex plane.

A complex number $z = x+iy$ can therefore be written
\[z = x+iy = r\cos\theta + ir\sin\theta\]
where $r=|z|$ is the magnitude of $z$ and $\theta$ is called the \textbf{argument of $z$} and is denoted $\bm{\arg(z)}$\,. Note the argument of $z$ is not unique. (It can be replaced by $\theta+2n\pi$ where $n=0,\pm1,\pm2\,\ldots$). However there exists only one argument $\theta$ is in the range $-\pi \leq \theta \leq \pi$ and this is called the \textbf{principle argument}.

Since Euler's formula states\footnote{For readers who have studied series, Euler's Formula can be proven by plugging $i\theta$ for $x$ in the Maclaurin series for $e^x$, simplifying the powers of $i$ using $i^2=-1$, and then breaking the resulting terms into the real and imaginary ones.  The Maclaurin series of cosine and sine will be recognized in these pieces.}
\[\boxed{e^{i\theta} = \cos\theta + i\sin\theta}\]
we can simplify the form of $z$ in terms of $r$ and $\theta$.
\definition{The \textbf{polar form} of a complex number $z=x+iy$ is
\[\boxed{z = r(\cos\theta + i\sin\theta) = re^{i\theta}}\,,\]
where $r=|z|$ and $\theta=\arg(z)$\,.}

Here $e = 2.7182\ldots$ is the natural constant (Euler's number).

\begin{example}
  Find the polar form of the complex number.
  \begin{enumerate}
    \item $z = 2+2i$\\
    Solution:
    \begin{align*}
      x &= 2 \, \, , \,\, y = 2\\
      r &= \sqrt{x^2+y^2}= \sqrt{2^2+2^2}= \sqrt{8}= 2\sqrt{2}\\
      \tan\theta &= \frac{y}{x}= \frac{2}{2}= 1\ \Rightarrow\ \theta = \frac{\pi}{4}\ \ (\text{Since $(2,2)$ is in Quadrant I\,.})
    \end{align*}
Therefore $z=2+2i= 2\sqrt{2} e^{i\frac{\pi}{4}}$\,.

\item $z = 4i$\\
Solution:
    \begin{align*}
      x &=0 \, \, ,\,\, y = 4\\
      r &= \sqrt{x^2+y^2}= \sqrt{0^2+4^2}= 4\\
      \sin\theta&=4>0,\ \cos\theta=0\ \Rightarrow\ \theta = \frac{\pi}{2}
      \end{align*}
Therefore $z=4i= 4e^{i\frac{\pi}{2}}$\,.
 
    \item $z=-1+\sqrt{3}i$\\[.5em]
    Solution:
    \begin{align*}
      x &= -1\,\,,\,\, y=\sqrt{3}\\
      r &= \sqrt{x^2+y^2}= \sqrt{(-1)^2+\sqrt{3}^2}= \sqrt{4} = 2\\
      \tan\theta &= \frac{y}{x}= \frac{\sqrt{3}}{-1} = -\sqrt{3}\ \Rightarrow\ 
      \theta = \pi-\frac{\pi}{3}=\frac{2\pi}{3}\ (\text{Since $(-1,\sqrt{3})$ is in Quadrant II\,.})
    \end{align*}
     Therefore $z=-1+\sqrt{3}i=2e^{i\frac{2\pi}{3}}$\,.
  \end{enumerate}
\end{example}

The law of exponents,
\[e^we^z = e^{w+z}\]
which holds for complex numbers $w$ and $z$ show the value of the polar form of a complex number for multiplication, division, and powers.

\theorem{If $z_1 = r_1e^{i\theta_1}$ and $z_2= r_2e^{i\theta_2}$, then:
\begin{enumerate}
\item $\boxed{\displaystyle z_1z_2 = r_1r_2e^{i(\theta_1+\theta_2)}}$
\item $\boxed{\displaystyle \frac{z_1}{z_2}=\frac{r_1}{r_2}e^{i(\theta_1-\theta_2)}}$
\end{enumerate}}

\textbf{Proof:}
\begin{align*}
z_1z_2 &= r_1e^{i\theta_1} r_2e^{i\theta_2}= r_1r_2e^{i\theta_1}e^{i\theta_2}= r_1r_2e^{i\theta_1+i\theta_2}= r_1r_2e^{i(\theta_1+\theta_2)}
\end{align*}
Note that for $z=re^{i\theta}$ we have $\boxed{\cc{z}=re^{-i\theta}}$ since
\[\cc{z}=\cc{r(\cos\theta+i\sin\theta)}=r(\cos\theta-i\sin\theta)=r[\cos(-\theta)+i\sin(-\theta)]=re^{-i\theta}\]
where we used that cosine is an even function and sine is an odd function.  Then
\[\frac{z_1}{z_2}=\frac{z_1\cc{z_2}}{z_2\cc{z_2}}=\frac{r_1e^{i\theta_1}r_2e^{-i\theta_2}}{r_2e^{i\theta_2}r_2e^{-i\theta_2}}=\frac{r_1e^{i\theta_1-i\theta_2}}{r_2e^{i\theta_2-i\theta_2}}=\frac{r_1e^{i(\theta_1-\theta_2)}}{r_2e^0}=\frac{r_1}{r_2}e^{i(\theta_1-\theta_2)}\,,\]
where we used $e^0=1$\,.

Note:\\
The result for multiplication shows that the effect of multiplying a complex number by $z=re^{i\theta}$ is to scale the magnitude by $r$ and rotate the number counterclockwise by an angle $\theta$\,.

\theorem{If $z = re^{i\theta}$, then:
\[\boxed{z^n = r^ne^{in\theta}}\,.\]}

\textbf{Proof:}\\
Using the usual rules for powers which hold for complex numbers we have:
\[z^n = (re^{i\theta})^n= r^n(e^{i\theta})^n= r^ne^{in\theta}\]

Letting $z=e^{i\theta}$ in the previous theorem gives the following corollary which can be used to prove many trigonometric identities.

\textbf{Corollary:} (De Moivre's Theorem)\\
For any integer $n$ one has $\left(e^{i\theta}\right)^n=e^{in\theta}$, which implies
\[\boxed{(\cos\theta+i\sin\theta)^n=\cos(n\theta)+i\sin(n\theta)}\,.\]

\textbook{\newpage}
\begin{example}
If  $z_1=2+2i= 2\sqrt{2} e^{i\frac{\pi}{4}}$, $z_2=4i= 4e^{i\frac{\pi}{2}}$, and $z_3=-1+\sqrt{3}i=2e^{i\frac{2\pi}{3}}$, evaluate the indicated power.
  \begin{enumerate}
    \item $(z_1)^4$\\[.5em]
    Solution:
    \[(z_1)^4 = (2+2i)^4=(2\sqrt{2}e^{i\frac{\pi}{4}})^4= 2^4(\sqrt{2})^4(e^{i\frac{\pi}{4}})^4= 16(4)(e^{i\pi})= 64e^{i\pi}=64(-1)=-64\]

    \item $(z_2)^{10}$\\[.5em]
    Solution:
    \[(z_2)^{10} = (4i)^{10}=(4)^{10}(e^{i\frac{\pi}{2}})^{10}=(4)^{10}e^{i5\pi}=(4)^{10}(e^{i\pi})^5=(4)^{10}(-1)^5=-(4)^{10}\]
    \item $(z_3)^6$\\[.5em]
    Solution:
    \[(z_3)^6 = (2e^{i\frac{2\pi}{3}})^6= 2^6(e^{i\frac{2\pi}{3}})^6= 64e^{i4\pi}=64(e^{i2\pi})^2=64(1)^2=64\]
  \end{enumerate}
\end{example}

To conclude this section it is easy to confuse complex numbers with other mathematical constructions that are similar but conceptually different.  For instance, it is easy to confuse a vector in $\mathset{R}^2$ with a complex number since they have two components which add in the same way.  However complex numbers are numbers in that they share the same axioms as real numbers and form a mathematical \textbf{field}.  In particular they have a commutative multiplication that is not possessed by a vector in $\mathset{R}^2$\,.  As such we should think of complex numbers in linear algebra as being used in the same way as are real numbers, namely as entries in a matrix (or potentially a vector) or as scalars that multiply a matrix (or vector).

A second confusion that is easily made is to think of the polar representation of a complex number as the same as polar coordinates.  While it is true that one derives $r$ and $\theta$ in $z=re^{i\theta}$ from $x$ and $y$ in the same way one transforms a function $f(x,y)$ of Cartesian coordinates into a function $\tilde{f}(r,\theta)$ of polar coordinates, the underlying coordinate system does not carry with it any of the structure of complex numbers; there is no $i$, etc.  So transforming from Cartesian to polar coordinates can be generalized in three dimensions to a transformation from Cartesian coordinates $(x,y,z)$ to spherical-polar coordinates $(r,\theta,\phi)$, while no analogue of complex numbers even exists in three dimensions.\footnote{Analogues of complex numbers can be created in four dimensions (called \textbf{quaternions}) and eight dimensions (called \textbf{octonions}).  The latter numbers do not satisfy all the field axioms that real and complex numbers do, in particular their multiplication does not commute.  However they too have their useful applications.  Historically quaternions were developed before vectors, and vectors in arbitrary $n$ dimensions arose in part by realizing that the multiplicative structure of quaternions was not needed for many physical problems.}  We can be interested in complex (or real) functions of complex numbers, $f(z)$, and this is the basis of a course in complex analysis.  Here the multiplicative structure of the complex number imbues such functions with rich properties with wide application.  Our rudimentary treatment of complex numbers here is simply to solve some basic problems that arise in linear algebra as will be shown in the next section.

\section{Complex Eigenvalues and Eigenvectors}
\label{subsec:complexeigenvalues}

The \textbf{Fundamental Theorem of Algebra} implies that every polynomial $p(x)$ of order $n$ has $n$ complex roots (allowing for algebraic multiplicity).  This shows that, in general we will find $n$ eigenvalues for a square matrix $A$ of order $n$, though some of those values may be complex.  A polynomial with real coefficients having a complex root $z$ will also have $\cc{z}$ as a root.  So complex roots show up in pairs.  As an example, our polynomial from Section~\ref{sec:complexorigin} with real coefficients, $p(z)=z^2-2z+5$, had two complex roots, namely $z=1+4i$ and its complex conjugate $z=1-4i$.  So if $p(z)$ were the characteristic polynomial for a $2\times2$ matrix, these roots would have been its (complex) eigenvalues.  The following theorem shows that certain matrices are guaranteed to have real eigenvalues.
 
\theorem{The eigenvalues of a symmetric matrix with real entries are real.}

We can solve for eigenvalues and eigenvectors involving complex eigenvalues using our usual techniques of solving linear systems, now applied to matrices with complex entries.
\begin{example}
Find the eigenvalues and eigenvectors of the given matrix.
\[A = \begin{bmatrix*}[r]
0&-1\\1&0
\end{bmatrix*}\]
Solution:
\begin{align*}
  \det (A-2I) &= 0\\
  &\Rightarrow\ \begin{vmatrix}
  -\lambda&-1\\1&-\lambda
  \end{vmatrix} = 0\\
  &\Rightarrow\ \lambda^2 + 1 = 0\\
  &\Rightarrow\begin{cases}\lambda_1 = i \\
  \lambda_2=-i\end{cases}\, \, (\text{complex eigenvalues despite real matrix!})
 \end{align*}

Next find the eigenvectors by manipulating the matrices with complex numbers in the same way we did the real matrices.
\begin{description}
\item[$\bm{\lambda_1 = i}$\,:]

 \[(A - iI)\lvec{x}_1 = 0\]
 \[\begin{bmatrix}[rr|r]-i&-1&0\\1&-i&0
 \end{bmatrix}\]
 \[\Downarrow\]
 \begin{flalign*}&\rowopmatrix[17em]{\rowswap{R_1}{R_2} \\ }{\begin{bmatrix}[rr|r]
       1&-i&0\\-i&-1&0
   \end{bmatrix}}&\end{flalign*}
   \[\Downarrow\]
   \begin{flalign*}&\rowopmatrix[8.2em]{ \\ \rowop{R_2}{R_2 + iR_1} }{\begin{bmatrix}[rc|r]
         1&-i & 0\\0&-1-i^2&0
       \end{bmatrix}\ \ (\text{But $i^2=-1$.})}\end{flalign*}
   \[\Downarrow\]
   \[\begin{bmatrix}[cr|r]
   \circled{1}&-i & 0\\0&0&0
   \end{bmatrix}\hspace{.7em}\]
   \begin{itemize}
   \item $\boxed{x_2 = t}$
   \item $x_1 - ix_2 = 0 \implies x_1-it=0 \implies \boxed{x_1 = it}$
   \end{itemize}
 Therefore $\lvec{x}_1= \begin{bmatrix}
    it\\t
  \end{bmatrix} = t \begin{bmatrix}
    i\\1
  \end{bmatrix}$ and so $\{(i,1)\}$ is a basis for the $\lambda=i$ eigenspace.

\item[$\bm{\lambda_2 = -i}$\,:]
\begin{align*}
  (A-(-i)I)\lvec{x}_2 &= 0\\
  (A+iI)\lvec{x}_2 &= 0
\end{align*}
\[\begin{bmatrix}[rr|r]
i&-1&0\\1&i&0
\end{bmatrix}\]
\[\Downarrow\]
\begin{flalign*}&\rowopmatrix[17em]{\rowswap{R_1}{R_2} \\ }{\begin{bmatrix}[rr|r]
      1&i&0\\i&-1&0
  \end{bmatrix}}&\end{flalign*}
\[\Downarrow\]
\begin{flalign*}&\rowopmatrix[17em]{ \\ \rowop{R_2}{R_2 - iR_1}}{\begin{bmatrix}[rc|r]
        1&i&0\\0&-1-i^2&0
  \end{bmatrix}}&\end{flalign*}
\[\Downarrow\]
  \[\begin{bmatrix}
  [cr|r] \circled{1}&i&0\\0&0&0
  \end{bmatrix}\hspace{.7em}\]
  \begin{itemize}
  \item $\boxed{x_2 = t}$
  \item $x_1 + ix_2 = 0 \implies x_1 + it= 0 \implies \boxed{x_1=-it}$
  \end{itemize}
  Therefore $\lvec{x}_2 = \begin{bmatrix}
    -it\\t
  \end{bmatrix} = t \begin{bmatrix}
    -i\\1
  \end{bmatrix}$ and so $\{(-i,1)\}$ is a basis for the $\lambda=-i$ eigenspace. 
\end{description}
\end{example}

% Add comment about complex numbers not polar coordinates nor vectors.
%
% Fotini has notes on the roots of unity.  I skipped these but they
% could be part of assignment?  Do they have particular utility here?
%
% Add comment about quantum mechanics defined with complex numbers.
%
% Add section on complex matrices, adjoint, and the generalization of theorems.
%
% Put example of finding eigenvalues and eigenvectors of a rotation about
% the x-axis and arbitrary angle.  Show how the angle can be found from
% the eigenvalues as can the plane of rotation by the eigenvectors.
% Finally talk about the trace of an arbitrary rotation matrix.
