next up previous
Next: About this document ...

Complex exponentials and trigonometric solutions to ODEs

L. F. Rossi

26 November 2001

When solving second order differential equation such as

 
y''+y=0, (1)

most students are comfortable looking for a general solution composed of two linearly independent solutions such as

 \begin{displaymath}y(x) = C_1 \sin(x) + C_2 \cos x.
\end{displaymath} (2)

However, it is understandable that some find it confusing that there is another perfectly good general solution of the form

 
y(x) = C1 eix + C2 e-ix. (3)

Notice that the arbitrary constants in (2) and (3) are different from one another. To help resolve the issue, I will point out that there is no preferred general solution to any ODE. In the case of (1), there are more than two ways to write the general solution. There are infinitely many! For instance,

 \begin{displaymath}y(x) = C_1 \left(\frac{1}{2}\sin x + \frac{1}{2}\cos x \right) +
C_2 \left(\frac{1}{2}\sin x - \frac{1}{2}\cos x \right)
\end{displaymath} (4)

is also a general solution to (1).

The correct way to think about it is that once one has one linearly independent set of solutions to an ODE (i.e. a basis), one is free to re-express this basis any way one would like. For (4), I took $\sin x$ and $\cos x$ from (2), and recombined them into another basis. Both bases span the same set of general solutions. That is,

\begin{displaymath}{\rm span}\{\sin x,\cos x\} =
{\rm span}\left\{\frac{1}{2}\s...
...ac{1}{2}\cos x,
\frac{1}{2}\sin x - \frac{1}{2}\cos x\right\}.
\end{displaymath}

It's a good exercise to prove this to yourself before proceeding.

Now we can turn to the mysterious arrival of complex numbers in our course. Complex numbers first roared to life when we sought solutions of the form erx in (1). (This is a perfectly good way to solve constant coefficient ODEs, by the way. Complex numbers should not scare you away.) The resulting characteristic polynomial is

P(r) = r2 + 1

which has roots at $\pm i$. Thus, if we knew nothing about sines and cosines, we would write down the general solution seen in (3). In fact, this solution is often more satisfying to students because it came from a rigous procedure whereas the solution involving trig functions comes from an initial guess that the solution will look like a sine or a cosine. Anyway, we know that (2) and (3) span the same general solution space. How can we see this?

The answer comes from Euler's relation

 \begin{displaymath}e^{ix} = \cos x + i\sin x.
\end{displaymath} (5)

This is a big deal, so you should commit it to memory. (It is so short and beautiful that many students just learn it.) One can turn the tables on this relationship and write

 \begin{displaymath}\cos x = \frac{1}{2} \left(e^{ix} + e^{-ix}\right), \ \ \ \
\sin x = \frac{1}{2 i} \left(e^{ix} - e^{-ix}\right).
\end{displaymath} (6)

These are also worth learning, and a great way to learn them to start with (5) and prove (6).

Now, all the pieces fit together. If I start with a general solution like (2), I can write it as complex exponentials using (6).

\begin{eqnarray*}y(x) & = & C_1 \sin x + C_2 \cos x \\
& = & C_1 \left[\frac{1}...
...rac{1}{2}(C_1 - iC_2) e^{ix}
+ \frac{1}{2} (C_1 + iC_2) e^{-ix}
\end{eqnarray*}


Here, I exploited the fact that 1/i=-i. Thus, if we had an answer in terms of sines and cosines, I could convert it into complex exponentials. As an exercise, you should make sure that you can take (3) and convert it into sines and cosines.

The moral of this essay is that there are infinitely many pairs of linearly independent solutions to (1), and this is a general property of ODEs. It is not enough to know how to solve a problem one way because often the difficulty of a problem is governed by which pair you choose to use. Complex exponentials can be terribly useful as can be trigonometric functions. Master them both, and you will have little to fear from constant coefficient ODEs.



 
next up previous
Next: About this document ...
Louis F Rossi
2001-11-26