Prove, for every nonnegative integer \(n\), that \[ \int_0^\infty x^ne^{-x}\,dx=n!. \]
Solution
For \(n=0\), \[ \int_0^\infty e^{-x}\,dx=1=0!. \]
For the inductive step, integration by parts gives \[ \int_0^\infty x^ne^{-x} = -x^ne^{-x}\bigg\rvert_0^\infty - \int_0^\infty -nx^{n-1}e^{-x} = -x^ne^{-x}\bigg\rvert_0^\infty + n \int_0^\infty x^{n-1}e^{-x} \\ \equalsbecause{I.H.} -x^ne^{-x}\bigg\rvert_0^\infty + n (n-1)! \\ \equalsbecause{L.H.$\times n$}0 + n(n-1)! = n!. \qed \]