Understanding Euler’s Formula
Leonhard Euler is commonly regarded, and rightfully so, as one of greatest mathematicians of all time. The list of theorems, equations, constants, etc. named after him is unmatched. There are so many mathematical topics named after him that if I were refer to Euler’s formula, I would have to specify which one. For now let’s consider one particular identity of his*, namely:
*As it turns out Euler’s identity was most likely discovered by an earlier mathematician, Rodger Coats, who died while Euler was still a boy. Don’t let this deceive though, Euler still had plenty of math to contribute to this and many other topics.
Veteran mathematicians and fledgling calculus students alike gawk at Euler’s identity. It has been described as “the most beautiful equation in mathematics,” and for good reason. It relates the 5 most fundamental constants of mathematics:
- π — pi
- e — Euler’s number
- i — Imaginary Unit (Square root of -1)
- 1 — One (Unity)
- 0 — Zero (Nothing)
While this equation is certainly beautiful, or at least significant, it is only one case of a more general formula:
To me, this is much more interesting than Euler’s identity. It manages to relate exponentiation, complex exponentiation in fact, to the trigonometric functions. And as a result, this equation serves as a bridge between several topics relating to complex numbers including: complex logarithms, complex numbers in polar form, complex/imaginary angles, and so on. I go into more detail on the application of Euler's formula in another post.
But how does one arrive at such a magnificent (if not a bit intimidating) formula? What does a number to the power of an imaginary number even mean? Can we really say these two expressions equal each other?
In this article I will attempt to show how to get to Euler’s formula assuming you know three things:
- What an imaginary number is (i = √-1)
- A very basic idea of differentiation, i.e. you know what a derivative is (this is really all the calculus you’ll need).
- And what a factorial is, e.g. 5 factorial is written as 5! and equals 5*4*3*2*1=120.
There are a few sub-points, or lemmas, to explain before we finally put them all together and prove Euler’s Formula. If you already happen to know a certain lemma then you can of course skip over it.
Lemma 1: The Powers of i are Cyclical
The first important fact we must establish is that as you raise i to the 0th, 1st, 2nd, 3rd, and so on powers, a pattern starts to emerge:
As you can see the powers repeat, or cycle, every 4th number. This makes calculating an arbitrary integer power of i simple.
To find iⁿ, just divide n by 4 and look at the remainder. If the remainder is:
- 0 then iⁿ = 1
- 1 then iⁿ = i
- 2 then iⁿ = -1
- 3 then iⁿ = -i
Put another way:
Where (n mod 4) means the remainder after n has been divided by 4. Keep in mind that this is only true when n is an integer (…-3,-2,-1,0,1,2,3…) and not if it is a fractional or irrational number (3/5, π, √2, etc).
**If it’s unclear why the powers of i do this, keep in mind that:
- Any number to the power of 0 is 1,
- Any number to the power of 1 is that same number,
- And i² is -1 because the definition of i is that it is √-1.
Once you know these three things the higher powers are just repeated multiplication of i.
Lemma 2: The Derivatives of Sine & Cosine
The second piece of proving Euler’s formula is knowing the derivative of the sine and cosine functions:
If you want a calculus level proof of the derivatives of sine and cosine (which uses the formal definition of a derivative) refer to the linked webpages. They are short and make use of trigonometric identities.
If we accept the derivatives of sin x and cos x we can quickly see that the derivatives of -sin x and -cos x are the same but multiplied by -1.
Notice how the pattern the derivatives make is similar to the pattern the powers of i make. Every 4th derivative the functions cycle back. So to find the nth derivative of sin x, simply calculate n mod 4. If the remainder is:
- 0 then the nth derivative is sin x
- 1 then the nth derivative is cos x
- 2 then the nth derivative is -sin x
- 3 then the nth derivative is -cos x
The derivatives of cosine are calculated in much the same way.
Another thing to note is that we can keep differentiating sin x and cos x as much as we want. A function with this property is called infinitely differentiable.
Lemma 3: The Derivative of the Exponential Function
Another interesting derivative we must keep in mind is that of the exponential function. The exponential function is eˣ where e is Euler's number. What’s special about this function is that it is the unique function whose derivative is itself:
As with sine and cosine, a formal proof of this can be found here.
Note: Some mathematicians define the exponential function as the unique function whose derivative is itself. In this case a proof is unnecessary as the very definition of the function is what we are trying to prove.
The exponential function being its own derivative has a variety consequences which make this function interesting to study, but what we are mainly interested in right now is that this function is, like sine and cosine, infinitely differentiable. No matter how many times you differentiate eˣ you always get back eˣ, i.e. the nth derivative of eˣ is eˣ.
Lemma 4: Taylor & Maclaurin Series’
This lemma is probably the most interesting of them all, and is what allows us to connect the exponential function and the two trigonometric functions later down the line.
In 1712 English mathematician Brook Taylor came up with an ingenious way to estimate any differentiable function as a polynomial:
This may seem complicated but lets break it down.
- f(x) is the function we are approximating,
- n is the degree of our polynomial.
- a is the value we are centering our approximation on. In the formula we are to take repeated derivatives of f(x) at the value a for each new term.
- the superscripts on f denote what derivative we are talking about. f’ is the 1st derivative, f’’ the 2nd derivative, and fⁿ the nth derivative.
The larger the n we choose, the more accurate our estimate. However keep in mind not all functions are infinitely differentiable (for some there is a limit to how many times you can differentiate them) so some functions can only approximated to a maximum n value.
In the example above, we are approximating the sin x function with 0 as its center (a=0), and with n=15. So this is a 15th degree Taylor polynomial.
Notice that the more terms we add (i.e. the bigger n is) the more the approximation looks like the actual function around the value a. So, one might think “What if we let n=∞?” Wouldn’t that infinite polynomial, or series, actually equal the function rather than approximate it? In 1715 James Gregory thought just that and proved that yes, it is valid to say that a function would actually equal this infinite polynomial*. Such an infinite polynomial is called a Taylor series.
*not all functions are equal to their Taylor series, but we can prove that the exponential, sine, and cosine functions are.
Before I show you the expression for this Taylor series, I would like to make one more point. Remember how we had some center point a, in which the approximation was focused around? Well if we are allowing n to go infinity it doesn’t matter what the center point is. As such we can set a=0 to make the expression simpler. If we do set a=0 then the resulting Taylor series is called a Maclaurin series:
This is a lot simpler than our original function for a Taylor polynomial and a lot more powerful as well. We can now turn an infinitely differentiable function (because this is an infinite polynomial where each term needs a higher derivative then the last) into an infinite polynomial expansion. This is a profound equation on its own, but we are going to go further and use it to derive Euler’s formula.
Lemma 5: The Maclaurin Series for the Exponential Function
Let’s apply our newfound knowledge of Maclaurin series’ to the exponential function, which we already know is infinitely differentiable:
The first step is just the definition of a Maclaurin series. The second step sets eˣ equal to f(x) and since eˣ is its own nth derivative (Lemma 3) we can plug e⁰ in for f(0), f’(0), f’’(0), and so on to arrive at the third line. By simplifying e⁰ (which equals 1) we get:
The equation above is what’s known as a power series. It’s an infinite series of terms that equals some function, in this case eˣ, with some variable whose power is increasing with each term, in this case x.
Lemma 6: The Maclaurin Series for Sine & Cosine
Now let’s do the same with sine and cosine, starting with sine:
The first step is, again, just the definition of a Maclaurin series. The second establishes the derivatives of sine (Lemma 2). Keeping in mind that they are cyclical, we can replace the function f(x) in the first line to arrive at the third line. Finally, by simplifying sin 0 (which equals 0) and cos 0 (which equals 1) we arrive at:
Deriving the power series for cosine is much the same:
By simplifying sin 0 and cos 0 we get:
Euler’s Formula: Putting it all together!
Now that we have derived the power series for sine, cosine, and the exponential function, we can see how they all fit together. Remember the powers of i? Well let’s plug it into the power series for eˣ:
Let’s break down the steps. The first line is simply the power series of eˣ (lemma 5). The second line just reminds us that we are plugging in ix in place of just x. In the fourth line we distribute the exponents to both i and x. In the fifth line we refer back to the powers of i (lemma 1) and realize they form a pattern here. Line 6 is just a cleaner way to write line 5.
Notice that what we have just done. We have adapted the exponential function’s power series to take imaginary numbers as well as real ones. And so we have found a way to define the exponentiation of numbers to imaginary powers, at least with base e. But we’re not done yet.
As you can see, our new exponential function above is a complex function, i.e. it has a real part and an imaginary part. Let’s try splitting these parts up to make it clearer:
In the line one I simply expanded our new complex exponential function to show a few more terms (the … means it’s infinite so it doesn’t matter how much of the series I actually write out). In line two, I split the function into its real and imaginary parts. In line three, I factored the i out of the imaginary part to make it look cleaner.
Hold on a second. Don’t the real and imaginary parts of this function look familiar? Well they should because:
Would you look at that! The real part of the function is the same infinite series as that of cos x and the imaginary part is the same infinite series as that of sin x. That’s it, we’ve done it!
While deriving this equation should hopefully be an enlightening exploration of the relationship between these three functions, the equation itself and its consequences are also of great importance in mathematics. I go into more detail on some applications of Euler’s formula (like complex exponentiation) in another post.
**Side Note: Summation Notation
For all the infinite series discussed in this article, we used an ellipses, i.e. a …, to denote that they go on forever following the pattern. But this is a little hand-wavy, especially for a mathematician. Sure the patterns may look unambiguous, but consider the following numbers:
What’s the next number in the pattern? Your first guess may be 6, after all these look like the multiples of two: 1,2,4,6,8,… But this pattern could easily be the powers of two instead: 1,2,4,8,16,…
As you may have guessed, there is a more formal way to handle these ellipses: summation notation.
Not only is summation notation more rigorous, it also allows us to express these infinite sums in a somewhat more manageable way. All this said, I didn’t use summation notation in the main article because I thought it was unnecessary to introduce for the content of the post and would obscure the putting together of the series near the end of the proof.