# An interesting pattern in solutions to differential equations

OK, watch this:

Suppose I have a weight on the end of a spring. Assuming the spring obeys Hooke's law, as the weight is displaced from its rest position, the spring exerts a restoring force in the opposite direction who's magnitude is equal to the displacement multiplied by the spring constant.

Suppose that $f(t)$ represents the displacement of the weight at time $t$. If we assume that the spring constant and the mass of the weight are both unity, we have

$$f''(t) = -f(t)$$

This is an equation involving both $f$ itself and its derivative $f''$, so this is presumably a "differential equation". I don't know how to deal with such a thing. But it is clear that this does not yet tell me what $f$ is, only that it must satisfy a specific property.

Thinking about this for a moment, it is clear that $f(x) = 0$ has the requested property. This corresponds to the weight remaining stationary for all eternity - a physically valid, but rather "boring" result.

Contemplating this further, it occurs to me that the derivative of $\sin$ is $\cos$, and the derivative of $\cos$ is $-\sin$. So if $f(t)=\sin(t)$ then $f''(t)=-\sin(t)$, which satisfies the equation. By nearly identical reasoning, $f(t)=\cos(t)$ would also work. In short, if you ping the weight, it oscillates around zero.

Now suppose that, by some bizarre mechanism, the restoring force were to somehow be in the same direction as the displacement. Impossible, I know. But imagine. Now our equation becomes

$$f''(t)=f(t)$$

Again $f(t)=0$ would work. But what else? Well, there is exactly one function who's derivative equals itself: $\exp$. This is a stronger property than we need, but still, if $f(t)=\exp(t)$ then every derivative of $f$ (including $f''$) would equal $f$. This describes the weight accelerating away exponentially - rather as you might expect.

So far, we have two equations. The solution to one is $\sin$. The solution to the other is $\exp$. Two similar equations, two totally different solutions. Or at least, they look different. But now I'm thinking about something Euler once wrote:

$$\exp(ix) = \cos(x) + i \sin(x)$$

Say that, and suddenly these solutions don't look so dissimilar at all. Now they suddenly look suspiciously similar!

My question: Is this the result of some deep and meaningful connection? Or is it merely a coincidence?

Holy smokes, you guys are right!

I know, of course, of $\sinh$ and $\cosh$. (For real numbers, they look utterly unrelated. But in the complex plane, one is a trivially rotated version of the other.) What I didn't know, until I looked it up, was the derivatives of these functions.

Since they're defined in terms of $\exp$, I was expecting some really complicated derivative. However, what I actually found (as you presumably all know) is that $\sinh'=\cosh$ and, unlike in the circular case, $\cosh'=\sinh$!

So yes, for $f''=-f$ we have $f=\sin$ or $f=\cos$, and for $f''=f$ we have $f=\sinh$ or $f=\cosh$. So flipping the sign of the differential equation rotates the function in the complex plane. Physically, it doesn't look very meaningful to talk about complex-valued seconds, but mathematically it all looks vastly too perfect to be mere coincidence.

-
Nice observation. You will be interested in the functions $\cosh x$ and $\sinh x$, which are the analogues (for the second problem) of the familiar $\cos$ and $\sin$. – André Nicolas Aug 1 '12 at 14:47

Great observation! Yes, this is a very meaningful connection. Let me introduce a bit of notation which I hope will be suggestive. Instead of $f'(t)$, write $D f$. The symbol $D$ here is a differential operator: it takes as input a function and returns its derivative. So we can write your two differential equations as $$(D^2 + 1) f = 0$$

and $$(D^2 - 1) f = 0.$$

The reason for introducing differential operators is that they can be manipulated like numbers (more formally, they form a ring): you can add and multiply them ($D^2$ corresponds to taking the derivative twice), and in particular you can factor the above differential operators, getting $$(D + i)(D - i) f = 0$$

and $$(D + 1)(D - 1) f = 0.$$

This makes it clear that any solution to $(D \pm i) f = 0$ is a solution to the first equation and any solution to $(D \pm 1) f = 0$ is a solution to the second equation. But these first-order differential equations can be solved just by dividing by $f$ and integrating, and we get $$f = e^{\pm ix}$$

for the first equation and $$f = e^{\pm x}$$

for the second equation.

Exercise: Generalize to the differential equation $$p(D) f = 0$$

where $p$ is a polynomial.

(If you're wondering how to get the decomposition into sine and cosine, resp. hyperbolic sine and cosine, the abstract answer is that these correspond to different particularly nice behaviors a function can have under the symmetry $f(x) \mapsto f(-x)$; in other words, sine resp. hyperbolic sine corresponds to odd solutions and cosine resp. hyperbolic cosine corresponds to even solutions.)

There are some other abstractions relevant here: $D$ acts on the solutions to the differential equation $p(D) f = 0$ for any polynomial $p$, and the particularly nice solutions we wrote down above are its eigenvectors. To get all solutions in general, however, we may need to use generalized eigenvectors.

-
I think in order to really comprehend this, I need to go reaquaint myself with the exact properties of the derivatives of sums and products... I want to figure out exactly what solutions these differential equations have. (It looks, for example, like $f=\sin+\cos$ ought to work, but I haven't checked yet.) – MathematicalOrchid Aug 1 '12 at 19:52
@MathematicalOrchid: the space of solutions in both cases above is a vector space of dimension $2$ (because taking the derivative is linear and a solution is uniquely determined by $f(0)$ and $f'(0)$) and the solutions I wrote down form a basis. So the general solution of the first one is $A e^{ix} + B e^{-ix}$ (equivalently, $A \cos x + B \sin x$) and the general solution of the second one is $A e^x + B e^{-x}$. – Qiaochu Yuan Aug 1 '12 at 19:57
Like I said, I need to go away and think about this for a while. ;-) – MathematicalOrchid Aug 1 '12 at 20:02

Continuing on Qiaochu Yuan's path, from $p(D)f=0$ you might think that there are as many solutions as the degree of $p$, just like there are the same number of roots of a polynomial as its degree. This is correct.

Your equations are linear, which means that no powers of $f$ appear (though powers of $D$ and the independent variable can occur) and homogeneous (which means there is no constant term). You can then prove that any linear combination of solutions is again a solution. So having found that $\exp(t)$ and $\exp(-t)$ are solutions of $f''(t)=f(t)$ you know that $A\exp(t)+B\exp(-t)$ is again a solution for any real $A,B$. The fact that you have found two and the degree of $D^2-1$ is $2$ means you have found them all. For $(D^2+1)f=0$ you noted that $\sin t$ and $\cos t$ are solutions and Qiaochu Yuan noted that $exp (it)$ and $\exp (-it)$ are solutions, but $\cos t=\frac {exp (it) +\exp (-it)}2$ and $\sin t=\frac {exp (it) -\exp (-it)}{2i}$ so these are linear combinations of each other.

-
But this is somewhat subtle if $p$ has repeated roots. – Qiaochu Yuan Aug 1 '12 at 19:33
@QiaochuYuan: True. As I understand it, you still have that many solutions and they still form a vector space. They just look a bit different, like $t \exp(at)$ – Ross Millikan Aug 1 '12 at 19:49
Wolfram|Alpha claims that $f''=f$ has the solution $f(t) = A \exp(t) + B \exp(-t)$. I notice that both $\exp(t)$, $\cosh(t)$ and $\sinh(t)$ can be constructed by setting $A$ and $B$ appropriately... – MathematicalOrchid Aug 1 '12 at 19:53
@MathematicalOrchid: Exactly. You have a two dimensional vector space of solutions and have found a basis. – Ross Millikan Aug 1 '12 at 19:59