# A way to discover the Gamma function

I was messing around this morning and I discovered the following, which seemed cute enough to share. In this post, I’ll make what strikes me as a very reasonable attempt to define $u!$ for $u$ not an integer. Will I get the $\Gamma$ function? Wait and see!

We have $e^z = \sum z^n/n!$. So, by basic complex analysis, $\frac{1}{2 \pi i} \oint e^z z^{-n} \frac{dz}{z} = \frac{1}{n!}$, where the integral is taken along a loop around the origin. This formula is also morally right for $n$ a negative integer: $n!$ wants to be $\infty$ when $n<0$ (because $0 \times (-1)! = 0! =1$, so $(-1)!$ should be infinity, and likewise for the other negative integers). So $1/n!$ wants to be zero for $n<0$ and, sure enough, this integral has no poles and vanishes in that case.

We can’t use this formula for $n$ not an integer, because $z^n$ has a branch cut and the path of integration would have to cross it. But we can fix that by taking the branch cut of $z^n$ to be along the negative real axis, and drawing our loop out to stretch very far in the negative real direction. Then $e^z$ will be very small at the point where the integration path crosses the real axis, so the branch cut will contribute very little. In the limit, we can define

$\displaystyle{ \frac{1}{u!} := \frac{1}{2 \pi i} \int_{\gamma} e^{z} z^{-u} \frac{dz}{z}}$

where $\gamma$ is a path that comes in from the negative real direction below the real axis, circles around the origin, and returns to infinity in the negative real direction above the axis. This integral will converge for all complex $u$

So, how does this do as a definition of $1/u!$? Well, it obeys the right recursion. A quick integration by parts gives $\int_{\gamma} e^{z} z^{-u+1} dz = - \int_{\gamma} e^z \frac{z^u}{-u} dz = u \int_{\gamma} e^z z^{-u} dz$, so $1/(u-1)! = u/u!$.

Let’s take our path $\gamma$ and shrink it towards the negative real axis. As we approach $-r$ from above (for $r$ a positive real), $(-r)^{-u}$ approaches $r^{-u} e^{i \pi u}$. As we approach $-r$ from below, $(-r)^{-u}$ approaches $r^{-u} e^{- i \pi u}$. The difference between the two is $2 i r^{-u} \sin(\pi u)$. So one might think that our integral was equal to $\frac{1}{\pi} \int_{0}^{\infty} r^{-u} \sin( \pi u) e^{-r} \frac{dr}{r}$.

If you are more careful, you’ll see that this argument only works for $\mathrm{Re}(u) < 0$; otherwise, the pole at the origin is too wild to permit the limiting process. So we get that our previous definition is equivalent to

$\displaystyle{\frac{1}{u!} = \frac{1}{\pi} \sin(\pi u) \int_{0}^{\infty} r^{-u} e^{-r} \frac{dr}{r}}$ for $\mathrm{Re}(u) < 0$.

This is where a person who has seen the $\Gamma$ function defined before will say “well, you’re on the right track, but that sure looks funky.” Writing $\Pi$ for the standard complex extension of the factorial function1, we have $\int_{0}^{\infty} r^{-u} e^{-r} \frac{dr}{r} = \Pi(-u-1)$. So I’ve got the right integral, but it’s being evaluated at the wrong place, and there is this strange extra factor of $\frac{1}{\pi} \sin(\pi u)$ floating around.

But it all works out! We have the functional equation of the $\Gamma$ function:

$\displaystyle{\frac{1}{\pi} \sin(\pi u) \Pi(-1-u) = \frac{1}{\Pi(u)}.}$

So the integral I have above really is the standard extension, but gotten at from the other side.

One wants to turn this into a proof of the functional equation, but as yet I don’t see how…

1For historical reasons, $\Gamma(1+u) = u!$. So I’m writing $\Pi$ for the function $\Gamma(1+u)$.

## 8 thoughts on “A way to discover the Gamma function”

1. Small correction.

“so (-1)! should be zero, and likewise for the other negative integers” should read “so (-1)! should be infinity…”

2. plm says:

Thank you David. I am curious how you came to working this out. What were you “messing around”, or what was your frame of mind, or mood? (I don’t really know what to ask but any answer will be welcome.)

In any case it was very interesting. I wonder whether it is possible rather to _not_ arrive at the Gamma function, given any “reasonably convergent” formula that matches n! on integers.

3. David Speyer says:

I was basically messing around. I noticed that the integrand in $\oint e^{z} z^{-n} dz/z=1/n!$ looked a lot like the integrand defining the $\Gamma$ function, but the contours didn’t match up, so I was trying to get them to match up.

I was also rocking my daughter to sleep for the first 20 minutes or so, so I was trying to do this in my head and there was a lot of going through the same computations over and over to catch missing $-1$‘s and $\pi$‘s. When doing this sort of routine, hand-occupying child care, my main ways of occupying my mind are doing mental computations and reciting Dylan lyrics to myself.

4. plm says:

Thanks. :) This should deter me from asking next time, for fear of catching you doing something embarassing.

5. scot says:

Thanks for the interesting post. for that first e^z expression should it read as sum z^n/n! (there’s an a _n)