I am trying to solve the following equation,
$$ E_0 u_{xx} - \rho u_{tt} = A e^{ikx-i\omega t} e^{i\delta x} $$
I am wondering if I can directly assume the particular solution to be of the form $u_p=Be^{ikx-i\omega t}e^{i\delta x}$ and balance the coefficients to find the B in terms of A? Or if this approach is flawed then, how do I go about solving it?
This problem is from the book and has a solution which is here
For an inhomogeneous linear differential equation (partial or ordinary) of the form $\mathrm Lu=f$, where $\mathrm L$ is a differential operator and where $f$ is in a vector space of functions invariant under $L$, there is a particular solution in that space of functions. For instance, the functions of the type $A\cos(x)+B\sin(x)$ form a vector space invariant under $\frac{\mathrm d}{\mathrm dx}+\mathrm{id}$, and so the inhomogeneous ODE $u'+u=\cos(x)$ has a particular solution of the form $A\cos(x)+B\sin(x)$: It is $\frac12\cos(x)+\frac12\sin(x)$.
The reason is somewhat circular: a subspace $W$ being invariant under a linear map $L$ means precisely that every element of $W$ can be written as $Lw$ for some other element $w\in W$ (and that no other elements can be written that way). But it helps to frame your thinking the right way.
Now there are several classes of functions invariant under $E_0\partial_{xx}-\rho\partial_{tt}$. Some examples:
Any time the inhomogeneous part of your PDE is in such a space of functions, you can take a general element of that class as your ansatz for a particular solution. In this case we can see that the inhomogeneous part can be written as $A\mathrm e^{\mathrm i(Kx-\omega t)}$, where $K=k+\delta$, and this already spans a 1d vector space invariant under $E_0\partial_{xx}-\rho\partial_{tt}$. Applying that operator yields $(-E_0K^2-\rho\omega^2)A\mathrm e^{\mathrm i(Kx-\omega t)}$, which is just a multiple of the original inhomogeneous part and thus in the same vector space. So our ansatz for the particular solution should be a general function from that invariant space, which is what you did.
Some more examples for this type of ansatz: