4. Complex exponentials

For second-order equations we need to make sense of \(e^{\lambda t}\) when \(\lambda\) is complex. The key is one of the most famous equations in mathematics.

Formula 4.13 (Euler’s identity)
(4.8)\[e^{it} = \cos(t) + i \sin(t)\]

Note

Euler is a German name, and as such, it rhymes with “boiler,” not “Bueller.”

Euler’s identity shows that imaginary exponents produce oscillation, rather than the growth/decay of real exponents.

c = @(t) real(exp(1i*t));
s = @(t) imag(exp(1i*t));
fplot({c,s},[0,4*pi])
xlabel('t'), ylabel('e^{it}')
title('Complex exponential')
legend('Re part','Im part')
../_images/complex_exp_4_0.png

Alternatively, if we take \(x\) and \(y\) to be the real and imaginary parts of \(z=e^{it}\), then they parametrically describe a unit circle in the complex plane.

c = @(t) real(exp(1i*t));
s = @(t) imag(exp(1i*t));
fplot(c,s,[0,2*pi])
axis equal, axis(1.05*[-1 1 -1 1])
xlabel('Re z'), ylabel('Im z')
title('Complex exponential = Unit circle')
../_images/complex_exp_6_0.png

4.1. Polar form

Suppose \(z\) is any nonzero complex value. We can write it in the form

\[ z = |z|\cdot \frac{z}{|z|}, \]

where \(|z|\) is the modulus (distance from origin in the plane). Since \(\frac{z}{|z|}\) has modulus equal to 1, it must lie on the unit circle. Hence there is a real \(\theta\) such that

(4.9)\[z = |z|\, e^{i\theta}.\]

We call (4.9) the polar form of a complex number, because it expresses \(z\) as a distance from zero and an angle from the positive Re axis. Just as with any point in the plane, we can express a complex number either in Cartesian form using Re and Im parts, or in polar form using modulus and Euler’s identity.

Example

Suppose \(r\) is a positive real number. Then \(-r\) lies at a distance \(r\) from the origin along the negative real axis. Hence

\[ -r = |r|\, e^{i\pi}. \]

Supposing that we may take the log of both sides, we get

\[ \ln(-r) = \ln |r| + i\pi. \]

Using complex numbers, then, we can take the log of a negative number. You will find that this is the case in MATLAB.

Example

What’s the square root of \(i\)?

4.2. Complex exponents

Exponential functions still obey the properties you already know, even when the exponents are imaginary or complex numbers. This allows us to handle the exponential of any complex number. Writing \(a+i \omega\) for real \(a\) and \(\omega\), we have the function

Formula 4.14 (Complex exponential function)
(4.10)\[e^{(a+i \omega)t} = e^{at} \cdot e^{i\omega t} = e^{at} \bigl[ \cos(\omega t) + i \sin(\omega t)\bigr].\]

Thus in the function \(e^{\lambda t}\), the real part of \(\lambda\) controls growth or decay in time, as we are familiar with, and the imaginary part of \(\lambda\) controls a frequency of oscillation around a circle in the complex plane.

4.2.1. Growing

If \(\text{Re} \lambda > 0\), the magnitude of the function grows exponentially. The result is an outward spiral. The imaginary part of \(\lambda\) controls the frequency or pitch of the spiral. The real and imaginary parts of \(e^{\lambda t}\) oscillate between two growing real exponentials.

a = 0.02;  om = 0.75;
t = linspace(0, 25, 500);
f = exp((a+1i*om)*t);

plot3(t, real(f), imag(f))
hold on
plot3(t,real(f), 0*t-1.5)
plot3(t, 0*t+2, imag(f))
plot3(0*t+30,real(f),imag(f),'k')
axis([0 30 -2  2 -2 2])
title(sprintf('a = %.2f, \\omega = %.2f',a,om))
grid on, xlabel('Time')
ylabel('Re part')
zlabel('Im part')
set(gca,'dataaspect',[6,1,1])
../_images/complex_exp_8_0.png

4.2.2. Neutral

When \(\lambda\) is purely imaginary, the function values stay on the unit circle in the complex plane. Taking the real and imaginary parts of \(e^{\lambda t}\) gives cosine and sine, respectively.

a = 0;  om = 1;
t = linspace(0, 25, 500);
f = exp((a+1i*om)*t);

plot3(t, real(f), imag(f))
hold on
plot3(t,real(f), 0*t-1.5)
plot3(t, 0*t+2, imag(f))
plot3(0*t+30,real(f),imag(f),'k')
axis([0 30 -2  2 -2 2])
title(sprintf('a = 0, \\omega = %.1f',a,om))
grid on, xlabel('Time')
ylabel('Re part')
zlabel('Im part')
set(gca,'dataaspect',[6,1,1])
../_images/complex_exp_10_0.png

4.2.3. Decaying

Finally, if \(\text{Re} \lambda < 0\), the spiral is a decaying one. The real and imaginary parts are attenuated oscillations.

a = -0.07;  om = 2.4;
t = linspace(0, 25, 500);
f = exp((a+1i*om)*t);

plot3(t, real(f), imag(f))
hold on
plot3(t,real(f), 0*t-1.5)
plot3(t, 0*t+2, imag(f))
plot3(0*t+30,real(f),imag(f),'k')
axis([0 30 -2 2 -2 2])
title(sprintf('a = %.2f, \\omega = %.1f',a,om))
grid on, xlabel('Time')
ylabel('Re part')
zlabel('Im part')
set(gca,'dataaspect',[6,1,1])
../_images/complex_exp_12_0.png

4.3. Homogeneous solutions

Now we can finish the story of computing solutions to homogeneous ODEs.

Example

Solve the IVP \(x''+9x=0\), \(x(0)=2\), \(x'(0)=-12\).

There are some helpful nuances to point out about the preceding example.

Observation

If a real second-order IVP has complex conjugate characteristic values, then the integration constants satisfy \(c_2=\overline{c_1}\).

This can simplify the algebra a bit. If we set \(c_1=\alpha + i\beta\), then

(4.11)\[c_1 + c_2 = 2\alpha, \quad c_1-c_2 = 2i\beta.\]

In the example above, this would have led us right to \(2\alpha=2\) and \(3i(2i\beta)=-12\), which are trivial.

It might seem odd to use complex numbers to represent what we know must be a real-valued solution. There’s nothing wrong with doing so, but we can also convert it to an explicitly real form. The following is easily proved using Euler’s identity.

Observation

The general homogeneous solution

\[ x_h(t) = c_1 e^{\lambda_1 t} + c_2 e^{\lambda_2 t}, \]

where \(\lambda_{1,2} = a \pm i\omega\) are complex, is equivalent to the real expression

\[ x_h(t) = e^{at} \bigl[ b_1 \cos(\omega t) + b_2 \sin(\omega t) \bigr], \]

where \(b_1,b_2\) are real constants.

Example (continued)

In the preceding example, the roots were \(0 \pm 3i\). Thus another expression for the general solution is

\[ x_h(t) = c_1\cos(3t) + c_2\sin(3t). \]

The initial conditions now yield

\[\begin{align*} 2 &= x(0) = c_1\cos(0) + c_2\sin(0) = c_1,\\ -12 &= x'(0) = -3 c_1 \sin(0) + 3 c_2 \cos(0) = 3c_2. \end{align*}\]

Hence the IVP solution is \(2\cos(3t) - 4\sin(3t).\)

Since complex exponentials are much less familiar to you than sin and cos, the real form might seem more appealing to you. Don’t be so quick to jump back there. Not only is the complex form the point of view that unifies all the second-order linear problems we solve under the exponential umbrella, but in some cases it greatly simplifies expressions and algebra.