Complex Numbers

From PrattWiki
Jump to: navigation, search


In the field of Mathematics, people had to come up with some satisfactory way to deal with the problems that arose when one tried to take the square root of a negative number. Not happy with simply saying "there isn't one," the mathematicians came up with an object known as a complex number. The usefulness of this construct blossomed as engineers and physicists saw applications for what the theorists had developed. The idea is that a number n can be made up of two parts: a real part \Re\{\mathbf{n}\} and an imaginary part \Im\{\mathbf{n}\}. These parts can be plotted - much like x and y coordinates - in what is called the complex plane.

There are many ways to represent a complex number. Of these, three stand out as being particularly useful. The first is the standard or rectangular representation:

\mathbf{n} = \Re\{\mathbf{n}\} + j\Im\{\mathbf{n}\}=n_r + jn_i

where j is \sqrt{-1}. This gives all the information you need to figure out the number. Now imagine that this is a point plotted in 2D space where the real part is the x coordinate and the imaginary part is the y coordinate. You could figure out a magnitude and direction from the origin to this point and write the location in polar coordinates. The magnitude and direction would be given by:


\arctan(\Im\{\mathbf{n}\}, \Re\{\mathbf{n}\})=\arctan(n_i, n_r)

where arctan with two arguments specifies that the answer will be some angle between -\pi and \pi instead of the typical limits of -\pi/2 to \pi/2. This distinction is important because the two-argument version of arctan will give the proper angle between the positive real axis and the complex number. Calculators usually only have the one-argument version. In this case, you will use the ratio n_i/n_r as your argument, but must make sure your answer is in the proper quadrant.

Using the above, a complex number n can be represented:


At this point, you should notice that n is the hypotenuse of a right triangle with an angle of \theta_n with respect to the horizontal. This means the real and imaginary parts can be written as:

\Re\{\mathbf{n}\}=n_r=n\cos\left(\theta_n\right) ~~~~~~~~~~~

and n can be written as:


Euler Notation

In representing complex numbers, you should note the following Maclaurin Series for \cos(\theta) and \sin(\theta):

\sum_{n=0,~n\mbox{ even}}^{\infty}\frac{(-1)^{n/2}\theta^n}{n!}\\
\sum_{n=0,~n\mbox{ odd}}^{\infty}\frac{(-1)^{(n-1)/2}\theta^n}{n!}

Now for some algebraic manipulation. First, note that the (-1)^{n/2} term in the \cos series can be rewritten using the fact that (-1)^{1/2}=j:

(-1)^{n/2} = ((-1)^{1/2})^n = (j)^n

Next, in the \sin series, the (-1)^{(n-1)/2} term can be split up, noting that:


and from above, rewritten as


which means the two Maclaurin Series can be written as:

\sum_{n=0,~n\mbox{ even}}^{\infty}\frac{(j\theta)^n}{n!}\\
-j\sum_{n=0,~n\mbox{ odd}}^{\infty}\frac{(j\theta)^n}{n!}

In the latter case, multiplying both sides by j and recognizing that -j^2=1, we obtain:

\sum_{n=0,~n\mbox{ odd}}^{\infty}\frac{(j\theta)^n}{n!}

What Euler noticed was the following - one representation of e^x is a Maclaurin series of:

e^x=\frac{x^0}{0!} + \frac{x^1}{1!} + \frac{x^2}{2!} + ... &=

Simply substituting x=j\theta yields

e^{j\theta}=\frac{(j\theta)^0}{0!} + \frac{(j\theta)^1}{1!} + \frac{(j\theta)^2}{2!} + ... &=

which is the sum of the Maclaurin Series for \cos(\theta) and j\sin(\theta). In other words,

e^{j\theta} = \cos(\theta) + j\sin(\theta)

Using this, you can write a complex number as:


This gives rise to one of "The Greatest Equations Ever" (at least according to physicsweb[1]):


which combines an infinite sum (e), the imaginary number (j), an irrational ratio (the ever mysterious \pi), and unity (1) and, through an equality (=), relates them all to...nothing (0).

Addition and Subtraction

Addition and subtraction are performed component-wise and are done most easily by using the rectangular representation. Assume you have two complex numbers:

{\mathbf n}=a+jb&=ne^{j\theta_n}  
{\mathbf m}=c+jd&=me^{j\theta_m}  

and you want to add or subtract them. Adding or subtracting the components and then collecting the real parts and the imaginary parts gives:

{\mathbf n} + {\mathbf m} &= (a+c) + j(b+d)&
{\mathbf n} - {\mathbf m} &= (a-c) + j(b-d)

Multiplication and Division

Multiplication and division are a little more difficult. The best notation to use is the Euler one. To multiply the two numbers given in the section above:

{\mathbf o}&={\mathbf n} {\mathbf m}=ne^{j\theta_n}~me^{j\theta_m}\\
{\mathbf o}&=nme^{j(\theta_n+\theta_m)}=

You can then get the rectangular representation of this by converting from the Euler representation writing:


Another way to do multiplication is by using the rectangular representation and FOILing:

{\mathbf o}&={\mathbf n} {\mathbf m}=(a+jb)(c+jd)\\
{\mathbf o}&=ac+jad+jbc+j^2bd\\
{\mathbf o}&=(ac-bd)+j(ad+bc)=\Re\{{\mathbf o\}}+j\Im \{{\mathbf o\}}

Division is easiest using the Euler representation:

{\mathbf p}&=\frac{{\mathbf n}}{{\mathbf m}}=
{\mathbf p}&=

Division using the rectangular representation is a little more difficult. You have to use the complex conjugate of the denominator to get rid of any j's on the bottom. The complex conjugate of a number is the number with the sign on its imaginary part switched. It is also the number with the sign on its angle switched. The complex conjugate is represented by a superscript *. For example, {\mathbf n}^* is:

{\mathbf n}^*=a-jb&=n\angle-\theta_n=ne^{-j\theta_n}

Note that a number multiplied by its own complex conjugate will give the magnitude of that number squared. The following shows this using all three notations:

{\mathbf n}{\mathbf n}^*&=(a+jb)(a-jb)=a^2+b^2=n^2\\
{\mathbf n}{\mathbf n}^*&=(n\angle\theta_n)(n\angle-\theta_n)=n^2\angle 0=n^2\\
{\mathbf n}{\mathbf n}^*&=

Division thus proceeds as follows:

{\mathbf p}=\frac{{\mathbf n}}{{\mathbf m}}=
\frac{{\mathbf n}}{{\mathbf m}}  \frac{{\mathbf m}^*}{{\mathbf m}^*}&=
&= \frac{(ac+bd)+j(-ad+bc)}{c^2+d^2}\\
&=\Re\{{\mathbf p\}}+j\Im\{{\mathbf p\}}

Elongation / Contraction

Sometimes, you will only need to change the magnitude of a complex number. This is the same as only changing the length and not the direction of a vector. Multiplication by a scalar only changes the magnitude. A scalar is not a complex number because it does not have an angle associated with it. The complex equivalent of a scalar is a number having an angle of 0 radians. Multiplication by a scalar is simple. Assume that s is a scalar,

{\mathbf t}=s{\mathbf n}=sa+jsb=sn\angle\theta_n=


You may also simply want to rotate a complex number around the origin. For example, once you find the first rth root of a number you really only need to rotate it around \frac{2\pi}{r}\,\! to get the next root. This is done by multiplying by a complex number of unit magnitude with some angle. Assume you want to rotate {\mathbf n} by an angle \theta_i radians counterclockwise around the origin:

{\mathbf u}=\left(1\angle\theta_i\right)

You can also multiply by the rectangular representation of the angle

{\mathbf u}&=\left(\cos\left(\theta_i\right)+j\sin\left(\theta_i\right)\right)
&=\Re\{{\mathbf u\}}+j\Im\{{\mathbf u\}}

From this, you should recognize that multiplication by j, which is also 1\angle90^{\circ}, is the same as a counterclockwise rotation of 90^{\circ}

Integer Powers

Integer powers of complex numbers are best taken using Euler notation:

{\mathbf v}&={\mathbf n}^p=\left(ne^{j\theta_n}\right)^p=n^pe^{jp\theta_n}

This represents both a change in length (from n to n^{p}) and a change in direction (from \theta_n to p\theta_n).

Integer Roots

Roots of complex numbers are also best taken using Euler notation. To take the rth root of a number:

{\mathbf n}^{\frac{1}{r}}=\left(ne^{j\theta_n}\right)^{\frac{1}{r}}=

In other words, the magnitude of the root is equal to the root of the original magnitude, and the direction of the root is equal to the direction of the original number divided by whatever root you are taking. This is the primary root.

Note that using the Euler notation, any number can be represented in an infinite number of ways simply by adding multiples of 2\pi to the angle. This is the same as going around a complete circle and ending up where you started. In the above root:

{\mathbf n}^{\frac{1}{r}}=\left(ne^{j\theta_n+j2\pi}\right)^{\frac{1}{r}}

This gives another, equally valid root of the number. In fact, any number other than {\mathbf 0} has r rth roots. These roots will be evenly divided across the full range of 2\pi. They will all have the same magnitude. You can draw a circle with a radius of the rth root of n and it will pass through all r roots of {\mathbf n}.

Example 1

Find all the cube roots of 1+j0. Since the magnitude of this number is 1 and the direction is 0, the first cube root has a magnitude of 1^{\frac{1}{3}}=1 and a direction of 0/3=0. Since the roots are equally spaced, they will be \frac{2\pi}{3}\,\! apart, meaning:

\left(1+j0\right)^{\frac{1}{3}} &=1e^{j0}=\cos 0 + j\sin 0 = 1\\
\left(1+j0\right)^{\frac{1}{3}} &=1e^{j\frac{2}{3}\pi}=
\cos \frac{2}{3}\pi+j\sin \frac{2}{3}\pi= -0.5+j0.866\\
\left(1+j0\right)^{\frac{1}{3}} &=1e^{j\frac{4}{3}\pi}=
\cos \frac{4}{3}\pi+j\sin \frac{4}{3}\pi= -0.5-j0.886

Example 2


Find all the fifth roots of {\mathbf n}=8-j6.

First, find the magnitude and direction:

n = \sqrt{8^2+6^2}&=10\\

The magnitude and direction of the primary root {\mathbf q_1} will therefore be:

q_1 = (10)^{\frac{1}{5}} &= 1.585 &
\theta_{q_1}&=\frac{-0.64350~\mbox{rad}}{5} = -0.1287~\mbox{rad}

In its rectangular representation, this is:

{\mathbf q_1} = 1.585\cos\left(-0.1287~\mbox{rad}\right)+

The next four roots will be evenly spaced around the complex plane, so they will be \frac{2\pi}{5}\,\! apart and have directions of:

\theta_{q_2}&=\theta_{q_1}+1*\frac{2\pi}{5}=1.128~\mbox{rad} &
\theta_{q_4}&=\theta_{q_1}+3*\frac{2\pi}{5}=3.641~\mbox{rad} &

By converting from Euler to rectangular notation, you can find:

{\mathbf q_2}&=0.679+j1.432\\ 
{\mathbf q_3}&=-1.152+j1.088\\
{\mathbf q_4}&=-1.391-j0.759\\
{\mathbf q_5}&=0.292-j1.558

These are shown in the figure at right.

Non-integer Powers

Non-integer powers and roots are more complicated. If you are only looking for the primary power for any arbitrary scalar a then you can simply calculate:

{\mathbf q_p}=\left({\mathbf n}\right)^a=\left(ne^{j\theta_n}\right)^a

For rational powers (powers that can be represented by a fraction), you can first raise the complex number to the numerator and then take roots from the denominator. That is:

{\mathbf q_r}={\mathbf n}^{\left(\frac{t}{b}\right)}=

Parting Thoughts

Decide early on a notation you like for complex numbers. Some possibilities are:

{\mathbf N}~~~~~~~~\tilde{N}~~~~~~~~\mathbb{N}  ~~~~~~~~\underline{N}

For example, using complex variables to give Ohm's Law might look like:


Make sure you know how your angles are represented (degrees or radians). If someone asks you "What is the cosine of 45," you need to start getting the the habit of asking "radians or degrees?" even though it may seem obvious. Also, if someone says "the frequency is ten," you need to always ask "in Hertz or radians per second?"

Complex numbers are at the heart of many powerful tools in engineering. You need to be comfortable with how complex numbers work and what they represent in order to truly understand how those tools work and to fully comprehend their usefulness. Complex numbers are not that difficult once you have practiced with them a little bit, and the time spent learning about them will pay great dividends in the future.

Class Document Protection
  1. Physics Web, accessed October 12, 2006