Efficiently evaluating $\int x^{4}e^{-x}dx$ The integral I am trying to compute is this:
$$\int x^{4}e^{-x}dx$$
I got the right answer but I had to integrate by parts multiple times. Only thing is it took a long time to do the computations. I was wondering whether there are any more efficient ways of computing this integral or is integration by parts the only way to do this question?
Edit: This question is similar to the question linked but slightly different because in the other question they are asking for any method to integrate the function which included integration by parts. In this question I acknowledge that integration by parts is a method that can be used to evaluate the integral but am looking for the most efficient way. This question has also generated different responses than the question linked such as the tabular method. 
 A: While it still entails integration by parts, there exists a "quick" method of doing the integration by parts called the Tabular Method. Basically, you start with a table that has $3$ columns. One with alternating signs, one with a $u$ and one with $dv$. In the column for $u$, you should put the term that will eventually go to zero after multiple differentiations. In the last column is $dv$ which you will integrate multiple times. You'll want to pick something you can still integrate multiple times for $dv$. So in $\displaystyle \int x^4e^{-x}\,dx$, we can create the following table: $$\begin{matrix} & u & dv \\ + &x^4 & e^{-x} \\ - & 4x^3 & -e^{-x} \\ + & 12 x^2 & e^{-x} \\ - & 24x & -e^{-x}  \\ + & 24 & e^{-x} \\ - & 0 & -e^{-x}.\end{matrix}$$ we now have all the parts to compute our solution. You start at the very first $+$, and multiply the corresponding $u$ term with the $dv$ term on the very next line. Continue this process until you get to the end of the $dv$ column. So our solution is $$\int x^4e^{-x}\,dx = -x^4e^{-x} -4x^3e^{-x} -12x^2e^{-x}-24xe^{-x}-24e^{-x} + C$$ 
A: Usually this kind of integrals can be handled by making
\begin{align*}
\int x^4e^{-x}\,\mathrm dx&=-x^4e^{-x} + (Ax^3+Bx^2+Cx+E)e^{-x}
\end{align*}
Where $A,\;B,\;C$, and $E$ are constants which satisfies
$$x^4e^{-x}+(-4-A)x^3e^{-x}+(3A-B)x^2e^{-x}+(2B-C)xe^{-x}+(C-E)e^{-x}=x^4e^{-x}$$
So
\begin{align*}
-4-A&=0\\
3A-B&=0\\
2B-C&=0\\
C-E&=0
\end{align*}
Then $A=-4$, $\;B=3A=-12$, $\;C=2B=-24$ and $E=C=-24$, then
\begin{align*}
\int x^4e^{-x}\,\mathrm dx&=-(x^4+4x^3+12x^2+24x+24)e^{-x}+K
\end{align*}
where $K$ is a constant.

Also, here is a more general problem related.
A: Here is a nice little trick to integrate it without using partial integration.
$$
\int x^4 e^{-x} \,\mathrm dx = \left. \frac{\mathrm d^4}{\mathrm d \alpha^4}\int  e^{-\alpha x} \,\mathrm dx   \right|_{\alpha=1} = \left.- \frac{\mathrm d^4}{\mathrm d \alpha^4} \frac{1}{\alpha} e^{-\alpha x}\right|_{\alpha=1}
$$
The idea is to introduca a variable $\alpha$ in the exponent and write the $x^4$ term as the fourth derivative with respect to $\alpha$. This is especially helpful when you want to calculate the definite integral $\int_0^\infty$ because in this case the differentiation greatly simplifies.
$$
\int\limits_0^\infty x^n e^{-x} \,\mathrm dx = (-1)^n \left. \frac{\mathrm d^n}{\mathrm d \alpha^n} \frac{1}{\alpha} \right|_{\alpha=1} = n!\stackrel{n=4}{=} 24
$$
