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!
 A: Notice, first apply product rule, $$\int x^2e^{-x}\ dx=x^2\int e^{-x}\ dx-\int\left(2x\int e^{-x}\ dx\right)dx$$
$$=-x^2e^{-x}+2\int xe^{-x}dx$$
$$=-x^2e^{-x}+2\left(x\int e^{-x}\ dx-\int\left(1\int e^{-x}\ dx\right)dx\right)$$
$$=-x^2e^{-x}+2\left(-xe^{-x}-e^{-x}\right)$$
$$=-(x^2+2x+2)e^{-x}+C$$
Now, apply the limits to get numerical value as follows
$$\int_0^3 x^2e^{-x}\ dx=\left[-(x^2+2x+2)e^{-x}+C\right]_0^3$$
$$=\left[-(9+6+2)e^{-3}-(-2)\right]$$
$$=-17e^{-3}+2$$ $$=\color{red}{2-\frac{17}{e^3}}$$
A: By undeterminate coefficients, let the antiderivative be $-(x^2+ax+b)e^{-x}$. 
We have
$$(-(x^2+ax+b)e^{-x})'=(x^2+ax+b-2x-a)e^{-x}$$ and it suffices to set $a=2,b=2$.
Then
$$\left.-(x^2+2x+2)\right|_0^3=-17e^{-3}+2.$$

Also,
$$\left(-(P(x)+P'(x)+P''(x)+\cdots P^{(d)}(x))e^{-x}\right)'=\left(-(P'(x)+P''(x)\cdots P^{(d)}(x))+(P(x)+P'(x)+P''(x)+\cdots P^{(d)}(x))\right)e^{-x}\\
=P(x)e^{-x}.$$
You add all the derivatives of the polynomial and change the sign.
A: Integrating your expression gives $-e^{-x}(x^2+2x+2) + c$ Then substitute 3 and subtract by substituting 0.
A: HINT Integration by parts 2 times, each time differentiate the polynomial and integrate the exponential function.
A: 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}$$
A: Using integration by part,
$$\int udv =  uv - \int vdu$$
$$ u = x^2 and dv = e^{-x}, v = -e^{-x} and du = 2xdx $$
$$\int x^2e^{-x}\ dx= -x^2e^{-x}+2\int xe^{-x}dx$$
$$=-x^2e^{-x}+2\left(-xe^{-x}-e^{-x}\right)$$
$$=-(x^2+2x+2)e^{-x}+C$$
Since your integration is that above, now let us add the upper and lower limit to the result;
$$\int_0^3 x^2e^{-x}\ dx=\left[-(x^2+2x+2)e^{-x}+C\right]_0^3$$
$$=\left[-(9+6+2)e^{-3}-(-2)\right]$$
$$=-17e^{-3}+2$$ $$=\color{black}{-\frac{17}{e^3}+2}$$
