Complex Numbers and Quaternions

Complex Numbers

From the birth of algebra to the early 1500's, mathematicians struggled to solve the cubic equation,

(1)
\begin{equation} x^3+ax^2+bx+c=0 \end{equation}

As late as 1494, Luca Pacioli had declared this problem to be as difficult as the quadrature of the circle. Luckily, Pacioli was wrong and just ten years later, Scipione del Ferro struck the first blow in solving this problem. He was able to find the solution to the so called depressed cubic,

(2)
\begin{equation} x^3+bx+c=0 \end{equation}

Then in 1545, with his Ars Magna (The Great Art), Girolamo Cardano was able to show how to reduce any cubic down to the depressed cubic and thereby solve any cubic equation. A great achievement, no doubt, but arguably of equal importance was his use of the square root of a negative number. In the process of trying to answer the question of finding two numbers whose product is 40 and whose sum is 10, he arrived at the solutions,

(3)
\begin{align} 5+\sqrt{-15}\\ 5-\sqrt{-15} \end{align}

Notice:

(4)
\begin{align} 5+\sqrt{-15}+5-\sqrt{-15}=10\\ (5+\sqrt{-15})(5-\sqrt{-15})=25+15=40\\ \end{align}

Although these two numbers form the answer to the proposed question, mathematicians at this time were not completely comfortable with their introduction because they did not represent a physical quantity. Let's get ourselves comfortable with these new numbers.

Definition

In order to start creating an algebra that accounts for square roots of negative numbers, we need to define how they interact with our already existing real numbers. We start by defining the imaginary unit, which we represent with $i$, as $i=\sqrt{-1}$.

Let's look at how $i$ combines with itself through powers of $i$.

(5)
\begin{align} i^2=\left ( \sqrt{-1} \right )^2 = -1\\ i^3 = i^2(i)=-1(i)=-i\\ i^4 = i^3(i)=-i(i)=-(i^2)=-(-1)=1\\ i^5=i^4(i)=1(i)=i\\ \end{align}

As you can see the powers of I just run through a cycle of $i,-1,-i,1$. So any power of $i$ can be expressed in terms of real numbers or the first power of $i$

Exercise
Find $i^{83}$

If we combine this imaginary unit with the real numbers via the operations of arithmetic, we obtain what are called the complex numbers. Any complex number can be expressed in the form $a+bi$ where $a$ and $b$ are real numbers. The complex numbers are an extension of the real numbers. In other words, the real numbers are a subset of the complex numbers. This is due to the fact that every real number can be written in the form $a+bi$ where $b=0$.

Graphical Representation

Since every complex number has both a real and an imaginary part, we can represent them graphically as points in a 2D plane. We call this the complex plane. The complex plane has two axes, the real axis running horizontally and the imaginary axis running vertically.

Polar Form

As we saw previously, points in the plane can be represented by an angle and a radius. For complex numbers, this is no different. For any complex number, we can describe the angle made with the positive real axis and the distance from the origin. This distance is referred to as the modulus.
Therefore, for a complex number $c=a+bi$,

(6)
\begin{array} {rcl} \mbox{Angle}&:& \tan \theta = \frac{b}{a}\\ \mbox{Modulus}&:&|c|= \sqrt{a^2+b^2} \end{array}

Exercise
Give the polar form of $c=-2+4i$

Operations

Now we will look at some of the operations of algebra on these complex numbers.

Addition

To add two complex numbers, $c_1=a_1+b_1i$ and $c_2=a_2+b_2i$, we add the real parts of both numbers to obtain the real part of our sum and likewise, we add the imaginary part of both numbers to obtain the imaginary part of our sum.

(7)
\begin{equation} c_1+c_2=(a_1+a_2)+(b_1+b_2)i \end{equation}

Graphically these two points in the complex plane add together in a manner similar to our 2D vector addition. As you can see below, we create our familiar parallelogram.

(8)
\begin{equation} (4+1i)+(2+3i)=(6+4i) \end{equation}


Notice that the coefficients of the real and imaginary parts are determined by a real number addition. Therefore, complex addition inherits commutativity from the real numbers. That is to say,

(9)
\begin{equation} c_1+c_2=c_2+c_1 \end{equation}

Graphically, this is equivalent to traveling on the other legs of the parallelogram.

Exercise
Calculate $(10+5i)+(-6-20i)$

Scalar Multiplication

To multiply a complex number by a purely real number, or scalar, we simply distribute the scalar to both parts of our complex number. That is to say,

(10)
\begin{equation} k(a+bi)= ka+kbi \end{equation}

Since this operation is based on real number multiplication, scalar multiplication is commutative. In other words,

(11)
\begin{equation} k(a+bi)=(a+bi)k \end{equation}

Exercise
Calculate $4(3-7i)$

If we look at this result in polar form,

(12)
\begin{array} {rcl} \mbox{Angle}&:& \tan \theta = \frac{kb}{ka}=\frac{b}{a}\\ \mbox{Modulus}&:&|c|= \sqrt{k^2a^2+k^2b^2}=|k|\sqrt{a^2+b^2} \end{array}

we see that scalar multiplication does not affect $\tan \theta$, but scales the modulus by the factor $|k|$. If $k<0$, the new angle is the initial angle plus $\pi$. That is to say, our point is reflected through the origin.

Subtraction

Now that we have scalar multiplication, we define subtraction to be the addition of the additive inverse.

(13)
\begin{equation} c_1-c_2=c_1+(-1)c_2=(a_1+b_1i)+(-a_2-b_2i)=(a_1-a_2)+(b_1-b_2)i \end{equation}

Exercise
Calculate $(4+2i)-(4+6i)$

Multiplication

To multiply two complex numbers we use the distributive property.

(14)
\begin{equation} c_1c_2=(a_1+b_1i)(a_2+b_2i)=a_1a_2+a_1b_2i+a_2b_1i+b_1b_2i^2 = (a_1a_2-b_1b_2)+(a_1b_2+a_2b_1)i \end{equation}

Exercise
Calculate $(8-i)(2+2i)$

Exercise
Calculate $5i(3-4i)$

Multiplicative Identity

Since the set of complex numbers contain the real numbers as a subset, the complex numbers inherit the multiplicative identity, $1$, from the real numbers. That is to say

(15)
\begin{equation} 1c=c1=c \end{equation}

Conjugation

The conjugate of a complex number, $c=a+bi$ is the complex number with the same real part, but opposite imaginary part, written $c^*=a-bi$. The most important property of conjugates is that the product of a complex number and its conjugate is a real number

(16)
\begin{align} \left (c \right ) \left ( c^* \right ) =(a+bi)(a-bi)=a^2-abi+abi-b^2i^2=a^2+b^2=|c|^2 \end{align}

The conjugate will also play a role in our definition of complex division as we will see shortly.

Exercise
Give the conjugate of $c=5+9i$

Exercise
Give the conjugate of $c=1-4i$

Exercise
Give the conjugate of $c=2i$

Exercise
Give the conjugate of $c=8$

Exercise
Find the product of $c=4+3i$ and its conjugate

Multiplicative Inverse

Recall that the multiplicative inverse of an object in mathematics is the object in our set that when multiplied yields the multiplicative identity. In other words, given a complex number $c$, we want the complex number $c^{-1}$ such that

(17)
\begin{equation} cc^{-1}=c^{-1}c=1 \end{equation}

Recall from above that the complex conjugate multiplied by a complex number yields a real number, but the real number it yields is $|c|^2$. Although not $1$, this hints at what we need for an inverse. If we multiplied by the conjugate and divided by the modulus, we would have exactly what we are looking for.

(18)
\begin{align} c\frac{c^*}{|c|^2}=\frac{|c|^2}{|c|^2}=1 \end{align}

Therefore, by definition $c^{-1}=\frac{c^*}{|c|^2}$

Exercise
Find the inverse of $c=6+4i$

Division

Recall that in mathematics division is defined to be multiplication by the multiplicative inverse. Therefore,

(19)
\begin{align} \frac{c_1}{c_2}=(c_1)(c_2^{-1})=c_1\frac{\overline{c_2}}{|c_2|} \end{align}

Exercise
Simplify $\frac{2+5i}{3-4i}$

Quaternions

Definition

As we have just seen, complex numbers can be thought of as representations of points in 2D space. As such, we can compute the addition, subtraction, multiplication, and division of points in 2D space. Specifically, in the complex plane. In 1843, William Hamilton introduced quaternions as a way of extending this interpretation into 3D. He found this problem to be vexing because he could not find a way to make it work mathematically by just adding a second imaginary unit $j$. His breakthrough occurred when he realized that it would require adding two imaginary units, $j$ and $k$.
Hamilton had this eureka moment while walking along Brougham Bridge in Dublin and scratched his idea into the rock of the bridge. That spot is now memorialized with the following plaque.

William_Rowan_Hamilton_Plaque_-_geograph.org.uk_-_347941.jpg

Now we want to extend the idea of complex numbers to higher dimensions. A quaternion will consist of a real part and three imaginary parts. The imaginary unit i along with two new imaginary units j and k. So the general form of a quaternion is $a+bi+cj+dk$, where $a,b,c$ and $d$ are real numbers. These new imaginary units have the following property.

(20)
\begin{equation} i^2=j^2=k^2=ijk=-1 \end{equation}

This property along with quaternion multiplication can then be used to derive the following.

(21)
\begin{equation} ij=k , ji=-k \end{equation}
(22)
\begin{equation} jk=i , kj=-i \end{equation}
(23)
\begin{equation} ki=j , ik=-j \end{equation}

Scalar/Vector Notation

Since the quaternion $a+bi+cj+dk$, consists of a scalar component $a$ along with three complex components $b,c,d$ it is often written in the form $[s,\vec{v}]$ where $s=a$ and $\vec{v}=<b,c,d>$

Exercise
Write the quaternion $q=3+6i-9j+1k$ in scalar-vector form

Modulus

The size of a quaternion, alternately called the modulus, magnitude, or norm, is computed similarly to what we have seen for vectors and complex numbers.

(24)
\begin{align} |q| = \sqrt{a^2+b^2+c^2+d^2} \end{align}

or using the scalar-vector notation,

(25)
\begin{align} |q|= \sqrt{s^2+v_x^2+v_y^2+v_z^2} = \sqrt{s^2+|\vec{v}|^2} \end{align}

Graphical Representation

Previously, we saw that complex numbers could be thought of as points in the complex plane. Quaternions, unfortunately are 4D objects, so although we can think of them as points in 4D space, that space is beyond our capabilities of visualization. What we can do though is view the vector portion of the quaternion as representing a point in 3D space. Letr on when we apply quaternions to 3D rotation, this is exactly the representation we will use.

Operations

Say we have the two following quaternions.

(26)
\begin{eqnarray} q_1=a_1+b_1i+c_1j+d_1k = [a_1,\vec{v_1}]\\ q_2=a_2+b_2i+c_2j+d_2k = [a_2,\vec{v_2}]\\ \end{eqnarray}

Addition

(27)
\begin{eqnarray} q_1+q_2=(a_1+b_1i+c_1j+d_1k) + (a_2+b_2i+c_2j+d_2k)\\ =(a_1+ a_2)+(b_1 + b_2)i+(c_1 + c_2)j+(d_1 + d_2)k \end{eqnarray}

Exercise
Add $\left [ 4, \left < 10,-3,0 \right > \right ]$ and $\left [ -4, \left < 1,2,4 \right > \right ]$

Scalar Multiplication

(28)
\begin{eqnarray} tq_1=t(a_1+b_1i+c_1j+d_1k) = (ta_1+tb_1i+tc_1j+td_1k)\\ \end{eqnarray}

Exercise
Multiply $-5 \left [ -2, \left <3,5,-1 \right > \right ]$

Subtraction

(29)
\begin{eqnarray} q_1-q_2=(a_1+b_1i+c_1j+d_1k) - (a_2+b_2i+c_2j+d_2k)\\ =(a_1 - a_2)+(b_1 - b_2)i+(c_1 - c_2)j+(d_1 - d_2)k \end{eqnarray}

Exercise
Calculate $\left [ 12, \left < 4,1,-2 \right > \right ] - \left [ 1, \left < 6,-2,8 \right > \right ]$

Multiplication

In order to multiply two quaternions, we need to use the distributive property, much like we did for complex numbers.

(30)
\begin{eqnarray} q_1q_2=(a_1+b_1i+c_1j+d_1k) \cdot (a_2+b_2i+c_2j+d_2k)\\ =(a_1a_2)+(a_1b_2)i+(a_1c_2)j+(a_1d_2)k\\ +(b_1a_2)i+(b_1b_2)i^2+(b_1c_2)ij+(b_1d_2)ik\\ +(c_1a_2)j+(c_1b_2)ji+(c_1c_2)j^2+(c_1d_2)jk\\ +(d_1a_2)k+(d_1b_2)ki+(d_1c_2)kj+(d_1d_2)k^2\\ =(a_1a_2-b_1b_2-c_1c_2-d_1d_2)\\ +(a_1b_2+b_1a_2+c_1d_2-d_1c_2)i\\ +(a_1c_2+c_1a_2+d_1b_2-b_1d_2)j\\ +(a_1d_2+d_1a_2+b_1c_2-c_1b_2)k\\ \end{eqnarray}

This can be written more compactly using the scalar/vector notation. Say $q_1=[s_1,\vec{v_1}]$ and $q_2=[s_2,\vec{v_2}]$. Then we have,

(31)
\begin{align} q_1 \cdot q_2 = [s_1s_2-\vec{v_1} \cdot \vec{v_2},s_1 \vec{v_2}+s_2\vec{v_1}+\vec{v_1} \times \vec{v_2}] \end{align}

We already know that the vector cross product is not commutative, so therefore neither is the quaternion product, that is to say, in general, $q_1q_2 \neq q_2q_1$

Exercise
Calculate the quaternion product: $\left [ 1, \left < 3,1,2 \right > \right ] \left [ 4, \left < 5,-2,3 \right > \right ]$

Conjugation

If $q=[s,\vec{v}]$, then we define the conjegate of $q$ to be $q^*=[s,-\vec{v}]$. An important property of conjugates is that

(32)
\begin{eqnarray} qq^*=[ss-\vec{v} \cdot -\vec{v}, -s \vec{v}+s\vec{v} + \vec{v} \times \vec{v}]\\ =[ss+|\vec{v}|^2,\vec{0}]\\ =[|q|^2,\vec{0}]\\ =|q|^2 \end{eqnarray}

Exercise
Give the conjugate of $q=\left [ 2, \left < 4,5,-6 \right > \right ]$

Inverse

(33)
\begin{align} q_1^{-1}=\frac{q_1^*}{|q_1|^2} \end{align}

Notice that in the special case where our quaternion is unit length the inverse is the conjugate, that is to say for a unit quaternion, $q^{-1}=q^*$.

Exercise
Find the inverse of $q=\left [ 2, \left < 4,5,-6 \right > \right ]$

Division

Now with an inverse defined, we can define our division as,

(34)
\begin{align} \frac{q_1}{q_2}=(q_1)(q_2^{-1})=q_1 \frac{q_2^*}{|q_2|^2} \end{align}

Exercise
Compute $\frac{q_1}{q_2}$ where $q_1=\left [ 2, \left < 1,3,-1 \right > \right ]$ and $q_2=\left [ -1, \left < 2,1,-4 \right > \right ]$

Exercises

1) What is the definition of $i$?
2) Simplify $i^{203}$.
3) Plot the following numbers on one complex plane: $4$ , $2-i$ , $-5i$ , $-1+3i$
4) Add/Subtract the following

a) $(3+4i)+6i$
b) $(1-i)-(6+i)$
c) $(2+4i)+(7-4i)$

5) Multiply the following

a) $2(3-5i)$
b) $-4(6i)$
c) $(1+i)(2+4i)$
d) $(3-6i)(6+2i)$
e) $2i(3-i)$
f) $(5+6i)(5-6i)$

6) Give the conjugate of the following

a) $(8-4i)$
b) $(6+i)$
c) $2$
d) $9i$

7) Divide the following

a) $\frac{2+i}{4-2i}$
b) $\frac{5-3i}{6i}$

8) Given the quaternions $q_1=\left [ 3 , \left < 4,3,-8 \right > \right ]$ and $q_2=\left [ -1 , \left < -7,0,4 \right > \right ]$

a) Find $q_1+q_2$
b) Find $q_2+q_1$
c) Find $q_1q_2$
d) Find $q_2q_1$
e) Find $q_1^{-1}$ and $q_2^{-1}$
f) Find $|q_1|$ and $|q_2|$
g) Find $\frac{q_1}{q_2}$

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License