I have a problem solving the undetermined coefficient problems. I know how to get the particular solution. But the algebra always messes me up.

The problem is:

y'' + 9y = t^2*e^3t + 6

The particular solution y particular = (At^2 + Bt + C)e^3t + D.

The next one is:

2y'' + 3y' + y = t^2 + 3sint

The particular solution y particular = (At^2 + Bt + C) + Asint + Bcost

This problem is an initial value problem:

y'' + 4y = 3sint2t, y(0) = 2, y'(0) = -1

The particular solution y particular was the same as the homogeneous solution so I added a factor t to the particular solution. So my y particular was: t(Asin2t + Bcos2t).

Tell me if these particular solutions are correct. My main problem was to solve for the constants like A, B, and even C. Can you show the step of how I can solve this. Even though I collected the terms but I get a strange equation that equals to the g(t).