Why is the "guess" solution for $3e^t$ $Ate^t$? I have a non homogenous equation from my exam $$y''+y'-2y=3e^t$$
And I am instructed to solve it using the method of undetermined coefficients. However, from this site I am told that an equation with the right hand side being in the form of $ae^{\beta t}$ my guess would be $Ae^{\beta t}$. I got this problem horrendously wrong and I was told that the guess should have been $Ate^t$. Why is this?
 A: Here's a way to solve the differential equation without "guessing".
The equation $y''+y'-2y=3e^t$ can be written
$(D+2)(D-1)y = 3 e^t,$
where $D$ is the differential operator $Du = u'$.
Setting $u = (D-1)y$ we thus have
$(D+2)u = 3 e^t.$
After multiplication with the (integrating) factor $e^{2t}$ we get
$e^{2t} (D+2)u = 3 e^{3t}.$
The left hand side can be rewritten as $D(e^{2t}u)$. Thus we have
$D(e^{2t}u) = 3 e^{3t}.$
Taking the anti-derivative of both sides then gives
$e^{2t}u = e^{3t} + A,$
where $A$ is some constant.
Thus we have $u = e^t + A e^{-2t}.$
Since $u = (D-1)y$ this gives $(D-1)y = e^t + A e^{-2t}.$ Multiplication with the (integrating) factor $e^{-t}$ gives $e^{-t} (D-1)y = 1 + A e^{-3t}.$ Again we can rewrite the left hand side, this time as $D(e^{-t}y)$. Thus we have $D(e^{-t}y) = 1 + A e^{-3t}.$ Taking the anti-derivative gives $e^{-t}y = t + A \frac{1}{-3} e^{-3t}$ so we end up with
$y = t e^t - \frac13 A e^{-2t}$
or, setting $C = \frac13 A,$
$$y = t e^t - C e^{-2t}.$$
Now try to trace what caused the factor $t$ in front of $e^t.$
A: The auxiliary equation $r^2+r-2=0$ has roots $r=-2$ and $r=1$. Thus, the solution to the homogenous differential equation is $y=Ae^{-2t}+Be^t$.  A guess of the form $y=Ce^t$ would only satisfy the homogenous equation. Notice that $Be^t$ and $3e^t$ are linearly dependent.
Since $n^{th}$ derivative of $y=Ate^t$ is $y^{(n)}=A(t+n)e^t$, this guess will work. Substituting it into the equation yields $A=1$. The solution to the original problem is 
$$y(t) = Ae^{-2t}+Be^t+te^t.$$
