What is $\int_0^3 x^2e^{-x}\ dx$? Getting a different answer. So I was solving some papers and I came across this problem. The answer is supposed to be $2-17/e^3$, but I'm getting $1/e^3 + 2$. I'm not familiar with the formatting and am in a hurry so please excuse the poor formatting. Thanks in advance!

Using integration by parts to find the antiderivative, let $u=x^2$ and $dv=e^{-x}dx$. $du=2xdx$ and $v=-e^{-x}$. 
Thus, we have  $\int x^2e^{-x}= -x^2e^{-x}+ \int 2xe^{-x}$
We rinse and repeat and perform IBP again. This time, let $t=2x$, $dt=2dx$, $dz=e^{-x}dx$ and $z=-e^{-x}.$
Now we have  $\int x^2e^{-x}= -x^2e^{-x}+ \int 2xe^{-x}= -x^2e^{-x}-2xe^{-x}+2\int e^{-x}dx=-x^2e^{-x}-2xe^{-x}-2 e^{-x}=-e^{-x}(x^2+2x+2)$.
Now, we evaluate $$-e^{-x}(x^2+2x+2)]_0^3=-e^{-3}(3^2+2(3)+2)-(-e^{-0}(0^2+2(0)+2)=-e^{-3}(17)-(-2)=2-17e^{-3}$$
