# Wave equation - imposing boundary conditions

Assume we want to solve the following wave equation $$u_{tt} = u_{xx},$$ subjected to boundary conditions $u(0,t)=u(1,t) = 0$. Performing separation of variables, we obtain two ODEs, $$\ddot{T} = \lambda T, \quad \quad X'' = \lambda X.$$ Now, we usually impose the boundary conditions on $X(x)$ for fixed $\lambda$ and find that, to have a nontrivial solution, we must have $\lambda = - n^2 \pi^2$, for some positive integer $n$.

Wouldn't it, however, make more sense to write out the complete solution of the differential equation as a superposition of different $\lambda$-solutions and then impose the boundary conditions. For example, we would write $$u(x,t) = \sum_{\lambda \in \mathbb{R}^-} (A_\lambda \cos \sqrt{-\lambda}x + B_\lambda \sin(-\sqrt{\lambda}x))T_\lambda(t) + (A_0 t + B_0)T_0(t) + \sum_{\lambda \in \mathbb{R}^+}(\ldots).$$ Here $T_\lambda(t)$ is the corresponding solution of the temporal ODE, not relevant to the discussion of the boundary conditions. If we would now put $u(0,t)=u(1,t)=0$, how would we reach the same conclusion as before? How to rigorously prove that the only non-vanishing coefficient is $B_\lambda$ for $\lambda = - n^2 \pi^2$?

Wouldn't it, however, make more sense to write out the complete solution of the differential equation as a superposition of different $\lambda$-solutions and then impose the boundary conditions.

That wouldn't make more sense because you'd be applying the principle of superposition before you even knew you had multiple solutions.

$\dfrac{X''}X = \dfrac{\ddot T}T = \lambda$ means $\lambda$ must be some constant. When we analyze the case that $\lambda < 0$ we do see that we end up with infinitely many $\lambda_n$, one for each $n$. But before analyzing the case that $\lambda < 0$, for all we know there could be only one single $\lambda < 0$ that works at all. So applying the principle of superposition at this stage means we'd be assuming we have multiple solutions when it's still possible we have only one. In other words, we'd make an assumption that unnecessarily complicates our scenario. This is also evidenced by that relatively complicated expression for $u(x,t)$ in your question.

Try plugging $x=0$ into that expression and arriving at any sort of conclusion about the coefficients; it's extremely difficult if even possible at all. Analyzing the three cases separately may feel like more work than doing everything at once, but it's really doing three small pieces of relatively simple work vs. one large piece of probably impossible work.

• I am aware that $\lambda < 0$ is the only solution. I was asking whether it is possible to reach the same conclusion writing out the general solution as a sum over all $\lambda \in \mathbb{R}$ and then impose the boundary conditions. – user54031 May 23 '17 at 14:09
• @LBO, no, see my recent edits. The different cases of $\lambda$ can't be analyzed together because they can't be true at the same time. Getting the correct answer may still be possible but along the way you'd have to consider each case separately anyway. – tilper May 23 '17 at 14:23
• I disagree. Different signs of $\lambda$ are not mutually exclusive, given the right boundary conditions. Why? Because of the principle of superposition. Following your reasoning, even having two different values of negative $\lambda$ would not be compatible. However, this is just the superposition of two different harmonics. – user54031 May 23 '17 at 19:19
• @LBO, what BCs would give different signs of $\lambda$ within the same problem? If the BCs are $u(0,t) = g(t)$ and $u(1,t) = h(t)$, then the function $w(x,t) = (1-x)g(t) + xh(t)$ is introduced and the function $v(x,t) = u(x,t) - w(x,t)$ transforms the problem into one with homogeneous BCs, which always has $\lambda < 0$. – tilper May 23 '17 at 19:41
• Also, two different values of $\lambda <0$ are indeed not compatible. $\dfrac{X''}X = \dfrac{\ddot T}T = \lambda$ for only one value of $\lambda$. Later we find we have $\lambda_n$, one for each positive integer $n$. And corresponding to those are the eigenfunctions $X_n$ and $T_n$. So it still holds that for each $n$, there is only one value of $\lambda_n$ with $\dfrac{X_n''}{X_n}=\dfrac{\ddot T_n}{T_n}$. We could ask if $\lambda_n$ is positive, negative, or zero for different $n$, but the analysis done with the BCs shows that $\lambda_n$ must be negative for each $n$. – tilper May 23 '17 at 19:54