DecayWTF
@DecayWTF

They should teach complex math around about the same time exponentials and square roots are introduced in elementary school.

Okay I guess I'm pinning this. It is now the table of contents for my new textbook, Complex Math For The Little Queer People Who Live In My Computer


DecayWTF
@DecayWTF

Beware: This is a very basic intro to complex math. A lot of it is just intuitive and not incredibly rigorous, so if you come into my comments to complain that I didn't explain the Cayley-Dickson construction and that's not how we derive complex numbers or whatever, I'm going to laugh at you and shove you in a locker. Anyway!

In school, we learn various number systems. Until you start doing higher math, it's not usually broken down like this, but it's pretty straightforward:

  • Natural numbers, ℕ (the blackboard bold letter is just a shorthand name for each particular set of numbers): The basic counting numbers we learn in elementary school. 0, 1, 2, etc. Sometimes we talk about whole numbers (counting numbers excluding zero) as a discrete set too.
  • Integers, ℤ (the Z is from German because mathematicians are like that): The natural numbers plus all the negative numbers.
  • Rational numbers, ℚ (the Q stands for quotient and is also the giant letter on the NyQuil bottle): All the numbers you can create by dividing one integer by another non-zero integer. 3/4, 2/7, -12/5, that sort of thing.
  • Real numbers, ℝ (they couldn't justify using something more confusing I guess): This is where it gets slippery. Roughly, this is the set of all numbers you could, in principle, given infinite space and time, represent as something.something else, decimals. The tricky part here is that every finite or repeating decimal is also a rational; no matter how long it is, if it is finite or repeating, it can be represented as a ratio of two (maybe very large) integers. The numbers in the reals that really can't be represented that way are called irrational numbers; they have an infinitely long and non-repeating fractional part. The irrational number most people are familiar with (mostly because it's unavoidable in a lot of math and pop-math guys have an infinitely long, non-repeating hardon for it) is pi, the ratio of the length of a semicircle to its radius.

Now, the thing laying these out like this shows is that each set contains the last one: The reals contain all the rationals, the rationals contain all the integers (they're rationals of the form x/1), and the integers contain all the natural numbers. So this brings us to a question:

What contains the reals? Is there anything "above" them?


DecayWTF
@DecayWTF

So in the first post I talked about the basic properties of complex numbers, how addition and multiplication work, and how they relate in a basic sense to vectors. For a second post, I wanted to talk about some of the more interesting parts of complex arithmetic, especially how division works, and another way of representing complex numbers that makes handling them as vectors much more convenient for certain applications.


DecayWTF
@DecayWTF

Before we move on to the really hard stuff, we need to get through some more algebra.


DecayWTF
@DecayWTF

Things are about to get

BULBOUS

Okay so, so far we've talked about all of your basic arithmetic, how complex multiplication and division map to trig, and how to expose that using the polar form of complex numbers. We know how to solve polynomials with complex variables or coefficients. Looks like we're moving pretty fast!

Now what if I want to do this:

y=xi

Uh oh. And now we're back to asking what the fuck that even means.


Let's take a step back and think about this. In the natural numbers, we have this idea of exponentiation as iterated multiplication:

x=53=555=125

And that's all fine and cool. To extend that to the integers, we determine that negative exponents mean it's the reciprocal:

x=53=1125

(And anything^0 is 1 but that's only extremely important so I'm gonna gloss over it)

Rationals are also pretty straightforward. The numerator of a fractional exponent is just the exponent, and the denominator is an nth root:

x=532=53=125=525=55

Once again, it's when we get to the reals that things get weird and slippery. What does 5π mean? Numerically, it's probably close to 522/7 (22/7 being a famously accurate simple approximation to pi), but that's not really satisfactory.

One way is to look at it is through continuity, employing some calculus tools. Since we know we can get closer and closer approximations:

53=12553.1=53110146.82753.14=5314100156.59153.142=531421000157.096

We could take the limit of 5x as x approaches pi over rational values... But that kinda sucks and doesn't give us a lot of insight as to what's actually happening here. Let's try looking at it from a different angle.

Exponentiation has an inverse function, the logarithm. The logarithm to the base n of x is the number n would have to be raised to to get x:

y=xnlogxy=n53=125log5125=3

We also have a concept of the exponential function, which is specifically ex:

exp(x)=ex

and its inverse, the natural logarithm. The natural logarithm of x (often denoted ln(x) or sometimes just log(x), especially in pure math contexts) is the power to which e would have to be raised to equal x:

y=exlny=logeylny=x

"Hold on! What's all this bullshit about e? What the fuck is e?" you ask, calmly. Wow, my rhetorical audience is wound up as tight as I am, weird. Anyway, e is a transcendental number approximately equal to 2.71828 called Euler's number. It has a lot of really interesting properties and is of equal stature in terms of Numbers That Are Important to π, but what we're really interested in is a couple of things that let us break the circular reasoning around real exponentiation and shed a bit of light on what is actually happening here.

More about e if you're really interested and/or bored

So, e is called Euler's Number but Leonhard Euler didn't actually discover it, and its discovery had basically nothing to do with the rigamarole we're talking about here. Jacob Bernoulli introduced it in 1683 as a limit he discovered while studying a question about compound interest:

Say you have an account with $1.00 in that pays 100% interest per year. If the interest is calculated once at the end of the year, the account will end up with $2.00 in it. If it's calculated twice, say every six months, the rate each time will be 50% and the account will end up with $1.00*1.5*1.5 = $2.25. Three times will give a ~33% interest rate per time which will give $1.00*(4/3)3 = $2.37, quarterly (four times) will give $2.44, and so on. This gives a general formula for the total value after compounding x times in a year like f(x)=(1+1x)x. What is the result if interest using this formula is compounded continuously? Expressed as mathematical notation, what is the value of:

limn(1+1n)n

It turns out that limit is e! e appeared in other contexts and was studied by other mathematicians like Gottfried Leibniz, and its relationship with exponentials and logarithms was gradually discovered (along with the relationship between exponents and logarithms, which was not understood in the early years of the development and study of logarithms!) throughout the late 17th and early 18th centuries. e was eventually given a full treatment in 1748, under its modern name, in the mathematical text Introductio in Analysin infinitorum written by, you guessed it, Leonhard Euler. Among other things, Euler developed the power series expansion of e that we're about to talk about, along with a calculation of e to 18 decimal places, e = 2.718281828459045235.

Now, there are many equivalent ways of defining e, but what we're interested in right now is what will let us relate it to some kind of exponentiation that we know how to do. One really convenient definition, then, is the following infinite sum (sorry, there's gonna be calculus from here on out, at least a little):

e=n=01n!=1+1+12!+13!+14!+

With some extra rigamarole that I won't go into here (but you can look it up, Wikipedia has multiple big pages on the exponential function and there's a hundred other places out there as well) we find that the following generalization holds:

ex=n=0xnn!=1+x+x22!+x33!+x44!+

This is helpful! With just integer exponents that we already understand how to do, we can use methods of calculus to evaluate this series to get ex for any value of x, to some satisfactory level of precision. Next, we can employ some log rules, especially the basic one that says that the natural logarithm and the exponential function are inverse functions, or in other words:

eln(x)=x

This means that eln x is an equivalent representation for any value x. I'm not going to go into the derivation of the natural log function but it can be derived from the power series representation of the exponential function with some more calculus fuckery. Anyway! If we want to raise that to some power n:

xn=(eln(x))n=enln(x)

Okay, cool, good, we have a way of talking about exponentiation of any number in terms of the exponential function alone, and that means our neat little generalization of the exponential function power series gives us all the tools we need to talk about any kind of exponentiation.

Okay, so, all that being the case, how does that help us think about complex exponentiation? Well, before we try dealing with a completely general x raised to some complex number, let's start easy, we're going to try to figure out what ei is. Let's start by looking at our power series to see what's going on:

ei=n=0inn!=1+i+i22!+i33!+i44!+i55!+=1+i12i3!+14!+i5!+=(112!+14!)+(113!+15!)i+

Let's look at a graph of this, taking two terms, four terms, and six terms (or one, two and three complex terms):

Huh. The difference is getting smaller each time we add a complex term, and it looks like we're zeroing in on some point on the complex plane. It looks like we're getting two probably convergent series for the real and complex coefficients that look like this:

z=eiRe(z)=112!+14!16!+18!=n=0(1)n(2n)!Im(z)=113!+15!17!+19!=n=0(1)n(2n+1)!

Oh god, calculus and trig

I'm not gonna sugarcoat it: These are the Taylor series expansions for cosine and sine, specifically for cos(1) and sin(1):

cos(x)=n=0(1)n(2n)!x2n=1x22!+x44!cos(1)=n=0(1)n(2n)!12n=1122!+144!=n=0(1)n(2n)!=112!+14!sin(x)=n=0(1)n(2n+1)!x2n+1=xx33!+x55!sin(1)=n=0(1)n(2n+1)!12n+1=1133!+155!=n=0(1)n(2n+1)!=113!+15!

Not going into it but these are well known identities. If you want to know more, Lamar University has really good Calc II stuff online including a whole chapter on power series expansions, Taylor series, Maclaurin series, etc.

Okay, it's safe

ei=cos(1)+isin(1)

What? What the hell? What the fuck?

Hold on, let's try that again! We'll give it an angle in radians this time, π. Come on, man, don't do this to me:

z=eiπ=n=0(iπ)nn!=1+iπ+(iπ)22!+(iπ)33!+(iπ)44!+(iπ)55!+=1+(iπ)π22iπ33!+π44!+iπ55!+=(1π22!+π44!)+(ππ33!+π55!)i+Re(z)=1π22!+π44!π66!+π88!=n=0(1)n(2n)!π2nIm(z)=ππ33!+π55!π77!+π99!=n=0(1)n(2n+1)!π2n+1z=cos(π)+isin(π)=1+i0=1

Oh for fuck's sake.

Critics rave about exi=cos(x)+isin(x)! Benjamin Pierce at Harvard University writes, "we cannot understand it, and we don't know what it means, but we have proved it, and therefore we know it must be the truth." Richard Feynman, famous bongo player, calls it, "our jewel." Decay from the Internet says, "it never fails to piss me off."

Actually, what Pierce and Feynman were talking about was Euler's Identity:

eiπ+1=0

If you've followed this far, it should be obvious that's just a reformulation of the e that we just did, minus any attempt at explaining what the hell is going on. Hey wait, that trig formulation of e looks familiar...

a+bi = r cos θ+ ir sin θ = r(cos θ+ i sin θ)

That's our polar form! Which means...

z = r(cos θ+ i sin θ) = reiθ

Hooray! We now have a deeply upsetting understanding of complex exponentiation: It's rotation in the complex plane! And re is exactly equivalent to the cos/sin polar form we learned a couple chapters ago! This sucks!

Here, take a minute, go drink some water or your favorite energy drink or shoot up or whatever you need to relax and come back.

Alright, so we've figured out how exponentiation with imaginary exponents works. Now what? Well, first, we pat ourselves on the back: We did it! We figured out how exponentiation with imaginary exponents should work, in a way that, as annoying and nonintuitive as it is, kinda makes sense. Think back to what we discovered about complex multiplication: Complex multiplication is scaling and rotation. If we understand exponentation as "What if multiplication, but too much?" it should be reassuring that complex exponentiation kind of behaves in a way that matches complex multiplication. Not only that, we just demonstrated a really important and kinda tricky concept in mathematical analysis, called analytic continuation.

A lot of mathematical functions have limited domains. Some are only defined to work on certain sets of numbers; a good example is the factorial function, x!, which is defined as multiplying all the positive integers up to x. In other words:

5!=12345=12010!=12345678910=3628800x!=n=1xn

(That big pi symbol is just the symbol for a product series. That says "count up everything from 1 to x and multiply it all together".)

Factorials show up a lot; we saw some in our Taylor series up above. But what would we do if we wanted to calculate, say, 3.5!?

Well, there's no conventional way to do that, but we could employ the same method we used up there to figure out how to extend exponentiation to imaginary and complex numbers to try to find a function that extends the domain of the factorial function to other numbers. In fact, there's a function called the gamma function that was derived to do just that, it extends the domain of the factorial function to every complex value other than zero and the negative integers. The gamma function, then, is an analytic continuation of the factorial function to those values. The imaginary exponentiation we figured out is one way to derive the analytic continuation of exponentiation to the whole complex plane. In mathematical terms, we were able to extend the domain of the exponential function from ℝ to ℂ, just as the gamma function extends the domain of the factorial function.

As we see with the gamma function, sometimes - often, really - analytic continuations don't or can't extend a function to the entire complex plane. Division is a simple one, no matter what you do in conventional math there's no good way to define division by zero as meaningful. For example, the function f(x)=1x has what we call a simple pole at x = 0; it goes to infinity and there's no way to fix that. The gamma function has simple poles at zero and at every negative integer because the function diverges in the same kind of way at those values. Even so, analytic continuation is an incredibly powerful technique that comes up a lot in complex analysis.


You must log in to comment.

in reply to @DecayWTF's post:

100% agreed!

My biggest problem with really understanding math was always that it looked like there were connections, but nobody was ever able to show me those connections, and I didn't know where to look for more information, and I wasn't quite able to suss all of them out myself. My high school calculus teacher saw that and helped as much as he could, but he was an over-worked teacher with a new baby, so time was limited.

In college, though. Oh man. I had plenty of resources to learn about those connections and explore what they meant. I know not everyone wants to see how things fit together in a wider view (it might be overwhelming), but it sure helps me.

So the only quibble I have with this (though I maybe should save it to go over it again) is the "we get to reals from rationals with roots that yield irrationals" step.

Because, of course, that's not how we get there, the way that the rationals are just the quotient field of the integers.

Adding in all the roots only gets us to the algebraic numbers, but not to something transcendental like π. (or one of the non-algebraic solutions that occasionally happen with quintic equations)

I think that at this point you don't want to introduce algebraic numbers, so what I'd suggest is pausing at the rationals, pointing out that there was a cult in ancient Greece that was very into the idea that the rationals were all the numbers there could ever be, and that this cult had a serious crisis of faith around the square root of two (predicted by the Pythagorean theorem) resulting murder of the little git who first pointed this out.

So from this, clearly there are things that are somehow "in between" rational numbers in a way that hurts the head to think about too much, and we go from rationals to reals by declaring the reals to be "the rationals and everything that could possibly be in-between" with an optional link off to a formal explanation of Dedekind cuts.

I also think it'd be good to accompany your explanation of expanding one's view of numbers with a mention of what you lose as you expand your view of numbers.

In going from the naturals to the integers, you lose the idea that a+b ≥ a for all a. With that, you also lose the idea of easy induction proofs parameterized by something. You lose the ability to explain a number easily by pointing to a basket and saying "the number of apples in this basket is the number"; in a way you lose the tight connection to counting that you had since pre-school and before.

In going from the integers to the rationals, you lose the idea that there's always a "next largest" number. You can't count by rationals and know where it's going to go as anyone knows who's ever had a parent "count to 3" by going "1, 2, 2-and-a-half, 2-and-three-quarters, 2-point-9, 2-point-99", etc.

In going from the rationals to the reals what you lose is the idea that you will always be able to write your number down without inventing bespoke symbols just for that number. This is related to the fact that you've lost countability, though an explanation of countable and uncountable sets is obviously beyond the scope. However, I think it's reasonable to say that there are so many real numbers - so many more than rational - that any system for writing them down that is limited to finite space will leave the vast majority as simply unrepresentable. Uncountability is weird and big and the sort of thing I'd expect Lovecraft to write about.

When going from real to the complex, obviously you lose the idea that z*z ≥ 0 for all z, but more than that you lose the idea that "≥" means anything important at all. Oh, sure, you can establish some total ordering on the complex numbers (e.g. lexicographic ordering), but there's no way to make the function "f(x) = x ≥ 3" discontinuous only at 3. There's no way to say "this number a is in-between these other two numbers b and c, and therefore if something moves continuously from b to c it must pass through a".

(this sets students up for the shock that when going from complex numbers to quaternions you lose commutativity for multiplication, but that's probably at least high-school level)

As I noted at the top, this was just an intuitive explanation and I explicitly did not go into fussier details like the difference between irrational roots and transcendentals or other ways of constructing irrationals, since real numbers are fussy and slippery and I was just trying to introduce the idea of each larger set containing the previous. Especially when you get into countability and ordering, that pulls in a lot of other complex (so to speak) ideas and I was trying to stay relatively focused without having to get into cardinalities of sets or notions of continuity.

Yeah, countability pulls in the monsters. I can understand why you'd want to stay away. I might still handwave that "there's other stuff here for later", and who doesn't love a good ancient-cult murder story?

I do think it's possible to mention that with complex numbers you no longer have the same sort of idea of "in between" that you do with real numbers; like when you go from -3 to 3 in the reals you have to go through 0, there's no way around it. (e.g., you can talk about how normally when going from frozen ice to water you have to go through that temperature in the middle where water melts; there's no way around it) However, complex numbers introduce another thing and suddenly it is possible to go from -3 to 3 without ever touching 0.

Sure. There's a lot to talk about, I just wasn't sure what other things I would want to touch on in such a very basic introduction. I'd be more likely to talk about conjugates and division first and maybe point out the lack of ordering as a small note or as a point when going over numbers in polar form.

Ok, this was cool as hell to see complex numbers tied in with vectors. I'd done math with i before and even vaguely understood quaternions once, but the explanation with vectors made it more intuitive somehow. I still need to brush up on my basic trig some but really great explanation of imaginary numbers. "Oh fuck off" is a great reaction to trying to figure out the square root of -1 lmao

Can I just say, as someone with a brain that is capable of understanding, but withheld by other problems (Dopamine-Addicted Brain Goblins!), this is the first time I've ever had even a remote understanding of what the hell irrational numbers even are, let alone complex and imaginary numbers and then seamlessly expanding upon how they're cool, why they're cool, and that they're actually super useful, which is mind-boggling in and of itself, while also providing visual examples and real reactions and observations - IT WAS ROTATING AND SCALING- ...

I suppose I'm maybe exactly the kind of person this post was for. I soaked this right up. Thank you. :3

hey, I'm glad this is working out for you! I really love complex analysis but I'm all self taught so part of the impetus of this has been "write a teaching thingy to help myself get better at it" and to pass on a really interesting and useful section of math that gets kind of unfairly treated as useless and obscure a lot of the time...

in reply to @DecayWTF's post:

Oh it's actually become great bordering on untouchable (at least for dedicated charting tools) in terms of power and quality of output. It even integrates very nicely with LaTeX now so you can typeset really nice looking labels, it's just... gnuplot