Can this method be used with variable coefficients?
No. Suppose we have a differential equation such as, We take the trail solution as,
Why do we take this exponential function as our trail solution? This is based on the realization that the exponential function keeps its original shape even after differentiation. That is even after taking the derivative you get a the same exponential function with a different coefficient. This is necessary to substract the two functions, . The same arguement is valid for any constant coefficient linear differential equation(either partial or ordinary). But when the equation is, taking the solution as is not justifiable since the equation is not a constant coefficient one. For more information refer, Linear differential equation - Wikipedia, the free encyclopedia
Hope this helps to clarify matters.