Arriving at a particular solution of the ODE $y''-2y'-2y=\sin x$ If we have an ODE: $(D^2-2D-2)y=\sin x$ then it may be observed that $y=\frac 1{13}(2\cos x -3\sin x)$ is a particular solution of the ODE. It can be found using undetermined coefficients method. I'm trying to find the particular solution using operator's method. I did the following: Let $a:=1+\sqrt 3, b:=1-\sqrt 3$ so that $D^2-2D-2=(D-a)(D-b)$.
\begin{align*}
y&=\frac 1{D-a}.\frac 1{D-b}\sin x\\&=\frac 1{2(D-a)}\Re\left[\frac 1{iD-ib}.(e^{ix}-e^{-ix})\right]\\&=\frac 1{2(D-a)}.\Re\left[\frac 1{-1-ib}e^{ix}+\frac 1{-1+ib}e^{-ix}\right]\\&=\frac 1{2(D-a)}\Re\left[ -2 \Re\left(\frac{e^{ix}}{1+ib}\right) \right]\\&=\frac {-2}{1+b^2}.\frac 1{2(D-a)}(\cos x+b\sin x).
\end{align*} etc.
Continuation is possible but this is getting tedious. I saw the following solution then and in the solution, I didn't understand the red highlighted parts:
\begin{align*}
y&=\frac 1{\color{red}{D^2}-2D-2} \sin x\\&=\frac 1{\color {red}{-1}-2D-2}\sin x\\& =\frac 1{-2D-3}\sin x=-\frac 1{2D+3}\sin x\\&=-\frac {2D-3}{4\color{red}{D^2}-9}\sin x=-\frac {2D-3}{4(\color{red}{-1})-9}\sin x=\frac 1{13} (2D-3)\sin x.
\end{align*}
I tried to prove the red highlighted part as follows:
Suppose that in general we have $p(D)y=\sin x$, where $p(D)$ is a polynomial operator in $D$. If $p$ has only even degree terms then: $D^2\sin x=(-1)\sin x,..., (D^2)^k\sin x=(-1)^k\sin x$. So $p(D)\sin x=p(-1)\sin x\implies \frac {\sin x}{p(D)}=\frac {\sin x}{p(-1)}$, assuming $p(-1)\ne 0$. It follows that $y=\color{blue}{\frac{\sin x}{p(-1)}}$.
Can anyone please help me to establish the result similar to the one highlighted in blue, in case $p$ happens to contain odd powered terms along with the even powered ones? Thanks.
 A: In principle your approach is correct, but the parametrization is wrong, especially where you use $p(-1)$. The operator polynomial $p(D)$ needs to be split into even and odd parts as $p(D)=p_e(D^2)+Dp_o(D^2)$ to isolate the squares of $D$ so that then you can transform under $(D^2+1)\sin(x)=0$ as
$$
\frac1{p(D)}=\frac1{p_e(-1)+Dp_o(-1)}
=\frac{p_e(-1)-Dp_o(-1)}{p_e(-1)^2-D^2p_o(-1)^2}
=\frac{p_e(-1)-Dp_o(-1)}{p_e(-1)^2+p_o(-1)^2}
$$
For $p(x)=x^2-2x-2$ one has $p_e(u)=u-2$ and $p_o(u)=-2$, so that the last fraction becomes
$$
\frac{-3+2D}{(-3)^2+(-2)^2}=\frac{2D-3}{13}.
$$
A: With the help of the Laplace transform (an operator procedure) we can obtain easily a particular solution as follows. After transforming we have according to your calculations
$$
Y(s) = \frac{1}{(s+a)(s+b)}\frac{1}{s^2+1}=\frac{c_1}{s+a}+\frac{c_2}{s+b}+\frac{c_3 s+c_4}{s^2+1} = Y_h(s)+Y_p(s)
$$
here $Y_h(s)$ is the homogeneous component Laplace transform because contains the operator roots, and $Y_p(s)$ is a particular solution where
$$
\cases{
Y_h(s) = \frac{c_1}{s+a}+\frac{c_2}{s+b}\\
Y_p(s) = \frac{c_3 s+c_4}{s^2+1}
}
$$
then inverting $Y_p(s)$ we have
$$
y_p(x) = c_3\cos x+c_4\sin x
$$
now the values for $c_3$ and $c_4$ are obtained by substitution into the complete ODE.
