D-operator-methods Solve the following differential equation:
$$(D^2-2D+1)y=x^2e^{3x}$$
I found the $C.F.=(c_1+c_2x)e^x$
$$\begin{align}
P.I. & =\frac{x^2e^{3x}}{(D^2-2D+1)}\\
& =e^{3x}\frac{x^2}{(D+3)^2-2(D+3)+1}\\
& =e^{3x}\frac{x^2}{D^2+6D+9-2D-6+1}\\
& =e^{3x}\frac{x^2}{D^2+4D+4}\\
& =\frac{e^{3x}}{4}x^2\left(1+\frac{D^2+4D}{4}\right)^{-1}\\
& =\frac{e^{3x}}{4}x^2\left(1-\frac{D^2+4D}{4}+........\right)\\
& =\frac{e^{3x}}{4}\left(x^2-\frac{2+8x}{4}\right)\\
& =\frac{e^{3x}}{4}\left(x^2-2x-\frac{1}{2}\right)\\
\end{align}$$
But in my book the P.I. is:
$$P.I.=\frac{1}{4}e^{3x}\left(x^2-2x+\frac{3}{2}\right)$$
I can't find my fault, please check this
 A: Your solution is missing a second order derivative term at this step

$$\frac{e^{3x}}{4}x^2\left(1-\frac{D^2+4D}{4}+........\right)$$

repeating the steps where $\text{C.F.}$ represents the homogeneous solution and $\text{P.I.}$ the particular solution
$$\begin{align}
\text{P.I.} & =\frac{x^2e^{3x}}{(D^2-2D+1)}\\
& =e^{3x}\left(\frac{1}{(D+3)^2-2(D+3)+1}\right)x^2\\
& =e^{3x}\left(\frac{1}{D^2+4D+4}\right)x^2\\
& =e^{3x}\left(\frac{1}{4\left[1+\dfrac{4D}{4}+\dfrac{D^2}{4}\right]}\right)x^2\\
& =\frac{e^{3x}}{4}\left(1+\left[D+\frac{D^2}{4}\right]\right)^{-1}x^2\\
& =\frac{e^{3x}}{4}\left(1-\left[D+\frac{D^2}{4}\right]+\left[D+\frac{D^2}{4}\right]^2\right)x^2\\
& =\frac{e^{3x}}{4}\left(1-D-\frac{D^2}{4}+D^2\right)x^2\quad \text{(we drop higher order derivatives)}\\
& =\frac{e^{3x}}{4}\left(1-D+\frac{3D^2}{4}\right)x^2\\
& =\frac{e^{3x}}{4}\left(x^2-2x+\frac{3}{2}\right)\\
\end{align}$$
which forms the general solution
$$y=y_c+y_p=\text{C.F.}+\text{P.I.}=c_1e^x+c_2xe^x+\frac{e^{3x}}{4}x^2-\frac{e^{3x}}{2}x+\frac{3e^{3x}}{8}$$
