Why does the method of separating variables work?
One of the methods to solve a partial differential equation is to use separation of variables. For example, consider the heat equation: $$ u_t  a^2 u_{xx} = 0, \qquad 0 < x < L,\ 0 < t, $$ with the boundary conditions $$ u(0,t) = u(L,t) = 0, \qquad 0 < t, $$ and initial condition $$ u(x,0) = f(x). $$ To solve this PDE, we can start by assuming that the solution is of the form $u(x,t) = X(x) T(t)$ to get a pair of ordinary differential equations that need to be solved instead, namely \begin{align} X'' + \lambda X &= 0,\\ T' + \lambda a^2 T &= 0. \end{align} By applying the boundary conditions, we can get the possible values of $\lambda$. In this case, for each $n = 1, 2, 3, \dotsc$ we have $$ \lambda_n = (n \pi / L)^2, \quad X_n(x) = \sin (n\pi x/L), \quad T_n = b_n e^{(a n \pi/ L)^2 t} $$ for some constants $b_n$. Then, we say that the general solution is of the form $$ u(x,t) = \sum_{n = 1}^\infty u_n(x,t) = \sum_{n=1}^\infty X_n(x) T_n(t) = \sum_{n = 1}^\infty b_n e^{(an\pi/L)^2t}\sin(n\pi x/L). $$ Lastly, we apply the given initial condition and solve for the Fourier coefficients $b_n$.
Question: Why does this method happen to work at all?
Relatedly, are there general conditions based on which we can recognize that separating variables will work? And, how do we know that this method finds all possible solutions to the given PDE whenever it is applicable?
2 answers
I don't think there's a satisfying answer to this question currently. The very first problem – which is probably surprising – is that there isn't a widely accepted, general definition of "separation of variables".
An obvious approach to studying separation of variables would be to apply the techniques of Lie theory. This is what Miller does in "Symmetry and Separation of Variables" which is cited in the Wikipedia article. A quick look at the table of contents, however, does not exactly suggest a universal theory. In his book review, T. Koornwinder complained at the lack of definition of "separation of variables" in the book. He followed up by writing A Precise Definition of Separation of Variables. As far as I can tell, his definition is not widely adopted. I don't know that is due to any issue with his definition, or if mathematicians just don't care that much about a precise definition.
That said, the article states that it will give necessary and sufficient conditions for when separation of variables (in his sense) can be applied for linear homogeneous secondorder partial differential equations which may be of interest to you. Unfortunately, when I was recently looking for what Lie theory says about separation of variables, Miller's book still seems to be the main reference.
While you could use Koornwinder's conditions as an answer to your question of knowing when an equation is separable for a common class of PDEs, in practice, it's probably easier to simply assume a separable ansatz and see if you can separate the variables.
As to why it works, it's pretty simple: you are simply making some assumptions about the form of the solution. It may be that no solutions satisfy those assumptions, in which case you won't find any. For example, you could just as well have assumed $u(x,t)=X(x)$ and that would have worked, though it would give you a less complete set of solutions. On the other hand, you could have assumed $u(x,t)=T(t)$ and you would have found no solutions unless $f(x)$ was identically $0$.
To answer another of your questions, the assumption that the solution is separable does exclude other nonseparable solutions. For example, see On the Production of Nonseparable Solutions of Linear Partial Differential Equations and its citations. So the technique doesn't, in general, find all solutions. You would need to verify that the same way you would verify that you have all solutions to a differential equation no matter how you arrived at them. This is, of course, itself often not an easy problem.
You may be interested in reading these excellent lecture notes on the method of separation of variables by Steven Johnson.
Quick Overview of Key Takeaways
The notes highlight two main points:
 The method of separation of variables is applicable primarily in scenarios characterized by symmetry, such as time invariance, translational invariance, and rotational invariance. (For further insights on symmetry, see Derek's detailed answer.)
 Most analytically solvable partial differential equations (PDEs) are amenable to separation of variables.
Categories of Applicability:

Separation in Time: For timeinvariant linear PDEs of the form $\partial_tu = Au$, where $A$ is a timeindependent operator with a complete basis, the solution can be expressed as: $$ u(x,t) = \sum_n c_n(t) u_n(x) $$ Section 2.1 of the notes elaborates on the conventional teaching of separation of variables, which generally involves identifying the eigenfunctions of the operator $A$.

Separation in Space: This method is typically used in cases with special spatial symmetries, such as in domains shaped like a box, a ball, an infinite tube, or combinations of these.
1 comment thread