> [!NOTE] > Consider the [[Wave Equation in 1 Spatial Dimension|1D wave equation]] with Dirichlet boundary conditions $\begin{align} \partial_{t}^2u(x,t) &= \partial_{x}^2u(x,t), & (x,t)\in (0,\pi) \times (0,\infty), \\ > u(0,t) &= 0 = u(\pi,t), &t\in (0,\infty). > \end{align}$Assuming the solution has the form $u(x,t)=X(x)T(t)$ where $X:(0,\pi)\to \mathbb{R}$ and $T :(0,\infty)\to \mathbb{R}$, then $u(x,t)=\sum_{k\in \mathbb{N}} (A_{k}\sin(kt)+B_{k}\cos(kt))\sin(kx)$for some $A_{k},B_{k},C_{k}\in \mathbb{R}$. ###### Proof: Under this assumption, the wave equation reads $T''(t)X(x)=T(t)X''(x)\quad\Rightarrow\quad\frac{T''(t)}{T(t)}=\frac{X''(x)}{X(x)}:=\lambda$provided that we can divide. But $\lambda$ doesn't depend on $x$ since the first expression depends on $t$ only and doesn't depend on $t$ since the second expression depends on $x$ only, hence $\lambda$ is constant since it doesn't depend on any variable. Now we obtain $X''(x)-\lambda X(x)=0,\quad T''(t)-\lambda T(t)=0.\tag{1}$ The boundary conditions $0=u(0,t)=X(0)T(t)$ and $0=u(\pi,t)=X(\pi)T(t)$ for all $t$ are satisfied if $X(0)=0$ and $X(\pi)=0.$ Multiplying the first equation of $(1)$ with $-X$ and integrating with respect to x from 0 to $\pi$ and applying [[Integration by Parts]] yields $\begin{align}\text{0}&=\int_{0}^{\pi}\left(-X^{\prime\prime}(x)X(x)+\lambda|X(x)|^{2}\right)dx\\&=-X^{\prime}(\pi)\underbrace{X(\pi)}_{=0}+X^{\prime}(0)\underbrace{X(0)}_{=0}+\int_{0}^{\pi}|X^{\prime}(x)|^{2} \, dx +\int_{0}^\pi \lambda|X(x)|^{2}dx\\&=\int_{0}^{\pi}|X^{\prime}(x)|^{2}dx+\lambda\int_{0}^{\pi}|X(x)|^{2}dx.\tag{2} \end{align}$ If $\lambda>0$ then $\int_0^\pi |X(x)|^2dx=0$ so that $X(x)=0$ for all $x\in(0,\pi).$ But then $u=0$ and we have no chance to take any non-trivial initial conditions into account. Similarly, if $\lambda=0$ then $\int_0^\pi|X^\prime|^2dx=0$ so that $X^\prime(x)=0$, whence $X(x)$ is a constant function. But since $X(0)=0$ this constant is zero so that $u=0$ again. Therefore, let us assume that $\lambda<0$ and write $\lambda=-\beta^2$ with some $\beta\in(0,\infty)$ to obtain from $(1)$ that$X''(x)+\beta^2X(x)=0,\quad T''(t)+\beta^2T(t)=0.$ Applying [[Solution to homogenous 2nd order linear scalar ODE with real coefficients]] Solutions to these ODEs are of the form $(A,B,C,D\in\mathbb{R}$ are coefficients) $X(x)=C\cos(\beta x)+D\sin(\beta x),\quad T(t)=A\cos(\beta t)+B\sin(\beta t).\tag{3}$ From the boundary condition $X(0)=0$ we infer $C=0.$ Avoiding that $X=0$ (and, thus, $u=0)$requires that $D\neq0.$ The other boundary condition $0=X(\pi)=D\sin(\beta\pi)$ requires that $\beta \pi = j\pi$, $j\in \mathbb{N} .$ Solutions to the $X$ equation satisfying the boundary condition $X(0)=X(\pi)=0$ read $X(x)=D\sin(jx),\quad D\in\mathbb{R},j\in\mathbb{N}.$ Replacing $\beta$ also in the general solution to the equation for $T$ yields $T(t)=A\cos(jt)+B\sin(jt)$ and thus the solution $u_j(x,t)=X(x)T(t)=\begin{pmatrix}A_j\cos(jt)+B_j\sin(jt)\end{pmatrix}\sin(jx),\quad A_j,B_j\in\mathbb{R}.$ Here we have absorbed $D$ into $A$ and $B$, which also have got an index $j$ to indicate those coefficients that are associated with frequency $\beta=j.$ Indeed, using that the wave equation is linear the sum of such functions solves the wave equation again, and we obtain the following general form for the solution to the above IBVP $u(x,t)=\sum_{j\in\mathbb{N}}\left(A_j\cos(jt)+B_j\sin(jt)\right)\sin(jx).$