with $c = 1$ (if this is not the case, then we can set $t = \tau/c$ and this tells us that we can re-scale the equation so as to remove time). Separation of variables using $u = T(t)X(x)$ gives \[ \frac{T''}{T} = \frac{X''}{X} = -\lambda^2 > 0 \]

where we anticipate the right hand side to be zero so as to obtain oscillatory solutions in order to satisfy the boundary conditions (otherwise the trivial solution results). We now solve for $T$ using the initial condition $T'(0) = 0$, giving \[ T(t) = A \cos \lambda t. \]

Solving for $X$ using $X(0) = 0 = X(L)$ gives \[ X_n(x) = B_n \sin (\lambda_n x), \]

where we require the eigenvalues $\lambda_n = n\pi/L$ and $n = 1, 2, \ldots$. This gives the general solution \[ u(x,t) = \sum_{n=1}^\infty B_n \cos \frac{n\pi t}{L} \sin \frac{n\pi x}{L}. \]

The coefficients $B_n$ are found by requiring that the solution satisfies the initial condition. We calculate \begin{equation} \label{Bn} B_n = \frac{2}{L} \left[ \int_0^p \frac{hx}{p} \sin \frac{n\pi x}{L} \, \de{x} + \int_p^L h\frac{L - x}{L - p} \sin \frac{n\pi x}{L} \, \de{x}\right] = \frac{2h L^2}{n^2(L-p)p\pi^2} \sin \frac{np \pi}{L}, \end{equation}

after some work. The solution is illustrated in the two below figures for the particular case of $L = 2$, $p = 0.5$, $h = 1$, and using $N = 20$ modes.