\docname{sess6.7}
\doctitle{Complex Exponentials}

\mylhead
\myrhead

\title{\doctitle}
\maketitle

Because of the importance of complex exponentials in differential
equations, and in science and engineering generally, we go a little
further with them.  Euler's formula defines the exponential to a pure
imaginary power. The definition of an exponential to an arbitrary
complex power is:
\begin{align}
\label{fourteen} e^{a+ib} = e^a e^{ib} = e^a (\cos b + i \sin b).
\end{align}
We stress that the equation (\ref{fourteen}) is a definition, not a
self-evident truth, since up to now no meaning has been assigned to
the left-hand side. From (\ref{fourteen}) we see that
\begin{align}
\label{fifteen}\Repart(e^{a+ib}) = e^a \cos b, \qquad \Impart(e^{a+ib}) = e^a \sin b.
\end{align}
The complex exponential obeys the usual law of exponents:
\begin{align}
\label{sixteen}
e^{z+z'} = e^z e^{z'},
\end{align}
as is easily seen by combining (\ref{fourteen}) with the
multiplication rule for complex numbers.

The complex exponential is expressed in terms of the sine and cosine
by Euler's formula. Conversely, the $\sin$ and $\cos$ functions can be
expressed in terms of complex exponentials.
There are two important ways of doing this, both of which you should learn:
\begin{align}
\label{seventeen}\cos x &= \Repart(e^{ix} ),&\sin x &= \Impart(e^{ix});\\
\label{eighteen}\cos x &=\frac 12(e^{ix}+e^{-ix}),&\sin x &=\frac{1}{2i}(e^{ix}-e^{-ix}).
\end{align}
The equations in (\ref{eighteen}) follow easily from Euler's formula;
their derivation is left for the exercises. Here are some examples of
their use.  \hbcom{Do our exercises include this derivation?  If not,
  change to ``...is left as an exercise''.}

\example Express $\cos^3 x$ in terms of the functions $\cos nx$, for suitable $n$.

\ans We use (\ref{eighteen}) and the binomial theorem, then (\ref{eighteen}) again:
\begin{align*}
\cos^3 x &=\frac 18(e^{ix} + e^{-ix})^3\\
&=\frac 18(e^{3ix}+3e^{ix}+3e^{-ix}+e^{-3ix})\\
&=\frac 14 \cos 3x + \frac 34 \cos x.
\end{align*}
\hbcom{I left out the little square ``end of proof'' sybmol here and below.}

As a preliminary to the next example, we note that a function like
\[e^{ix} = \cos x + i \sin x\]
is a {\em complex-valued function of the real variable} $x$. Such a function may be written as
$$u(x) + i v(x) \qquad u, v \text{ real-valued}$$
and its derivative and integral with respect to $x$ are defined to be

\begin{align}
\label{nineteen}\text{a) }D(u + iv) = Du + iDv \qquad\; \text{b) }\int (u + iv) dx =\int u dx + i \int v dx .
\end{align}
From this it follows by a calculation that
$$D(e^{(a+ib)x}) = (a + ib)e^{(a+ib)x},$$ and therefore
\begin{align}
\label{twenty}\int e^{(a+ib)x}dx=\frac{1}{a+ib}e^{(a+ib)x}.
\end{align}

\example Calculate $\displaystyle \int e^x \cos 2x \, dx$ by using complex exponentials.

\ans The usual method is a tricky use of two successive integration by parts. Using
complex exponentials instead, the calculation is straightforward. We have
\begin{align*}
e^x \cos 2x = \Repart(e^{(1+2i)x}) ,\qquad \qquad &\text{by (\ref{fourteen}) or (\ref{fifteen}); therefore}\\
\int e^x \cos 2x\, dx = \Repart(\int e^{(1+2i)x} dx),&\text{ by (\ref{nineteen})b.}
\end{align*}
Calculating the integral,
\begin{align*}
\int e^{(1+2i)x}dx&=\frac{1}{1+2i}e^{(1+2i)x}&\text{ by (\ref{twenty})}\\
&=\left(\frac 15 - \frac 25 i\right)( e^x \cos 2x + i e^x \sin 2x ),
\end{align*}
using (\ref{fourteen}) and complex division. According to the second line above, we want the real
part of this last expression. Multiply and take the real part; you get
\[\frac 15 e^x \cos 2x + \frac 25 e^x \sin 2x.\]

In this differential equations course, we will make free use of complex exponentials in
solving differential equations, and in doing formal calculations like the ones above. This is
standard practice in science and engineering, and you need to get used to it.
\hbcom{I'm worried that Mattuck's phrases like ``and you need to get
  used to it'' are going to clash badly with Haynes' announcements
  like ``the sum of two sinusoids is another sinusoid!''.  I shall
  deal with this concern by pointing out phrases like the one here.}
