Solve the differential equation $$(D^3-3D^2+4D-2)y = (e^x +\cos x)\,,$$ where $D = \dfrac{\mathrm{d}}{\mathrm{d}x}$.
Here, for $e^x$, we place coefficient of $x$ in place of $D$ which is $1$ but $D=1$ is solution for given equation. So how to solve this for particular integral?
$$(D^3-3D^2+4D-2)y = \cos x$$ For this particular integral: $$y_p =\dfrac 1 {(D^3-3D^2+4D-2)} \cos x$$ $$y_p =\dfrac 1 {3D+1} \cos x$$ $$y_p =\dfrac {3D-1} {9D^2-1} \cos x$$ $$-10y_p = ({3D-1}) \cos x$$ $$-10y_p =-3\sin x -\cos x$$ $$y_p =\dfrac {3\sin x +\cos x}{10}$$
$$(D^3-3D^2+4D-2)y = e^x$$ For this particular integral: $$y_p =\dfrac 1 {(D-1)(D^2-2D+2)}e^x$$ $$y_p =\dfrac 1 {(D-1)}e^x=e^x\dfrac 1 {D}1$$ $$ \implies y_p =xe^x$$
Finally the particular integral is: $$\boxed {y_p =\dfrac {3\sin x +\cos x}{10}+xe^x}$$