Method of separation of variables to solve PDE