Short (well...) version of the question
I am having a bit of a problem understanding one thing about the solution to non-homgeneous second-degree linear differential equations using the constant coefficients method.
Given a DE of the form: $$ a_2y''+a_1y'+a_0y=f(x) $$ where $f(x)$ is some polynomial of degree $n$ in $x$, the solution that can be tried is $$ y_p=x^m A_n(x) $$ where $y_p$ is the particular solution, $A_n$ an $n$-degree polynomial in $x$ and $m$ is 0, 1 or 2. It's the choice of $m$ I don't get. My book says that
$m$ is the smallest of the integers 0, 1 and 2, that ensures that no term of $y_p$ is a solution of the corresponding homogeneous equation $$ a_2y''+a_1y'+a_0y=0.$$
What does this mean? How do I choose $m$? How do I check this? What is the intuition?
I'm guessing there is a (somewhat) easy and (hopefully) intuitive explanation, but I haven't found one.
An example
As an example, consider the DE $$ y''+y'=2x $$ where the homogeneous solution is $$ y_h=c_1e^{-x}+c_2. $$
For the particular solution, I need to use $m=1$ it seems. That is, $$ y_p=x(b_0+b_1x). $$ which yields $$ y_p=x^2-2x. $$ However, my way of thinking is that I would rewrite the DE as $$ y'+y=x^2+C $$ giving $$ \begin{align} y_p&=b_0+b_1x+b_2x^2\\ y_p'&=b_1+2b_2x^2\\ &\begin{cases}b_0&=2\\b_1&=-2\\b_2&=1 \end{cases} \end{align} $$ and for this to be the same as the solution above, I'd like $b_0$ to be 0. But it isn't. Is my thinking here wrong? Is this constant sort of accounted for in the general solution because of the $c_2$ constant? Or what is the motivation for multiplying the polynomial in the solution by $x$ here (i.e. why is $m=1$)?
Sorry for the wall of text... Thanks for reading.
Multiplication by $x$ or $x^2$ is necessary when your trial solution is already a solution of the homogenous system.
If '$y_P(x)$' is a solution of the homogenous system then it can't output $f(x)$ when you substitute it in because it will produce zero.