Imaaaginaation ✨🌈✨: why we use complex numbers

I saw a question on Reddit the other day about imaginary numbers. We know it’s the square root of -1, but how the heck is -1 particularly useful to engineers? Why does it show up everywhere? You look at the complex plane, s-plane, a+jb, and it’s…a number on 2 axes. Isn’t that simple a 2D vector? A regular Cartesian X and Y coordinate?

A ton of explanations fumble around the actual question and rather than explaining why they’re useful and find a natural fit in electronics, they’ll just say how it’s used and list a bunch of applications. They’ll say “Oh well you see it’s part of the equation for a Fourier transform.” Okay but why is it a part of the equation for the Fourier transform?

This is how we define the imaginary number. In math class you may have learned it as “i” for imaginary, but because electrical engineers already use I and i for current, we use “j” for imaJinary I guess. That’s now why even in Python and Matlab you use j for imaginary numbers. History is written by the nerds.

If we think of regular numbers as being a point on a line, complex numbers are points on a plane. Right, so again with the terminology, we don’t think of imaginary numbers as being separate or different from regular numbers. Think about a number like 10.45. Is the 45 a different number than the 10? They’re different digits but no they’re part of the same number and it’s a matter of how we write it down. So as a matter of terminology we call all numbers complex numbers, and complex numbers have a “real” and “imaginary” component.

COORDINATES

This here is a real number on a number line, just like the numbers you’re used to. It can be positive or negative, it can be an integer or a fraction, it can be rational or irrational like pi. But it doesn’t have an imaginary part.

Contrast that with a complex number. It has an imaginary part, which we as humans have decided to represent on a plane. You can have a number that is purely imaginary, purely real, or both, and all can be represented on the complex plane. You can have complex negative numbers, complex fractions, complex irrational numbers, but it’s all complex.

You might look at this and think hey wait a minute isn’t this just…an X and Y coordinate system? This is just a 2D plot, it’s just vectors, why is this special? Well because squaring the Y coordinate rotates it around. It has a real part and imaginary part and it’s represented as though it were a vector, but the algebra is different. When you add two complex numbers, it’s the same as regular numbers, but multiplication is different.

And what happens if we repeatedly multiply by j?

Exponents are repeated multiplication, but unlike regular exponents where increasing the exponent makes it go higher and higher, increasing the exponent on an imaginary number makes it…rotate. Periodically. Imaginary numbers give us rotation on their own, no additional operators or functions needed. We’ve just circled back around.

But it took 4 steps to circle back around. Meanwhile you can multiply -1 by itself and you circle back around…in 2 steps. See what I mean? It’s not that the imaginary unit j is the square root of -1, it’s that -1 is j squared, and so it circles around twice as fast. All numbers are complex, including -1. Here I’ve even graphed it.

Taking a number to an imaginary exponent also gives us rotation, which we’ll prove later without Euler’s formula using the unit circle/Pythagorean theorem.

DIFF-EE -QUEUES

The reason they rose out in circuits is that we represent systems as differential equations, and they arise as solutions to those equations. If you’re studying calc 2, you probably haven’t run into differential equations (it’s the reason why you’re studying calc, you study calc to get to differential equations), but DE is where you turn calculus into algebra. You treat the second derivative like it’s x2, you treat equations like algebraic equations. Thus, you can solve them just like algebra.

We might have a differential equation that looks like this:

You can factor that “r” equation and the factors become the solution to the differential equation.

If none of that made sense, don’t worry, you only need to understand that this is an important topic and that is has uses everywhere in science. Just remember that even with higher level math, you have to *factor* equations like you did back in 8th grade, and like we showed before, because some numbers require imaginary numbers to multiply together to get them, the factors for these differential equations might require imaginary numbers.

Circuit analysis is based heavily on this, since inductors and capacitors are inherently differential equations. Rather than a simple direct relationship between voltage and current like resistors have, the time-domain equations for capacitors and inductors are below.

Because e^x is its own derivative, and sin/cos are their own second derivative, a linear differential equation’s solution reduces to those, and we solve it by finding its roots. The differential equations we happen to work with in EE (which come from the physics of capacitance and inductance) have solutions that require imaginary numbers, and by Euler’s formula it allows us to represent the e^x and the sinusoids all with the same form.

SQUARED CIRCLE

The most important equation to factor is the equation x^2+y^2=1. Do you recognize this equation? If we replace x and y with cos and sin, it’s a unit circle!

This is historically why and how they really came into use, complex numbers were most prominently used in a practical setting in Maxwell’s groundbreaking treatise on electromagnetism and he extensively used complex numbers for electromagnetic waves, and then again more efficiently by Oliver Heaviside to unify Maxwell’s equations with circuit theory.

How do we “factor” the equation for a circle?? You might remember the equation (a+b)(a-b) from algebra. Let’s follow along that but twist it.

Those numbers a+jb and a-jb are a pair known as “complex conjugates”, very important. So this means that the solution to the equation that defines circles necessarily uses complex numbers. Let’s take this into the domain of Euler’s formula. You may have already seen the proof using Taylor series but I honestly really dislike that. It’s a great proof, but it’s not a good way to teach it, it feels very Deus Ex Machina-ey. So follow along with this.

100 PROOF: EULER’S FORMULA

I mentioned earlier that you could prove Euler’s formula with just the unit circle. It happens quick, so read through it a couple times carefully, it’s disarmingly simple.

We know this from trigonometry. This is the Pythagorean theorem in trig form.

We then set up this equation, with no idea where it will lead to.

We’ve done nothing unique here. I have no idea what “e to the j theta” even means, but when you multiply exponents, you add them up, and here they canceled out to 0 which as an exponent always means 1. Nothing we didn’t cover in pre-calc. Let’s put it together.

There it is. Euler’s formula. We never touched calculus or differential equations or Taylor approximations. In fact — and this is what I love about it — we never even had to define what “taking e to the j theta” even means. We took basic fundamental ideas about exponents and triangles and complex numbers and naturally combined them with the simple Pythagorean theorem, the basic equation for distance.

Circles, rotations, periodicity, differential equations, all things that naturally arise in science and nature, all things that require complex numbers. This is why complex numbers are everywhere in our studies.

Here I wanted to show you why complex numbers show up, but I’m next going to dive deeper into the whole “differential equations” thing and show how complex numbers are actually used, visual aids to the s-plane and complex transfer functions and such.

To supplement this, I would highly recommend watching this video to visualize the geometry of complex numbers: https://youtu.be/2nuvHu6D-lA

AUTHOR’S NOTE

I really only think that complex numbers seem “made up” and “imaginary” because we don’t consciously encounter them everyday in a familiar way.

Literally all numbers are made up. The concept of zero was nonsense because back then numbers were only used to count things that you had in hand. Zero and negative numbers came to represent things you don’t have or could have or someone else has from you. In this way, imaginary numbers are a great way to represent inflation or to connect currency from two wildly different times/places. A bag of rice is a bag of rice whether it’s in 15th century Tehran or 21st century Mexico City. Why can’t we represent the monetary difference between them as a change in magnitude *and* phase in that complex plane? Two very very different geographical regions, historical times, polities, and everything. But rice is rice.

What about showing how the housing market goes up and down in cycles? Or about how prosperity in one place makes another place worse, but then how they cycle back and forth.

Imaginary/complex numbers let us relate things that are “same same but different”. Maybe one day they’ll be as second nature as fractions.

2 thoughts on “Imaaaginaation ✨🌈✨: why we use complex numbers

Leave a comment