Euler's Formula 2 - Going in Circles

Euler's Formula (2 of 2)

So let’s start from the other side of Euler’s formula, the part that is about circles, and go through the whole shebang in the opposite direction from the very basics.

When measuring distances travelled around the circumference of a unit circle we define the number \pi to be the length of half a circumference, so the length of the circumference of a unit circle is 2\pi. Travelling around a unit circle, distances are equivalent to angles. By convention we always begin measuring the angle from the horizontal axis and moving in the anticlockwise direction. In the diagram from last time the angle \theta happens to be \pi/6, the same as 30^\circ.

If you’re wondering why we only measure the distance halfway around the unit circle and make that the unit of angle, you ain’t the first. It was an arbitrary choice, and \pi was originally defined as the ratio between the circumference and the diameter, and a unit circle has a diameter of 2, so \pi only gets you halfway. As a result we are doomed to say 2\pi in a lot of formulae.

Sine and Cosine

Given an angle, it is surely possible to compute the (x, y) coordinates of the corresponding point on the circumference of the unit circle. There must exist a pair of functions that give these coordinates, and they are:

  • \sin \theta (“sine”) gives the vertical or y coordinate, and
  • \cos \theta (“cosine”) gives the horizontal or x coordinate.

Without knowing anything else about these functions, we can already see that as an object progresses around the circle, its coordinates must visit these milestones:

  • We begin at \theta = 0, the right-most point of the circle, where \sin \theta = 0 and \cos \theta = 1.
  • At \theta = \pi/2 (90^\circ), the top of the circle, the situation has reversed: \sin \theta = 1 and \cos \theta = 0.
  • At \theta = \pi (180^\circ), the left-most point of the circle, \sin \theta = 0 and \cos \theta = -1.
  • At \theta = 3\pi/2 (270^\circ), the bottom of the circle, \sin \theta = -1 and \cos \theta = 0.

We can plot \sin \theta by itself between the values 0 and 2\pi (actually I started a little bit before 0 so you can see how it repeats), and likewise \cos \theta.

TikZ diagram
TikZ diagram

We can see that \cos is just \sin slid along to the left by a quarter of a cycle, so it “runs ahead” of \sin:

\cos \theta = \sin (\theta + \pi/2)

If we advanced \sin by \pi, half a cycle, the peaks and valleys would change places, while the uphill slopes that cut through the horizontal axis would become downhill slopes and vice versa. In other words, it would look exactly like we’d flipped the \sin function upside down:

TikZ diagram

So:

-\sin \theta = \cos (\theta + \pi/2) = \sin (\theta + \pi)

Incidentally, the word cycle is from the Greek word for circle. The word phase is also used a lot in this context, probably deriving from the phases of the moon. When one periodic function is equal to another shifted by some amount, we say there is only a phase difference between them.

Differential Calculus on Sine and Cosine

It’s interesting how much we can figure out intuitively before we even have a way of computing these functions. Here I’m going to assume we know that velocity is the rate of change of displacement.

Think of an object moving along the unit circle’s edge at a constant rate, one unit of distance per unit of time, so its velocity vector is a unit vector, just like its displacement vector. At any instant that velocity vector, \vec{v}, is pointing along the tangent, but this is always at a right angle to the displacement vector, \vec{r}, which is the line segment reaching from the centre to the object (the radius).

TikZ diagram

The velocity vector is therefore fixed to be a quarter cycle ahead of the displacement vector, which is precisely the relationship between \cos \theta and \sin \theta. The components of \vec{v} are the rates at which the corresponding components of \vec{r} change as the angle advances. It follows that the rate at which \sin \theta is increasing is given by \cos \theta, or:

\frac{d}{d\theta} \sin \theta = \cos \theta

This is confirmed by examining the shape of the functions separately. Nearby to \theta = 0, \sin \theta is closely approximated by \theta itself, and looks much like a straight line of gradient 1, which happens to be the value of \cos 0.

TikZ diagram
TikZ diagram

When \sin \theta peaks at \theta = \pi/2, its gradient is 0, and again this is in agreement with the value of \cos (\pi/2). This pattern continues at every point in the cycle.

So in any situation where we need the derivative of \sin, we just replace it with \cos. By the same reasoning (and because we know the same relationship exists between -\sin \theta and \cos \theta) we can assume that:

\frac{d}{d\theta} \cos \theta = -\sin \theta

Differentiating two more times will get us back to \sin \theta because each differentiation advances the function by a quarter cycle. (Naturally integration performs the same trick in the opposite direction, but we aren’t going to need that here.)

Computing Sine and Cosine

Now we can take the derivative of \sin, also the derivative of the derivative, and so on, and we know all their precise values at 0, we can use the Taylor series method (actually the simpler form of it called a Maclaurin series) to find how to compute \sin using only addition and multiplication, if only we have the patience to perform an infinite sequence of those operations.

We begin by assuming that a function f(x) can be expressed as the sum of an infinite series of polynomial terms, that is, each term is some constant a_n multiplied by the variable x raised to an integer power n, beginning at 0:

f(x) = a_0x^0 + a_1x^1 + a_2x^2 + a_3x^3 + \ldots

Anything raised to the power of 0 is 1, and raising something to the power of 1 makes no difference, so at the expense of consistency, and meanwhile also sneaking in the name of the function we want to compute, we just write:

\sin x=a_0 + a_1x + a_2x^2 + a_3x^3 + \ldots

So we only need to determine the constant factors a_n to entirely characterise the function (does this mean that functions are vectors? Well, yes, the ones that are amenable to being defined in this way, which is actually not all functions.)

Setting x = 0, any term that is multiplied by x must be zero (they vanish entirely from the sum), which only leaves a_0. But \sin 0=0, so it follows that a_0 = 0. We got one of the launch codes!

The next step is going to involve assuming another bit of knowledge: how to get the derivative (the “rate of change”) of a polynomial. Taking the derivative of both sides (so \sin becomes \cos, as we already figured out):

\cos x=a_1 + 2a_2x + 3a_3x^2 + 4a_4x^3 + \ldots

Each polynomial’s power is reduced by 1, and the original power “moves down” to become an extra factor. Now the exact same vanishing argument applies to a_1 except that here it is solely responsible for the value of \cos 0=1, and so it must be that a_1 = 1. We differentiate a second time:

-\sin x=2a_2 + (3\cdot2)a_3x + (4\cdot3)a_4x^2 + \ldots

So a_2 = 0. Differentiate a third time:

-\cos x=(3\cdot2)a_3 + (4\cdot3\cdot2)a_4x + \ldots

So a_3 = -\frac{1}{3!}. When n is even the term is zero, and when n is odd the term x^n is divided by the accumulated value n!. We continue in this fashion to find that:

\sin x=x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \frac{x^9}{9!} - \ldots

By the same process we find that for \cos only the even-n terms appear in the result:

\cos x=1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \frac{x^8}{8!} - \ldots

In each case there is a four stage cycle, with alternating absence of terms and then similarly alternating +/- signs. We saw these exact patterns last time in the result we got from the binomial expansion of the compound interest formula:

e^{i\theta} = \left( 1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} + \dots \right) + i \left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} + \dots \right)

Even if we hadn’t already seen that, we might have found it curiously reminiscent of the cyclic behaviour of i.

The exponential function e^x has the useful property that its derivative is e^x, i.e. the function is its own derivative. But even if we’d only heard a rumour of this, we could confirm it easily, because the method of evaluating at zero and taking repeated derivatives becomes ridiculously easy to perform, and yields:

e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} + \ldots

This is exactly what we got from the compound interest formula, and so we now have two ways of arriving at:

e^{ix} = \cos x + i\sin x

Physics is thick with examples of oscillation. To describe the state of a particle undergoing simple harmonic motion along a line, we need to know the position and the momentum. A snapshot of an oscillator at one moment does not give us a complete understanding: the oscillator might be passing through the origin, but which way?

A complex number, being described by two real numbers, can encapsulate both these quantities, and the real and imaginary parts have the right phase relationship to represent the position and the momentum.

Most importantly, that sense of the inherent weirdness, a feeling of “Yeah, but what does that mean?” when we see some exotic object (such as a linear operator) being used as the power to raise to, is fully banished by the Taylor expansion or the binomial expansion that produces the same result. They show us exactly how to convert b^x into a sum of terms in which the exotic object x is merely the base instead of the power, and the power is just an ordinary number. We only need to know how to multiply the exotic object by itself.




    Not yet regretting the time you've spent here?

    Keep reading:

  • Euler's Formula 1 - Perpendicular Accountancy
  • Quantumania 25 - Irritating Conveyor Belts
  • Quantumania 24 - Learn from the Flerfers
  • Quantumania 23 - Turn! Turn! Turn!
  • Quantumania 22 - Three Dimensions