[math]\int_{0}^{\infty} x^k e^{-x}dx[/math]

Now I use the indefinite integral and integrate by parts, with u=x

^{k}and dv=e

^{-x}dx:

[math]\int x^k e^{-x}dx = x^k(-e^{-x}) - \int -e^{-x}kx^{k-1}dx[/math] [math]= -x^ke^{-x} + \int kx^{k-1}e^{-x}dx[/math]

Hey, the second term looks just like the original integral, with a different coefficient and x

^{k-1}rather than x

^{k}. So repeatedly integrating by parts will eventually give me this:

[math]-x^ke^{-x} - kx^{k-1}e^{-x} - k(k-1)x^{k-2}e^{-x} - ... - (k!)x^{0}e^{-x}[/math]

Which I can rewrite as:

[math]\frac{-x^k - kx^{k-1} - k(k-1)x^{k-2} - ... - k!}{e^x}[/math]

So:

[math]\int_{0}^{\infty} x^k e^{-x}dx = \lim_{b \to \infty} \left( \frac{-b^k - kb^{k-1} - k(k-1)b^{k-2} - ... - k!}{e^b} - \frac{-0^k - k0^{k-1} - k(k-1)0^{k-2} - ... - k!}{e^0}\right)[/math]

[math]= \left( \lim_{b \to \infty} \frac{-b^k - kb^{k-1} - k(k-1)b^{k-2} - ... - k!}{e^b}\right) - \frac{-k!}{e^0}[/math]

I've got infinity / infinity for the limit, so I use l'Hopital's rule repeatedly, taking the 1st, 2nd,..,k

^{th}derivative, so the denominator remains e

^{b}while all terms but one (the leftmost) in the numerator disappear:

[math]\left( \lim_{b \to \infty} \frac{-k!}{e^b}\right) + k![/math]

The limit is 0, so I am left with k! and have: [imath]\int_{0}^{\infty} x^k e^{-x}dx = k![/imath]