Inverse Operator Methods for Differential Equations We have learned in class how to use inverse operator methods to solve ODE's (i.e. with the symbolic $D$). E.g, 
If I were asked to find a particular solution, $y_p$ to $(D-1)(D-2)[y] = x^{2}e^{x}$, then I would use the formula $\frac{g(x)}{D-a} = e^{ax} \int e^{-ax} g(x) dx$, where $g(x) = x^2 e^x$.
However, here's the difficulty I'm facing; all the ODE's that we have learned in class with operator methods have been dealing with constant coefficient ODEs, what happens when you have variable coefficients?
E.g. the ODE $xy'' +(2x -1)y' - 2y = x^2$ factorises to $(xD-1)(D+2)[y] = x^2$, so a particular solution $y_p$ should be $y_p$ = $\frac{x^2}{(xD-1)(D+2)}$. I can use the method outlined above for the $D+2$ bit, but what about $\frac{1}{xD-1}$?
What does the inverse operator $\frac{1}{xD-1}$ mean?
Thanks,
Ben
 A: The reason you can write
$$\frac{g(x)}{D-a}=\mathrm{e}^{ax}\int\mathrm{e}^{-ax}g(x)\mathrm{d}x$$
is that
$$(D-a)\mathrm{e}^{ax}=0$$
and therefore
$$(D-a)\left(\mathrm{e}^{ax}\int\mathrm{e}^{-ax}g(x)\mathrm{d}x\right)=g(x)\;.$$
You can generalize this for any operator of the form $s(x)D-t(x)$ (where in the above case $s(x)=1$ and $t(x)=a$): if you can find $h(x)$ with $(sD-t)h=0$, then the ansatz
$$
\begin{eqnarray}
(sD-t)\left(h\int gn\mathrm{d}x\right)=shD\int gn\mathrm{d}x=shgn\stackrel{!}{=}g
\end{eqnarray}$$
leads to
$$n=\frac{1}{sh}$$
and thus to
$$\frac{g}{sD-t}=h\int \frac{g}{sh}\mathrm{d}x\;.$$
For instance, if we generalize your case slightly to inverting $xD-a$, i.e. $s=x$ and $t=a$, then $h$ must satisfy $(xD-a)h=0$. That leads to $h=x^a$, and thus to
$$\frac{g}{xD-a}=x^a\int x^{-a-1} g\mathrm{d}x\;.$$
A: First of all, these operators don't commute when there are nonconstant coefficients, so be careful about the orders you put them in.  If $(xD - 1)(D + 2) y = g$, that says $ (D+2) y = (xD - 1)^{-1} g$, and then $y = (D+2)^{-1} (xD - 1)^{-1} g$.  Now $(x D - 1)^{-1} g$ would be the solution of $(x D - 1) v = g$, namely $x \int \frac{g(x)}{x^2}\, dx$.
