The method of separation of variables is used in many occasions in the upper level physics courses such as QM and EM. But when it is used there is no clear reason why using it is permitted it except that it works, or that let us try and see.
Is there a theorem which provides the condition(s) that if satisfied then the method of separation of variables will be guaranteed to work in PDEs?