When can we assume that the wavefunction is separable While working out the stationary states of a single particle in a 3d infinite potential box ($V=0$ inside a cuboid of known dimensions, $V=\infty$ everywhere else), I realized I had to assume the wavefunction was separable into a product of three functions, $\psi(x,y,z)=X(x)Y(y)Z(z)$, in order to find $\psi$. Why is this so, and under what conditions? What guarantees me that I can do this? The text I'm following isn't particularly clear on this.
 A: Sepration of variables is indeed a delicate topic in partial differential equations. As of today we don't (to the extend of my knowledge) have a complete theory on the conditions that make it possible. The usual posture is to have existence and uniqueness theorems for the solutions of a given PDE and using some ansatz from separation of variables, by finding a general solution, we should have the solution as luming commented.
As far as I know, for specific cases we do have rigorous justification on using separation of variables in given coordinates, which are related to the symmetry group acting on the PDE (as BumbsterDoofus said also in comments). A (somewhat old) book explaining this is Miller's "Symmetry and Separation of Variables" that you can find online here http://www.ima.umn.edu/~miller/separationofvariables.html. As it says in the preface we do know how to justify for some PDEs (specially lower dimensional ones) but we do not have complete theory for all the differential equations we would like to consider (for instance the tridimensional wave equation). I do not know of further developments beyond Miller's book, but I have looked for it and have not found decisive changes (but that could be due to my ignorance).
In any case, as long as you're considering bound states I do not think you should be worried about those things, the existence and uniqueness theorems coupled with you being able to provide a general solution should suffice (I'm always suspicious of scattering states becaude they are not square-integrable and could be more subtle). If you're not satisfied with this answer, I guess it would make a great question on math stackexchange to ask for the status of separation of variables, though I think the answer relates to the symmetry group of the PDE in question anyway, and could be overkill for your context.
A: The logic goes like following.
We can guess solution in forms of $X(x) Y(y) Z(z)$ for a particle in 3-dimensional box. We can find such solutions. The question is, do we miss any solution?
The function $X(x)$ is eigenfunction of self-adjoint operator
$$H_x = -\frac{1}{2} \frac{ \partial^2}{\partial x^2} + V(x) \tag{1} $$
$V(x)$ is the potential of infinity wall. And the same for $y,z$. Thus they form a complete set of functions under suitable boundary condition. We expand the general form of solution as
$$ \psi(x,y,z) = \sum_{l} \sum_{m} \sum_{n} c_{lmn} X_l(x) Y_m(y) Z_n(z) \tag{2} $$
Since $[H_x,H]=0$, the eigenfunction of a particle in 3-dimensional box forms a simultaneous eigenstate as eigenfunction of $H_x$. We can drop $\sum_l$ and the $l$ dependence in the expansion coefficient $c_{clm}$ in Eq. (2). The same applies to $y$ and $z$. Therefore the eigenfunction of particle in three-dimensional box can be writen as $X(x) Y(y) Z(z)$ .
