Consider the PDE
$c^{2} y_{xx} = y_{tt} + 2 \gamma y_{t}$
(this is a wave equation with damping). If $\gamma$ is spatially varying, and so dependent on $x$, I can't see a clear way to separate the PDE. That is, if I try solutions of the form
$y(x,t) = X(x) T(t)$
...then I can't rearrange the PDE to have the lhs depend only on $x$, and the rhs only on $t$.
BUT, if I assume a time dependence of the form
$y(x,t) = X(x) \exp({\rm i} \omega t)$
then I end up with an ODE for $X$ that I can in principle solve (if only numerically):
$c^{2} X_{xx} = ( -\omega^{2} + {\rm i} \gamma \omega) X.$
Can someone explain what's going on here? My PDE doesn't seem to be amenable to traditional separation-of-variables, but separated-variable solutions nevertheless seem to exist.
the short answer would be, your putting more assumption on problem.
In separation-of-variables method, you just assume that function has form of $y(x,t)=X(x)T(t)$, and then you seek to reach 2 independent ODE for each variable. in this case you get : $$ c^2 \frac{X"(x)}{X(x)} = \frac{T"(t)}{T(t)} + 2 \gamma(x) \frac{T'(t)}{T(t)} \tag{1} $$ which seems inseparable!
but failing for finding a solution by separation-of variables method doesn't prove there's no solution in separated form.
in your specific case by assuming the form of $y(x,t) = X(x) e^{i\omega t}$, you put more assumption on solution. this assumption that made (1) an ODE for $x$, is assuming the format of : $$ \frac{T^{(k)}(t)}{T(t)} = C_k \in \mathbb{C} $$ for function $T(t)$.this make functionality of $t$ factorable from main PDE.
Note that the method your using is similar to Fourier transformation for this PDE with transformation on variable $t$.
and also Note that this equation is special case of Nonlinear Telegraph equation in which usually integral transformation seems an appropriate method to initially approach the problem.