Finding Factorial using Integral Definition

6.7k Views Asked by At

$n! = \int_{0}^{\infty} {e}^{-x}{x}^{n} \,dx$

How can we find $400!$?

$400! = \int_{0}^{\infty} {e}^{-x}{x}^{400} \,dx$

Integration by parts is way too complicated, what are the other options?

1

There are 1 best solutions below

0
On BEST ANSWER

Integration by parts will only tell you that $400!=400\cdot 399!$, which we know from the definition of a factorial; in fact, this is one way to prove the integral definition. Using the integral to calculate the factorial is rarely the most efficient method, particularly when $n$ is an integer, as in your example. The fastest method of calculating a factorial with integer $n$ is through its prime factors, which are easily calculable by the formula $n!$ divides $p$ precisely $\displaystyle \sum_{k=1}^{\lfloor \log_p(n) \rfloor} \left \lfloor \frac n{p^k} \right \rfloor$ times. See here for a proof (of the complexity; the formula is due to Legendre). If you want to be able to calculate $\Gamma(z)$ for all complex $z$, see this post.