Proving the factorial integral using induction I'm currently reviewing some mathematics for a thermal physics course. My textbook claims that the factorial integral
$$
n! = \int_0^\infty x^n\text{e}^{-x}\text{d}x$$
can be proved via induction. My current work:

*

*n = 0:
$$\int_0^{\infty}x^0\text{e}^{-x}\text{d}x = \int_0^{\infty}e^{-x}\text{d}x = 1$$
which is 0!.

*Assuming that the case $n = k$ is true
$$k! = \int_0^{\infty}x^k\text{e}^{-x}\text{d}x$$
we now wish to show that the $n = k+1$ case follows. The textbook then gives a hint to integrate the $k+1$ case by parts. First rewriting the integral
$$(k+1)! = \int_0^{\infty}x^{k+1}\text{e}^{-x}\text{d}x = -\int_0^{\infty}x^{k+1}\frac{\text{d}}{\text{d}x}(e^{-x})\text{d}x$$
and then swapping over the derivative
$$
-\int_0^{\infty}x^{k+1}\frac{\text{d}}{\text{d}x}(e^{-x})\text{d}x = \int_0^{\infty}\frac{\text{d}}{\text{d}x}(x^{k+1})\text{e}^{-x}\text{d}x + \left[x^{k+1}\text{e}^{-x}\right]_0^{\infty}
$$
The proof would be complete if the boundary term (second term on the right-hand side) comes out to be 0; however, I'm getting $-x$. What am I doing wrong? Thanks in advance for any help.


$x^k e^{-x} \to 0$ as $ x \to \infty$
