# How to come up with the gamma function?

It always puzzles me, how the Gamma function's inventor came up with its definition $$\Gamma(x+1)=\int_0^1(-\ln t)^x\;\mathrm dt=\int_0^\infty t^xe^{-t}\;\mathrm dt$$ Is there a nice derivation of this generalization of the factorial?

Here is a nice paper of Detlef Gronau Why is the gamma function so as it is?.
Concerning alternative possible definitions see Is the Gamma function mis-defined? providing another resume of the story Interpolating the natural factorial n! .

Concerning Euler's work Ed Sandifer's articles 'How Euler did it' are of value too, in this case 'Gamma the function'.

• @FUZxxl: Well it provides the letters from Euler where this generalization appears (Euler usually didn't give names to his functions, Gamma and +1 came later...). Mar 11, 2012 at 21:38
• Sorry. I found out that the article actually contains an answer to my question, thus I removed my post. Mar 11, 2012 at 21:47
• @FUZxxl: no problem and fine reading! Mar 11, 2012 at 21:52
• @DanielG: Thanks for the update! Concerning the last paragraph we may use 'How Euler did it' and 'Gamma the function' from the irreplaceable "The Euler Archive". Cheers, Jun 23, 2016 at 22:31

$$\int e^{ax} dx = \frac{1}{a} e^{ax} + c$$

Take $\left .\frac{d}{da}\right |_{a=1}$ on both sides $n$ times, and algebra to get rid of $(-1)^n$, you'll have an integral equal to $n!$.

This is an intuitive way to get the Gamma function. You've shown that for integers it holds from this simple derivation.

Mathematicians then went through a great deal of work to show that it holds true for allot more than just the integer case.

• I personally enjoy this approach very much :-) Aug 20, 2017 at 22:43
• To be more precise, we have$$\int_0^\infty e^{ax}~\mathrm dx=-\frac1a\quad \forall a<0$$Differentiate both sides $n$ times to get$$\int_0^\infty x^ne^{ax}~\mathrm dx=\frac{(-1)^{n+1}n!}{a^{n+1}}$$Now sub in $a=-1$ to get$$\int_0^\infty x^ne^{-x}~\mathrm dx=n!$$ Aug 20, 2017 at 22:45

I guess you can say this is yet another application of the power of integration by parts (and I am guessing that is how the integral formula "was come up with" initially).

If you are trying to find the antiderivative of $P(t) e^t$, where $P(t)$ is a polynomial, integration by parts arises naturally and I would say it(integral of $P(t) e^t$) is quite natural to encounter during ones study of mathematics. And if you actually work it out, you notice the factorial like recursion. We can rid of the "non-integral" parts of the integration by parts formula by using the limits $0$ and $\infty$.

If $I_n = \int_{0}^{\infty} t^n e^{-t} \text{dt}$ then integration by parts gives us

$$I_n = -e^{-t}t^n|_0^{\infty} + n\int_{0}^{\infty} t^{n-1} e^{-t} = nI_{n-1}$$

so if

$f(x) = \int_{0}^{\infty} t^x e^{-t} \text{dt}, \quad x \ge 0$

then

$f(x) = x f(x-1), \quad x \ge 1$.

Also, we have that $f(0) = 1$, thus the integral definition agrees with the factorial function at the non-negative integers and can serve as a real extension for factorial.

Using Analytic continuation its domain can be extended further.

• Thank you for that answer although you don't point out how one get's to $\int_0^\infty t^ne^{-1}\;\mathrm dt$. Mar 11, 2012 at 21:48
• @FUZxxl: I don't understand. I interpreted your question as "how did one come up with the integral". Or as you asking for why $\Gamma(x+1) = x!$ and not $\Gamma(x) = x!$? Mar 11, 2012 at 21:50
• YOur first interpretion is right. But your answer shows only that the integral satisfies the recurrence relation $\Gamma(x+1)=x\Gamma(x)$ and does not show how one can derive that integral. Mar 11, 2012 at 21:57
• @FUZxxl: I have added a paragraph. See the edit. Mar 11, 2012 at 21:58

In Leonhard Euler's Integral: A Historical Profile of the Gamma Function: In Memoriam: Milton Abramowitz by Philip J. Davis in The American Mathematical Monthly , Dec., 1959: Apparently, Euler, experimenting with infinite products of numbers, chanced to notice that if n is a positive integer,

$$\small n!=\Bigg [ \left(\frac 2 1 \right)^n \frac1{n+1}\Bigg ]\,\Bigg [ \left(\frac 3 2 \right)^n \frac2{n+2}\Bigg ]\,\Bigg [ \left(\frac 4 3 \right)^n \frac3{n+3}\Bigg ]\cdots$$

and succeeding in transforming this infinity product into an integral, extending the factorial beyond integers, upon noticing that for certain values the infinite product yielded $$\pi,$$ suggesting areas of a circle.

But there is a really neat intuition already expressed in one of the answers, and beautifully presented by Robert Andrew Martin here, simply expanding the integral part in the integration by parts of a polynomial modulated by an exponential. In essence, the counterpart of the factorials in Taylor series.

For instance for $$x^4$$ (leaving constant of integration out):

\begin{align}\small \int x^4\; e^{-x} \; dx &\small= -x^4\;e^{-x} +\int 4\,x^3\;e^{-x}\;dx\\ &\small = -x^4 \; e^{-x}-4\,x^3\;e^{-x} +\int_0^\infty 4\cdot 3\,x^2\;e^{-x}\;dx\\ &\small = -x^4 \; e^{-x} -4\,x^3\;e^{-x} -4\cdot 3\,x^2\;e^{-x} +\int 4\cdot 3\cdot 2\,x\;e^{-x}\;dx\\ &\small =-x^4 \; e^{-x} -4\,x^3\;e^{-x} -4\cdot 3\,x^2\;e^{-x} -4\cdot 3\cdot2\,x\;e^{-x} - \underbrace{4\cdot 3\cdot 2\cdot 1}_{4!}\;e^{-x} \end{align}

Generalizing and integrating from $$0$$ to $$\infty:$$

$$\small\int_0^\infty x^n\; e^{-x} \; dx=-x^n \; e^{-x} -n\,x^{n-1}\;e^{-x} \cdots - \underbrace{n\cdot (n-1)\cdots 3\cdot 2\cdot 1}_{n!}\;e^{-x}\;\;\Bigr|_{x=0}^\infty=n!$$

which can immediately be extended beyond integers as $$\displaystyle \small x! = \int_0^\infty t^x\; e^{-t} \; dt$$

essentially the gamma function, except for the accepted slightly different definition: $$\Gamma(x)=\int_0^\infty t^{x-1}\; e^{-t} \; dt$$

that makes $$\small (x-1)!=\Gamma(x).$$