Understanding this general solution to the wave equation Evaluating the wave equation $u_{tt} = c^2 u_{xx}$ on $x \in (0,L)$ and $t \in (0,\infty)$ my lecture notes say:

Let us assume that the solution is of the form $$u(x,t) = X(x)T(t)$$ with two functions $X:(0,L) \to \mathbb{R}$ and $T:(0,\infty) \to \mathbb{R}$.

My question is where did they get this from? I understand how the solution to the wave equation can be split into $u(x,t) = f(x+ct) + g(x-ct)$ with functions $f,g:\mathbb{R} \to \mathbb{R}$ but I can't see where they got $X(x)T(t)$ (my printed lecture notes don't contain any intermediate steps or many proofs and I missed a fair few lecture due to illness). Also my lecture notes then say:

Then we obtain $$X''(x) - \lambda X(x) = 0, \quad T''(t) - c^2 \lambda T(t) = 0.$$

And I can't see how he got this either? I can get the result $$X(x)T''(t) = c^2X''(x)T(t)$$ when I differentiate $u(x,t) = X(x)T(t)$ with respect to $t$ and $x$ twice and then substitute back into the wave equation but I can't see where $\lambda$ comes from? It just appears with no explanation? Any help would be appreciated! 
 A: First, the separation of variables (a common technique) is an assumption that does not hold true for all of the solutions. Instead, it is only there to find a certain kind of simple solution (namely, the separable ones), and from there we can build more solutions by linearity (every linear combination of solutions will also be a solution, by linearity). Indeed, these linear combinations cannot generally themselves be expressed in the separated form, like how $a+b$ cannot be expressed as $f(a)g(b)$.
Second, the idea is separate into two sides:
$$\frac{T''(t)}{T(t)}=c^2\frac{X''(x)}{X(x)}=?$$
Notice that the LHS is a function of $t$ and does not depend on $x$, while likewise the middle is a function purely of $x$ and does not depend on $t$. Thus both sides do no depend on either $t$ or $x$; it is a fixed constant. Call the constant $c^2\lambda$ and put it where the $?$ is. After that, turn it into two separate equations and clear the denominators again to obtain $T''=c^2\lambda T$ and $X''=\lambda X$.
