Evaluating the integral $\int_{0}^{\infty} e^{-x}x^n dx$ where n=0,1,2 ...
1st Integration by part: let $a=x^n$, $da= nx^{n-1} dx$, Also $db=e^{-x}$, $b=-e^{-x}$ We have $$ -x^n e^{-x} + n\int x^{n-1}e^{-x} dx$$
2nd: let $a=x^{n-1}, da= (n-1)x^{n-2}, db= e^{-x}, b= -e^{-x}$ We have $$-x^n e^{-x} + n\left[x^{n-1}(-e^{-x}) - \int(n-1)x^{n-2}\cdot -e^{-x}\right]$$
How would you find the general form? What would it be?
The answer is $n!$
You can use an induction argument. First, note that $$\lim_{x \to \infty}e^{-x}p(x) = 0$$ for any polynomial $p$.
Then for $n \geq 1$, $$\int_0^{+\infty} e^{-x}x^n dx = \left[-e^{-x}x^{n}\right]_0^{+\infty} + n\int_0^{+\infty} e^{-x}x^{n-1} dx = 0 + n(n-1)! = n! $$
and the base case $n=0$ holds since $\int_0^{+\infty} e^{-x} dx = 1$.