Question: Say we had $$y'' +2y' -8y = xe^{-x}.$$ For the particular solution, would it be wise to try $$y\_p(x) = (c\_1 + c\_2x)e^{-x}\quad or\quad y\_p(x) = c\_1xe^{-x}?$$ Similarly, we had $y'' +2y' -8y = x^2e^{-x}$ or $ y'' +2y' -8y = x^2cos(x)$ would it be wise to try $y\_p(x) = (c\_1 + c\_2x + c\_3x^2)e^{-x} $ and $y\_p(x) = (c\_1 + c\_2x + c\_2x^2)(\sin(x) + \cos(x))$?

Answer: 
A good criteria:

> 
> Let $a\_ny^{(n)}+a\_{n-1}y^{(n-1)}+\cdots+a\_1y'+a\_0y=Q(x)$ where $a\_n\neq0$ and $Q(x)$ is not zero in an interval $I$. If *No term* of $Q(x)$ is the same as a term of $y\_c(x)$, then the particular solution $y\_p(x)$ is a linear combination of the terms in $Q(x)$ and all its linearly independent derivatives.
> 
> 
> 

Here, we have $y\_c(x)=C\_1e^{2x}+C\_2e^{-4x}$ so according to what above point says we get: $$y\_p(x)=(Ae^x+Bxe^x)$$ Now we can use the [Undetermined coefficient method](http://en.wikipedia.org/wiki/Method_of_undetermined_coefficients) to find $A$ and $B$.
For the first RHS the particular solution is of the form $(c\_1+c\_2x)e^{-x}$.
For the second RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)e^{-x}$.
For the third RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)\sin(x)+(d\_1+d\_2x+d\_3x^2)\cos(x)$.