The Wave Equation
Wave Equation in Cartesian Coordinates
The wave equation is
$$ \frac{\partial^2 u}{\partial t^2} = c^2 \nabla^2 u $$where the Laplacian, \( \nabla^2 \), in cartesian coordinates, is
$$ \nabla^2 = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2}$$In one spacial dimension, we have
$$ \frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2} $$In this example we will solve it on the region \( 0 \leq x \leq L \) and \( 0 \leq t \leq T, \) with boundary conditions \( u(0,t) = u(L,t) = 0. \)
Separate variables
$$ u(x,t) = f(x)g(t) $$ $$ c^2 f''(x)g(t) - f(x)g''(t) = 0 $$ $$ c^2 \frac{f''(x)}{f(x)} - \frac{g''(t)}{g(t)} = 0 $$Since the left-hand side separates into a function of \( x \) and a function of \( t \), the only way this equality can hold for all values of \( x \) and \( t \) is if both terms equal the same constant.
Let
$$ f''(x) = \lambda f(x) $$ $$ g''(t) = c^2 \lambda g(t) $$The boundary conditions give
$$ f(0)g(t) = f(L)g(t) = 0 $$ $$ f(0) = f(L) = 0 $$Assume a solution of the form \( f(x) = e^{kx} \)
$$ k^2 e^{kx} = \lambda e^{kx} \quad \Rightarrow \quad k^2 = \lambda $$i) \( \lambda > 0 \)
$$ k = \pm \sqrt{\lambda} $$ $$ f(x) = c_1 e^{\sqrt{\lambda}x} + c_2 e^{-\sqrt{\lambda}x} $$ $$ f(0) = 0 = c_1 + c_2 \quad \Rightarrow \quad c_1 = -c_2 $$ $$ f(L) = c_1 \left( e^{\sqrt{\lambda}L} - e^{-\sqrt{\lambda}L} \right) = 0 $$Either \( c_1 = 0 \), which implies \( f(x) = 0 \), and we are not interested in the trivial solution, or
$$ e^{2\sqrt{\lambda}L} = 1 \quad \Rightarrow \quad 2\sqrt{\lambda}L = \ln 1 = 0 $$Therefore there is no nonzero solution in this case.
ii) \( \lambda = 0 \)
$$ k = 0 \quad \Rightarrow \quad f''(x) = 0 $$ $$ \therefore \, f(x) = c_1 x + c_2 $$ $$ f(0) = c_2 = 0 $$ $$ f(L) = c_1 L = 0 \quad \Rightarrow \quad c_1 = 0 $$Hence \( f(x) = 0 \), and there is again no nontrivial solution.
iii) \( \lambda < 0 \)
$$ k = \pm i\sqrt{-\lambda} \quad |\lambda| = - \lambda $$Let \( \lambda = -b^2 \) where \( b \ge 0 \)
$$ f(x) = c_1 e^{i b x} + c_2 e^{-i b x} $$ $$ f(0) = c_1 + c_2 = 0 \quad \Rightarrow \quad c_1 = -c_2 $$ $$ f(L) = c_1 \left( e^{i b L} - e^{-i b L} \right) = 0 $$This holds if and only if either \( c_1 = 0 \), which implies the trivial solution, or
$$ e^{2 i b L} = 1 $$Recall that
$$ e^{ix} = 1 \Leftrightarrow x = 2\pi n, \quad n \in \mathbb{Z} $$since
$$ e^{ix} = \cos x + i\sin x $$ $$ \sin(2\pi n) = 0, \quad \cos(2\pi n) = 1 $$Therefore,
$$ 2bL = 2\pi n $$so
$$ b = \frac{n\pi}{L} $$where \( n \) is a non-negative integer, since we defined \( b \ge 0 \)
$$ \lambda_n = -\left(\frac{n\pi}{L}\right)^2, \quad n = 0, 1, 2, ... $$Then
$$ f(x) = c_1 \left( e^{ibx} - e^{-ibx} \right) = 2c_1 i \sin(bx) $$ $$ = 2c_1 i \sin\left(\frac{n\pi x}{L}\right) $$For a real solution, let \( \displaystyle c_1 = \frac{a}{2i}, \) where \( a \) is a real constant. Then
$$ f_n(x) = a_n \sin\left(\frac{n\pi x}{L}\right) $$\( n = 0 \) gives \( f(x) = 0 \), and we can see more clearly why \( n \) is non-negative; since \( \sin(-x) = - \sin x \), \( n < 0 \) does not produce new solutions, since the sign can be absorbed into the constant coefficients. Hence \( n \) is a positive integer
The boundary conditions therefore quantize the allowed spatial modes:
$$ \lambda_n = -\left(\frac{n\pi}{L}\right)^2, \quad n = 1, 2, 3, ... $$The time equation is
$$ g''(t) = c^2 \lambda_n g(t) $$ $$ g''(t) = -\left(\frac{n\pi c}{L}\right)^2 g(t) $$so
$$ g_n(t) = b_{n,1}\cos\left(\frac{n\pi ct}{L}\right) + b_{n,2}\sin\left(\frac{n\pi ct}{L}\right) $$Therefore
$$ u_n(x,t) = \left( b_{n,1}\cos\left(\frac{n\pi ct}{L}\right) + b_{n,2}\sin\left(\frac{n\pi ct}{L}\right) \right) \sin\left(\frac{n\pi x}{L}\right) $$By superposition, the most general solution is
$$ u(x,t) = \sum_{n=1}^{\infty} u_n(x,t) $$ $$ \therefore \, u(x,t) = \sum_{n=1}^{\infty} \left( b_{n,1}\cos\left(\frac{n\pi ct}{L}\right) + b_{n,2}\sin\left(\frac{n\pi ct}{L}\right) \right) \sin\left(\frac{n\pi x}{L}\right) $$It's easier to do iii) in the trig function approach, I just used complex exponentials to be explicit
\( \lambda < 0 \), let \( \lambda = -b^2 \) where \( b \ge 0 \)
$$ \Rightarrow \quad f(x) = c_1 \sin(bx) + c_2 \cos(bx) $$ $$ f(0) = c_2 = 0 $$ $$ f(L) = c_1 \sin(bL) = 0 $$ $$ bL = n\pi, \quad n \in \mathbb{Z}^+ $$ $$ \lambda_n = -\left(\frac{n\pi}{L}\right)^2 $$ $$ f_n(x) = a_n \sin\left(\frac{n\pi x}{L}\right) $$