Find the genereal solution of the second order nonhomogenous differential eq? Find the general solution of the second order nonhomogeneous differential equation
$$y''+2y'-3y=x^2e^x + 3xe^x$$
so what I cant figure out here is what is $y_p$, and how do I find it?? I guess I will have to find it separately for $x^2e^x$ and $3xe^x$ (so I will have to find two $y_p$'s?) and then solve it like it was two separate equation with each respective term on the right side and then just add the particular solutions together with the general solution?
 A: Hints:
You have the complementary (homogeneous) solution as:
$$y_c(x) = c_1 e^{-3x} + c_2 e^x$$
Since we have a coincident term (note we have the ODE solution yielding $x e^x(x+3)$, so our homogeneous has a 'common' $e^x$ term in it with the solution) with the homogeneous solution, choose:
$$y_p(x) = xe^x(a + bx + cx^2)$$
The derivatives yield:


*

*$y'_p(x) = e^x \left(a+b x+c x^2\right)+e^x x \left(a+b x+c x^2\right)+e^x x (b+2 c x)$

*$y''_p(x) = e^x x \left(a+b x+c x^2\right)+2 e^x \left(a+b x+c x^2\right)+2 e^x x (b+2 c x)+2 e^x (b+2 c x)+2 c e^x x$


Substitute these into the ODE (do not forget the constants in the ODE to multiply the above with) and solve for the constants, which yield:
$$a = -\dfrac{5}{32}, b = \dfrac{5}{16}, c = \dfrac{1}{12}$$
Write the final solution:
$$y(x) = y_c(x) + y_p(x)$$
Update
When you substitute in $y'', 2y', -3y'$, you should end up with:
$$2 e^x (2 a + b + 4 b x + 3 c x (1 + 2 x)) = x^2e^x + 3xe^x$$
We eliminate the exponential and then equate terms:
$$2 (2 a + b + 4 b x + 3 c x (1 + 2 x)) = x^2 + 3x$$
We have:
$$4 a + 2b = 0, 8 b + 6c = 3, 12 c = 1$$
this yields the numbers above.
