<s>[INST] Finding a particular solution to a differential equation what is the particular solution for the following differential equation?
$$D^3 (D^2+D+1)(D^2+1)(D^2-3D+2)y=x^3+\cos\left(\frac{\sqrt{3}}2x \right)+xe^{2x}+\cos(x)$$
I tried Undetermined Coefficients and it took so long to solve it,not to mention it was on an exam. I was wondering if there could be any faster and simpler solution. 
 [/INST] Because this is an equation with constant coefficients, this in principle can be attacked using a Laplace transform.  Here, for the sake of simplicity, I will assume that $y(0)$ and the first eight derivatives of $y$ at $x=0$ are zero.  Then the Laplace transform of $y(x)$, $Y(p)$, is
$$\begin{align} Y(p) &= \left [ \frac{6}{p^4}+\frac{p}{p^2+1}+\frac{p}{p^2+\frac{3}{4}}+\frac{1}{(p-2)^2}\right ] \frac1{p^3 (p^2+p+1) (p^2+1) (p-2) (p-1)}\\ &= \frac{8 p^9-28 p^8+39 p^7+3 p^6-68 p^5+141 p^4-168 p^3+186 p^2-72 p+72}{ p^7 (p-1) (p-2)^3 \left(p^2+1\right)^2 \left(4 p^2+3\right)(p^2+p+1)} \end{align}$$
Inverting this Laplace Transform, as one might expect, will be an extremely messy business but is indeed possible by using the definition of the inverse LT and the Residue Theorem.  The poles, their orders, and their residues are as follows:
$$\begin{array} \\ \text{pole} & \text{order} & \text{residue} \\ 0 & 7 & \frac{1}{960} \left(4 x^6+12 x^5-90 x^4+300 x^3+1950 x^2+310 x+125\right) \\ (i, -i) & 2 & \frac{1}{500} ((25 x+502) \sin{x}+(75 x+761) \cos{x}) \\ 1 & 1 & -\frac{113}{84} e^x \\ 2 & 3 & \frac{ 1}{52136000} \left(93100 x^2-747460 x+1929133\right) e^{2 x} \\ \left ( e^{i 2 \pi/3},e^{i 4 \pi/3} \right ) & 1 & \frac{1}{13377} \left( 13045 \sqrt{3} \sin \left(\frac{\sqrt{3} x}{2}\right)-9883 \cos \left(\frac{\sqrt{3} x}{2}\right) \right) e^{-x/2} \\ \left ( i \frac{\sqrt{3}}{2},- i \frac{\sqrt{3}}{2}\right ) & 1 & \frac{512 }{15561} \left(12 \cos \left(\frac{\sqrt{3} x}{2}\right)-41 \sqrt{3} \sin \left(\frac{\sqrt{3} x}{2}\right)\right)\end{array} $$
$y(x)$ is simply the sum of the residues in the right column of the above table.
</s>