Undetermined Coefficients - Differential Equations

I am trying to prepare for Undertermined coefficients a portion of differential equations. I have learned insofar to finding a general solution and a particular solution, and setting up a system of equations.

I know that to find a general soltution we must first find a particular and complementary solution:

$$y = y_c + y_p$$

The problem is as follows:

$$y'' - 2y' + y = xe^x$$

I am inclined to use a particular solution

$$y_p = Ax^3e^x + Bx^2e^x$$

but I do not how to proceed, correctly from there. Could someone steer me on the right track? Perhaps show some methods of "good practice"?

• I can take two derivatives of $y_p$ and substitute..Or use $y=ue^x$ where $u$ represents a function, in this case, $Ax^3$? – cryptomath Jul 12 '17 at 17:52
• The form of your particular solution is a good one. All you need to do is substitute $y_p$ into the differential equation and solve for $A$ and $B$. Can you do that? – projectilemotion Jul 12 '17 at 17:57
• When I do take the first derivative, I end up with $$y'_p = Ax^2e^x(3+x) + Bxe^x(2+x)$$ – cryptomath Jul 12 '17 at 17:58
• I set $Ax^2e^x = 0$ and $Bxe^x = xe^x, => B = 1$ – cryptomath Jul 12 '17 at 18:00
• After substituting $y_p$, $y_p'$ and $y_p''$ into the ODE and simplifying, I get $6Ae^x x+2Be^x=e^x x$. – projectilemotion Jul 12 '17 at 18:05