Finding solutions of $y'''-4y''+5y'-2y=-x^2+5x+2$ Find all solutions of $$y'''-4y''+5y'-2y=-x^2+5x+2.$$
I know how to find the solutions of the corresponding homogenous differential equation $y'''-4y''+5y'-2y=0$. I've done that in the following way:
The characteristic equation is $$P(x) = x^3 - 4x^2 +5x-2=(x-1)^2(x-2).$$
So if we put $$f_1:x\mapsto e^x\\f_2:x\mapsto xe^x\\f_3:x\mapsto e^{2x}$$ then the solution basis is $$\{f_1, f_2, f_3\}$$ and all solutions are linear combinations of this basis.
However, I am not sure how to deal with the inhomogenous part of the differential equation.
Please share the general approach with me.

Use the method of undetermined coefficients. See second case here. You can try this out.
Essentially, you guess y looks like a polynomial e.g. $y = a_0+a_1x+a_2x^2+...+a_nx^n$ because that is what the RHS is. Then, plug in y.
So the question is what n to use?
Try 5. The highest order derivative is 3 and the degree of the RHS is 2. is y has $a_5x^5$ and is differentiated thrice, it will have an $x^2$. If it doesn't have a $x^5$, the coefficient will turn out $a_5=0$
