<s>[INST] Solve $y''-3y'+2y=x^2$ Solve $$y''-3y'+2y=x^2$$
My approach:
Homogen solution:
$$y = Ae^x +Be^{2x}$$
Particular solution:
$$ y_p = x(Ax^2+Bx+C) = Ax^3+Bx^2+Cx $$
$$ y_p' = 3Ax^2 + 2Bx + C$$
$$y_p'' = 6Ax + 2B$$
Put his into the initial equartion to get A, B and C gives me:
$A=0, B=1/2, C=3/2$
This leads me to the answer:
$$y = Ae^x +Be^{2x}  + x^2/2 + 3x/2$$
However the correct answer is
$$y = Ae^x +Be^{2x}  + x^2/2 + 3x/2+ 7/4$$
Where's my miss? Where comes the last term from?
 [/INST] The highest order of the $y_{p}$ solution is 2. Taking any higher terms will lead to zero being the value of those coefficients. In this view 
\begin{align}
y_{p} = a x^{2} + b x + c
\end{align}
for which $y_{p}^{'} = 2 a x + b$, $y_{p}^{''} = 2a$. Now, 
\begin{align}
2a - 6a x - 3b + 2a x^{2} + 2b x + 2c = x^{2}
\end{align}
or
\begin{align}
(2a -1) x^{2} + 2(b-3a) x + (2a - 3b + 2c) = 0.
\end{align}
solving each of the coefficient equations leads to $a= 1/2$, $b = 3/2$ and $c= 7/4$. This leads to the solution 
\begin{align}
y_{p}(x) = \frac{x^{2}}{2} + \frac{3 x}{2} + \frac{7}{4}.
\end{align}
</s>