## Sine and Cosine

Now I want to consider the differential equation . As I mentioned at the end of last time, we can write this as and find two solutions — and — by taking the two complex square roots of . But the equation doesn’t use any complex numbers. Surely we can find real-valued functions that work.

Indeed, we can, and we’ll use the same techniques as we did before. We again find that any solution must be infinitely differentiable, and so we will assume that it’s analytic. Thus we write

and we take the first two derivatives

The equation then reads

for every natural number . The values and are not specified, and we can use them to set initial conditions.

We pick two sets of initial conditions to focus on. In the first case, and , while in the second case and . We call these two solutions the “sine” and “cosine” functions, respectively, writing them as and .

Let’s work out the series for the cosine function. We start with , and the recurrence relation tells us that *all* the odd terms will be zero. So let’s just write out the even terms . First off, . Then to move from to we multiply by . So in moving from all the way to we’ve multiplied by times, and we’ve multiplied up every number from to . That is, we have , and we have the series

This isn’t the usual form for a power series, but it’s more compact than including all the odd terms. A similar line of reasoning leads to the following series expansion for the sine function:

Any other solution with and then can be written as .

In particular, consider the first solutions we found above: and . Each of them has , and , depending on which solution we pick. That is, we can write , and .

Of course, the second of these equations is just the complex conjugate of the first, and so it’s unsurprising. The first, however, is called “Euler’s formula”, because it was proved by Roger Cotes. It’s been seen as particularly miraculous, but this is mostly because people’s first exposure to the sine and cosine functions usually comes from a completely different route, and the relationship between exponentials and trigonometry seems utterly mysterious. Seen from the perspective of differential equations (and other viewpoints we’ll see sooner or later) it’s the most natural thing in the world.

Euler’s formula also lets us translate back from trigonometry into exponentials:

And from these formulæ and the differentiation rules for exponentials we can easily work out the differentiation rules for the sine and cosine functions:

## First-Degree Homogeneous Linear Equations with Constant Coefficients

Now that we solved one differential equation, let’s try a wider class: “first-degree homogeneous linear equations with constant coefficients”. Let’s break this down.

- First-degree: only involves the undetermined function and its first derivative
- Homogeneous: harder to nail down, but for our purposes it means that every term involves the undetermined function or its first derivative
- Linear: no products of the undetermined function or its first derivative with each other
- Constant Coefficients: only multiplying the undetermined function and its derivative by constants

Putting it all together, this means that our equation must look like this:

We can divide through by to assume without loss of generality that (if then the equation isn’t very interesting at all).

Now let’s again assume that is analytic at , so we can write

and

So our equation reads

That is, for all , and is arbitrary. Just like last time we see that multiplying by at each step gives a factor of . But now we also multiply by at each step, so we find

And indeed, we can rewrite our equation as . The chain rule clearly shows us that satisfies this equation.

In fact, we can immediately see that the function will satisfy many other equations, like , , and so on.

## The Exponential Differential Equation

So we long ago defined the exponential function to be the inverse of the logarithm, and we showed that it satisfied the exponential property. Now we’ve got another definition, using a power series, which is its Taylor series at . And we’ve shown that this definition also satisfies the exponential property.

But what really makes the exponential function what it is? It’s the fact that the larger the function’s value gets, the faster it grows. That is, the exponential function satisfies the equation . We already knew this about , but there we ultimately had to use the fact that we defined the logarithm to have a specified derivative. Here we use this property itself as a definition.

This is our first “differential equation”, which relates a function to its derivative(s). And because differentiation works so nicely for power series, we can use them to solve differential equations.

So let’s take our equation as a case in point. First off, any function that satisfies this equation must by definition be differentiable. And then, since it’s equal to its own derivative, this derivative must *itself* be differentiable, and so on. So at the very least our function must be infinitely differentiable. Let’s go one step further and just assume that it’s analytic at . Since it’s analytic, we can expand it as a power series.

So we have some function defined by a power series around :

We can easily take the derivative

Setting these two power series equal, we find that , , , and so on. In general:

And we have no restriction on . Thus we come up with our series solution

which is just times the series definition of our exponential function ! If we set the initial value , then the unique solution to our equation is the function

which is our *new* definition of the exponential function. The differential equation motivates the series, and the series gives us everything else we need.