5. Complex Waves

Just as complex numbers provide a convenient way to study oscillations, they can also be employed to model wave motion. In physics, complex numbers are commonly used in the study of electromagnetic (light) waves, sound waves, and other kinds of waves.

The wave equation

A wave can be described by a function $f(x,t)$, called a wavefunction, which specifies the value of a measurable physical quantity at each position $x$ and time $t$. For simplicity, we will assume that space is one-dimensional, so $x$ is a single real number. We will also assume that $f(x,t)$ is a number, rather than a more complicated object such as a vector. For instance, a sound wave can be described by a wavefunction $f(x,t)$ representing the air pressure at each point of space and time.

The evolution of the wavefunction is described by a partial differential equation (PDE) called the time-dependent wave equation:

$$\frac{\partial^2 f}{\partial x^2} = \frac{1}{v^2} \frac{\partial^2 f}{\partial t^2}, \;\;\; v \in\mathbb{R}^+.$$

The parameter $v$, which we take to be a positive real constant, is called the wave speed, for reasons that will shortly become clear.

Sometimes, we re-arrange the wave equation into the following form, consisting of a linear differential operator acting on $f(x,t)$:

$$\left(\frac{\partial^2}{\partial x^2} - \frac{1}{v^2} \frac{\partial^2}{\partial t^2}\right) \; f(x,t) = 0.$$

This way of writing the wave equation emphasizes that it is a linear PDE, meaning that any linear superposition of solutions is likewise a solution.

Real solutions to the wave equation

We first consider real solutions to the wave equation. One family of solutions are travelling waves of the form

$$f(x,t) = f_0 \, \cos\!\big(kx - \omega t + \phi\big),\quad\mathrm{where}\;\, \left|\frac{\omega}{k}\right| = v.$$

By direct substitution, we can verify that this satisfies the PDE. We call $f_0$ the amplitude of the wave, $\phi$ the phase, $\omega$ the (angular) frequency, and $k$ the wavenumber. By convention, $\omega$ is taken to be a positive real number. However, $k$ can be either positive or negative, and its sign determines the direction of propagation of the wave; the magnitude of the wavenumber is inversely related to the wavelength $\lambda$ by $\lambda = 2\pi/|k|$.

The travelling wave solution is shown in the figure below:


In [1]:
## Plot a wave function versus x, with adjustable t.
%matplotlib inline
from ipywidgets import interact, FloatSlider
from numpy import linspace, cos
import matplotlib.pyplot as plt

def plot_traveling_wave(t, k, omega, f0, phi):
    x  = linspace(0, 20., 150)
    y  = f0 * cos(k*x - omega*t + phi)
    y0 = f0 * cos(k*x + phi)
    plt.figure(figsize=(10,5))
    plt.plot(x, y0, color='grey', label="f(x,0)")
    plt.plot(x, y,  color='blue', label="f(x,t)")
    plt.title("Use 't' slider to adjust the time")
    plt.axis([x[0], x[-1], -1.2, 1.2])
    plt.xlabel('x'); plt.ylabel('f(x,t)')
    plt.legend(loc='lower right')
    plt.show()

interact(plot_traveling_wave,
         t    = FloatSlider(min=0.0,  max=10.0, step=0.1,  value=0.4),
         k    = FloatSlider(min=-2.0, max=2.0,  step=0.1,  value=1.0),
         omega= FloatSlider(min=1.0,  max=2.0,  step=0.1,  value=1.0),
         f0   = FloatSlider(min=0.0,  max=1.0,  step=0.1,  value=1.0),
         phi  = FloatSlider(min=0.0,  max=6.28, step=0.02, value=0.0));


As $t$ increases, observe that the wave moves to the right if $k$ is positive, whereas it moves to the left if $k$ is negative. Here's one way to reason out why this is the case. Consider introducing a small change in time, $\delta t$, into the function $\cos(kx - \omega t + \phi)$. If, together with this time shift, we change $x$ by $\delta x = (\omega/k)\, \delta t$, then the change in the $kx$ term and the change in the $\omega t$ term cancel, leaving the value of the cosine unchanged:

This implies that the wave shifts by $\delta x = (\omega/k)\, \delta t$ during the time interval $\delta t$. Hence, the wave velocity is

$$\textrm{velocity} = \frac{\delta x}{\delta t} = \frac{(\omega/k)\,\delta t}{\delta t} = \frac{\omega}{k}.$$

As previously noted, $\omega$ is conventionally taken to be a positive real number. Hence, positive $k$ implies that the wave is right-moving (positive velocity), and negative $k$ implies the wave is left-moving (negative velocity). Moreover, the wave speed is the absolute value of the velocity, which is precisely equal to the constant $v$:

$$\textrm{speed}\; = \, \left|\frac{\delta x}{\delta t}\right| = \frac{\omega}{\left|k\right|} = v.$$

Standing waves

Suppose we have two travelling wave solutions, with equal amplitude and frequency, moving in opposite directions:

$$f(x,t) = f_0 \, \cos(kx - \omega t + \phi_1) + f_0 \cos(-kx - \omega t + \phi_2).$$

Here, we denote $k = \omega/c$. Such a superposition is also a solution to the wave equation, called a standing wave. It can be re-written in a variable-separated form (i.e., as the product of a function of $x$ and a function of $t$):

$$f(x,t) = 2f_0 \, \cos\big[kx + (\phi_1-\phi_2)/2\big]\, \cos\big[\omega t - (\phi_1+\phi_2)/2\big].$$

This can be proven using the trigonometric addition formulas, but the proof is tedious.

Complex solutions to the wave equation

It is much easier to deal with the wave equation if we promote it into a complex PDE by letting $f(x,t)$ take on complex values. However, $x$ and $t$ will remain real. We will also take the wave speed $v$ to be real, for now.

From any complex solution to the wave equation, we can take the real part to get a solution to the real PDE, thanks to linearity:

$$\left(\frac{\partial^2}{\partial x^2} - \frac{1}{v^2} \frac{\partial^2}{\partial t^2}\right) \mathrm{Re}\left[f(x,t)\right] = \mathrm{Re} \left[ \left(\frac{\partial^2}{\partial x^2} - \frac{1}{v^2} \frac{\partial^2}{\partial t^2}\right) f(x,t)\right] = 0.$$

There exists a nice set of complex solutions to the wave equation, called complex travelling waves, which take the form

$$f(x,t) = A \, e^{i(kx - \omega t)} \quad\mathrm{where}\;\; \left|\frac{\omega}{k}\right| = v.$$

It can be verified by direct substitution that this satisfies the PDE. The complex constant $A$ is called the complex amplitude of the wave. Consider what happens if we take the real part of the above solution:

$$\begin{aligned}\mathrm{Re}\Big\{A \, e^{i(kx - \omega t)}\Big\} &= \mathrm{Re}\Big\{ |A|\, e^{i\mathrm{arg}[A]} \; e^{i(kx - \omega t)}\Big\} \\ &= \big|A\big|\; \mathrm{Re}\Big\{ e^{i\mathrm{arg}[A]} \, e^{i(kx - \omega t)}\Big\} \\ &= \big|A\big|\; \cos\big(kx - \omega t + \mathrm{arg}[A]\big)\end{aligned}$$

Comparing this to the previously-discussed real solution, we see that $|A|$ serves as the amplitude of the real wave, while $\mathrm{arg}(A)$ serves as the phase factor $\phi$. Mathematically, the complex solution is more succinct than the real solution: a single complex parameter $A$ combines the roles of two parameters in the real solution.

The complex representation also makes wave superpositions easier to handle. As an example, consider the superposition of two counter-propagating waves of equal amplitude and frequency, with arbitrary phases. Using complex travelling waves, we can calculate the superposition with a few lines of algebra:

$$\begin{aligned}f(x,t) &= \displaystyle \big|A\big| \, e^{i(kx - \omega t + \phi_1)} + \big|A\big| \, e^{i(-kx - \omega t + \phi_2)} \\ &= \displaystyle \big|A\big|\, \left(e^{i(kx + \phi_1)} + e^{-i(kx - \phi_2)}\right)\, e^{-i\omega t} \\ &= \displaystyle \big|A\big|\, \left(e^{i[kx + (\phi_1-\phi_2)/2]} + e^{-i[kx + (\phi_1 - \phi_2)/2]}\right)\, e^{i(\phi_1 + \phi_2)/2} \,e^{-i\omega t} \\ &= \displaystyle 2\big|A\big|\, \cos\left[kx + (\phi_1-\phi_2)/2\right] \,e^{-i[\omega t -(\phi_1+\phi_2)/2]}\end{aligned}$$

Taking the real part yields our previous result, without the need for tedious manipulations of trigonometric formulas.

Waves in 3D space

The wave equation can be generalized to three spatial dimensions by replacing $f(x,t)$ with a wavefunction that depends on three spatial coordinates, $f(x,y,z,t)$. The second-order derivative in $x$ is then replaced by second-order derivatives in each spatial direction:

$$\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2} - \frac{1}{v^2} \frac{\partial^2}{\partial t^2}\right) \; f(x,y,z,t) = 0.$$

This PDE supports complex plane wave solutions of the form

$$f(x,y,z,t) = A \, e^{i(\vec{k} \cdot \vec{r} - \omega t)},$$

where

$$\vec{k} = \begin{bmatrix}k_x\\k_y\\k_z\end{bmatrix}, \;\;\; \vec{r} = \begin{bmatrix}x\\y\\z\end{bmatrix}, \;\;\;\frac{\omega}{\sqrt{k_x^2 + k_y^2 + k_z^2}} = v.$$

Again, we can verify that this is a solution by direct substitution. We call $\vec{k}$ the wave-vector, which generalizes the wavenumber $k$. The direction of the wave-vector specifies the spatial direction in which the wave travels.

Harmonic waves

We are often interested in waves undergoing harmonic oscillation, i.e. varying sinusoidally with a constant frequency $\omega$ everywhere in space. Such waves can be described by wavefunctions of the form

$$f(x,y,z,t) = \psi(x,y,z) \, e^{-i\omega t}.$$

By writing the wavefunction in this form, we are performing a separation of variables between $\vec{r}$ and $t$. This is a common method for simplifying PDEs, and is justified by the linearity of the wave equation. If we can find harmonic solutions for each frequency $\omega$, we can linearly combine them to construct more general solutions that are non-harmonic.

By direct substitution into the 3D wave equation, we can show that $\psi(x)$ obeys

$$\left[\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2} + \left(\frac{\omega}{v}\right)^2\right] \, \psi(x,y,z) = 0.$$

This is related to the original time-dependent wave equation by the replacement of $\partial/\partial t$ with $-i\omega$.

Waves in complex media

So far, our discussion has been limited to waves propagating in a uniform, energy-conserving medium with a fixed wave speed $v$. There are two important generalizations of this scenario: (i) non-uniform media, in which the wave speed varies with position, and (ii) energy non-conserving media, in which the waves lose or gain energy as they propagate. To capture these phenomena, we replace the constant $v$ by

$$v = \frac{c}{n},$$

where $n$ is called the refractive index, and the constant $c$ is the wave speed in the limit $n = 1$. In the case of electromagnetic waves, $c$ is the speed of light in a vacuum.

If the refractive index is now allowed to vary with position, the wave equation in the harmonic representation becomes

$$\left[\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2} + n^2(x,y,z)\, \left(\frac{\omega}{c}\right)^2\right] \, \psi(x,y,z) = 0.$$

Wave amplification and attenuation

By allowing the refractive index $n$ to be complex, the wave equation can describe the phenomena of wave amplification (which is also called gain) and wave attenuation (also called loss). Amplified and attenuated waves occur in many different contexts in physics; for example, the amplification of light waves is the underlying basis for the laser.

To study these phenomena, let us go back to one-dimensional space and the simple scenario of a position-independent refractive index. For harmonic waves, the wave equation reduces to

$$\left[\frac{d^2}{d x^2} + n^2\, \left(\frac{\omega}{c}\right)^2\right] \, \psi(x) = 0.$$

We now let $n$ be complex, while keeping $\omega$ and $c$ as positive real numbers. The solutions to the ODE have the form

$$\psi(x) = A \exp\left(\pm \frac{in\omega}{c}x\right),\;\;\;\mathrm{where}\;\; A \in \mathbb{C}.$$

Let us write the complex refractive index as

$$n = n' + i n'',\quad \textrm{where}\;\, n',n'' \in \mathbb{R}.$$

Then

$$\psi(x) = A \exp\left[\pm in'(\omega/c)x\right]\, \exp\left[\mp n''(\omega/c)x\right].$$

The first exponential factor describes the oscillation of the wavefunction, with the $\pm$ sign determining whether the harmonic wave is moving to the right or to the left. The second exponential describes the amplification or attenuation of the wave. If $n'' \ne 0$, the amplitude varies exponentially with $x$. Thus, depending on the signs of the various parameters, the wave might grow exponentially along its direction of propagation, which corresponds to amplification, or decrease exponentially along its direction of propagation, which corresponds to damping.

These behaviors are explored in the plot below:


In [4]:
## Plot an amplifying or attenuating wave.
%matplotlib inline
from ipywidgets import interact, FloatSlider, ToggleButtons
from numpy import linspace, exp, sign
import matplotlib.pyplot as plt

def plot_complex_wave(sgn, n1, n2, omega, absa, arga):
    ylim, arrowx, arrowy = 10.0, 1.5, 5.
    textx, texty = -2., 6.
    A    = absa * exp(1j*arga)
    x    = linspace(-10., 10., 200)
    
    s = 1. if sgn == '+' else -1.

    ## Plot the wavefunction
    psi = A * exp(1j*s*(n1+1j*n2)*omega*x)
    plt.figure(figsize=(10,5))
    plt.plot(x, psi.real, color='mediumblue', label="Re(psi)")
    plt.plot(x, psi.imag, color='darkorange', label="Im(psi)")

    ## Plot the direction of travel as a guide to the eye.
    direction = arrowx * s
    plt.annotate('', xy=(direction, arrowy),
                 xytext=(-direction, arrowy),
                 arrowprops=dict(facecolor='red', shrink=0.05))
    plt.text(textx, texty, 'Propagation direction', color='red')

    ## Axis labels, etc.
    plt.title("Use 't' slider to adjust the time")
    plt.xlim(x[0], x[-1])
    plt.ylim(-ylim, ylim)
    plt.xlabel('x')
    plt.legend(loc='lower right')
    plt.show()

interact(plot_complex_wave,
         sgn  = ToggleButtons(description='Sign in exponent', options=['+', '-']),
         n1   = FloatSlider(min=1.0,   max=4.0,  step=0.1,  value=1.5, description='Re(n)'),
         n2   = FloatSlider(min=-0.5,  max=0.5,  step=0.1,  value=0.1, description='Im(n)'),
         omega= FloatSlider(min=0.5,   max=2.0,  step=0.1,  value=1.0, description='omega/c'),
         absa = FloatSlider(min=0.0,   max=2.0,  step=0.1,  value=1.0, description='|A|'),
         arga = FloatSlider(min=-3.14, max=3.14, step=0.01, value=0.0, description='arg(A)'));


Exercises

  1. Consider the 1D wave equation in a enclosed box of length $L$ and uniform refractive index $n\in\mathbb{R}$. The walls of the box are at $x = -L/2$ and $x = L/2$, and the wavefunction goes to zero at these points: $\psi(\pm L/2) = 0$ (i.e., Dirichlet boundary conditions). Show that $\psi(x) = 0$ for all $x$, except for certain discrete values of the frequency $\omega$. Find these frequencies, and the corresponding non-zero solutions $\psi(x)$.
  2. As previously discussed, a harmonic travelling wave in an energy-nonconserving medium is described by $$\left[\frac{d^2}{d x^2} + n^2\, \left(\frac{\omega}{c}\right)^2\right] \, \psi(x) = 0,$$ where $n$ is a complex number. (As usual, $\omega$ and $c$ are assumed to be positive real numbers.) Show that the relative sign of $\mathrm{Re}(n)$ and $\mathrm{Im}(n)$ determines whether the wave experiences amplification or dissipation, and that the result does not depend of the wave's propagation direction. (Solution)
  3. When the refractive index is complex, can the real part of the complex wavefunction be regarded as the solution to the same wave equation? If not, derive a real differential equation whose solution is the real part of the complex travelling wave solution.