ODE) $y'' + 2y' = 1 + t^2 + e^{-2t}$ I'm stuck with the ODE problem:
$y'' + 2y' = 1 + t^2 + e^{-2t}$
This problem is in "judicious guessing" chapter of Braun's "Differential Equations and Their Applications".
The trick he taught in the chapter is to set $\psi$ = $A_0 + A_1 t + ... A_n t^n$ and determine constant terms. Also, he taught the technique to deal with such equations as $(1+t+t^3)e^5t$. 
But, he is never explicit as to equations with the above form. I tried several tricks, but they don't work. Can anybody help with this?
Thanks.
 A: you can integrate both sides to get a first differential equation as follow:
$$y'+2y=t+t^3/3-1/2e^{-2t}+C$$
and you can find the $C$ from the boundary condition 
A: The general solution $y$ is equal to $y_c+y_p$, where $y_c$ is the solution of the homogeneous equation, $y_p$ is a particular solution of the nonhomogeneous equation.
For $y_c$, set up the characteristic equation $r^2+2r=0$. This will give you $y_c$.
For $y_p$, separate the right hand side into two parts $1+t^2$ and $e^{-2t}$ and use superposition principle.
For the $1+t^2$, since constant is also a solution for the homogeneous equation, you can use $t(A+Bt+Ct^2)$ as your undetermined function.
For $e^{-2t}$ though, it is also a solution of the homogeneous part, so you need to try $Ate^{-2t}$. If that fails, $At^2e^{-2t}$, and so on.
A: First calculate the solution of the homogeneous problem $y''+2y'=0$, the characteristic equation is $m^2+2m=0\Rightarrow m=0,-2$, so $y_c=A+Be^{-2t}$. We want to find $y=y_c+y_p$ that solves the full problem, so we just need to find $y_p$, if the right hand side contains a polynomial of some degree, then the ansatz must contain a polynomial of that degree as well, similarly for exponential or trigonometric functions as well. But consider the case where $y_c$ already contains a polynomial of the same degree as the right hand side, or an exponential function that is in the right hand side etc. This is the case that we have: $y_c$ contains $Ae^{-2t}$, and the right hand side contains $e^{-2t}$, this tells us that $(e^{-2t})''+2(e^{-2t})'=0$, so if we try an ansatz for $y_p$ containing $e^{-2t}$, we will get a zero when plugging into the ODE, but we want $e^{-2t}$ to appear, so we multiply by $t$, since then $$(te^{-2t})''+2(te^{-2t})'=t((e^{-2t})''+2(e^{-2t})')-2e^{-2t}=-2e^{-2t},$$
now if we choose the right constant $Cte^{-2t}$ will give us what we want.
To deal with the polynomial, the ansatz must contain a polynomial of degree 3, i.e. $t(D+Et+Ft^2)$, so overall we set $$y_p=Cte^{-2t}+t(D+Et+Ft^2).$$
