Find a general solution to $y''+3y'+2y=12x^2$

Find a general solution to $y''+3y'+2y=12x^2$

My working out: Find the roots $$y^2+3y+2 = 0 \implies (y+1)(y+2)=0 \\ =c_1e^{-2x}+c_2e^{-x}$$ Using the method of undetermined coefficients, we have

$$r(x) = 12x^2 \implies y_p = K_2x^2 \\ y_p' = 2K_1x \\ y_p'' = 2K_0$$

Equating the coefficients $$K_2x^2+6K_1x+4K_0 = 12x^2$$

How do I proceed from here?

I know that if $K_1 = K_0 = 0$ I have $K_2x^2=12x^2$ however I don't know how to get the final answer from here which is $y_h+y_p = c_1e^{-2x}+c_2e^{-x}+6x^2-18x+21$?

Using the additional comment, here's what I have tried:

$y_p = K_2x^2 + K_1x + K_0 \\ y'_p = 2K_2x+K_1 \\ y'' = 2K_2$

$$\implies 2K_2+3(2K_2x+K_1) + 2(K_2x^2+K_1x+K_0) = 12x^2$$ We have that $$12+3K_1+2K_0 = 0 \\ 36x+2K_1=0 \\ \implies K_2 = 6, K_1 = -18, K_0 = 21$$


Solution 1:

You are 10 seconds away from the solution. Your mistake is assuming the wrong particular solution.

In general for particular solution,

$$ y_p=\sum_{i=0}^n K_nx^n, $$ where $n$ is the highest order of the polynomial.

$$ y_p=K_2x^2+K_1x+K_0 $$

Now, follow the above $y_p$,

$$ y_p^\prime=2K_2x+K_1\\ y_p^{\prime\prime}=2K_2 $$

Obviously $K_2=6$. We also have $2K_0+3K_1+2K_2=0$. There is one more equation, binding $K_2$ to $K_1$.

I hope this helps