In this level-1 post, we take a closer look at the gamma function, a generalization of the factorial, and see how it makes sense even when it blows up.

###### Introduction

For a blog called Singular Points, I have gone quite a while without mentioning a singularity (unless you count a black hole). We are here now to change that! Recently, I came across a fact about a special function while working on a physics project. For an integer $n \geq 0$,

$\displaystyle\lim_{x\rightarrow-n}\left[-\frac{\Gamma^2(x)}{\Gamma'(x)}\right]=\frac{(-1)^n}{n!}$

This fact caught me a little bit by surprise, in that it reminded me of an idea that I had years ago that didn’t work… until now. It involves the Gamma function ($\Gamma$), which is a generalization of the factorial function, so it isn’t surprising to see a factorial show up, but this particular one struck me. In this post, we will try to reproduce the discovery that made me realize that this must be true, but reorganized in a way that hopefully makes more sense than how I originally came to it. We’ll start by talking about the factorial and why it’s important. Then, we will introduce the Gamma function and discuss why it is so important. Finally, we will talk about how to extract this special fact about this special function and why it just had to be this way.

###### Factorials

The factorial is a simple operation, defined on the non-negative integers. It is the number of ways or arranging a number of objects in a line. For example, if we had 3 frisbees, and we wanted to rank how cool they looked, there would be $3!=6$ different rankings. This is because we start with 3 choices for first place, then for each choice of first place, we can pick one of two frisbees for second place (no frisbee could rank first and second, that would be ludicrous). And then finally, whichever frisbee is left gets third place. That makes $3\times2\times1=6$ different rankings. In general, we can define the factorial of $n$ as being the product of all the whole numbers up to $n$.

The observant among you would have noticed that I said the factorial is defined for non-negative numbers, which includes 0. That doesn’t quite fit into the definition about multiplying whole numbers. Let’s think about ordering objects then. How many ways are there to order 0 objects? Well, the only thing to do is nothing, and many mathematicians would say that means there is only one way to order 0 things: by not doing anything. This doesn’t fly with everyone though, some people don’t want to count not doing anything as an ordering (though there are good mathematical reasons why one would want to say that). Instead, I will convince these naysayers with the ultimate method: recursion.

Recursion is a way of defining a sequence from a starting value(s). There is a special algorithm to go from the starting value to the next and so on. In the case of the factorial, we can reason things out like so. $n!$ is the product of the first $n$ whole numbers, which just so happens to contain the product of the first $n-1$ whole numbers. In our frisbee example, $3! = 3\times2\times1$ contains the product of the first 2 whole numbers, which is also called $2!$. In general, we can write

$n! = n\times(n-1)!\text{ , with }1!=1$.

This definition is equivalent to the previous definition for all whole numbers, but it also gives an answer for other numbers too, namely 0. By using the recursion relation backwards,

$(n-1)! = \frac{n!}{n}$,

we can see that for $n=1$, this gives $0! = 1$. That settles it!

We could try to go even further back and define the factorial of a negative number, but you run into trouble pretty quickly.

$(-1)! = \frac{0!}{0} = \frac{1}{0}$

We could just throw our hands up and say all is lost, but let’s try something else. If we just keep going, we can spot a pattern (even though it isn’t technically defined).

$(-2)! = \frac{(-1)!}{-1} = \frac{1}{0}\times\frac{-1}{1}$
$(-3)! = \frac{(-2)!}{-2} = \frac{1}{0}\times\frac{1}{2!}$
$(-4)! = \frac{(-3)!}{-3} = \frac{1}{0}\times\frac{-1}{3!}$

We can see the pattern forming, and indeed if we continue this out to some negative integer $-n$, then we will see

$(-n)! = \frac{1}{0}\times\frac{(-1)^{n-1}}{(n-1)!}$.

So the factorial of a negative integer is not defined, but there is this hidden structure behind it, which we will come back to later.

###### The Gamma Function

All the way back in the 1720’s, mathematicians were interested to know whether there was a meaningful way to extend the factorial to include non-integers. The problem was solved by Leonhard Euler, and his solution was the gamma function, $\Gamma(x)$. The gamma function matches the factorial everywhere that it is defined, but actually exists for all complex numbers, except for non-positive integers (where the recurrence relation failed before). Unfortunately the gamma function can be a little confusing, because $\Gamma(n+1)=n!$. So it isn’t exactly the factorial, it is shifted over by one. Here is a graph of the gamma function:

The gamma function has familiar properties that it inherits from the factorial, like the recurrence relation, $\Gamma(n+1) = n\Gamma(n)$, but it satisfies this property for non-integer $n$ as well. It isn’t the only way to extend the factorial, though it is the extension that appears the most in all the mathematics I have ever seen. There is a notable extension that doesn’t blow up anywhere, which is called Hadamard’s gamma function, $H(x)$. It can be defined in terms of Euler’s gamma function as

$H(x) = \frac{1}{\Gamma(1-x)}\cdot\frac{d}{dx}\ln\left[\frac{\Gamma\left(\frac{1}{2}-\frac{x}{2}\right)}{\Gamma\left(1-\frac{x}{2}\right)}\right]$.

Hadamard’s gamma function is well-defined for all negative numbers (and in fact all complex numbers). Here is a graph of Hadamard’s gamma function:

There are other extensions of the factorial (infinitely many, with varying properties). The Hadamard’s gamma function and some others are explained here, for example.

###### Pulling Out Singularities

We want to extract the singular bit of the Gamma function and see what is left over. There are plenty of different ways of discarding singularities, so we would like to pick one that suits our intuition for what is happening. From the recursion relation that defines the factorial, we can see the structure of what we are dealing with: it looks like a singular bit multiplying a regular bit.

In calculus, we have this notion that a differentiable function looks like a straight line if you look close enough. Similarly, and without going into too much detail, the singularities of the Gamma function ‘look like’ the singularity of the function $1/x$. Using our intuition for how the gamma function behaves near a singularity, we can think of this as being like $f(x)/x$ near $x=0$. Our goal is to get rid of the factor of $1/x$ without disturbing the underlying function $f(x)$. The easy thing may be to just multiply everything by $x$, which will work. However, if we do it another way, then we can make the connection with the equation we started with at the beginning of this post.

Notice that the function $F(x)=1/x$ has a particular relationship with its derivative, $F'(x)=-1/x^2$:

$-\frac{F(x)^2}{F'(x)} = 1$.

This relationship allows us to ‘cancel out’ the singularity of the function using its derivative. This trick doesn’t just work with $1/x$, but you can show that it also holds for any inverse power $G(x)=1/x^p$, with some minor changes:

$(-p)^{p}\,\frac{G(x)^{p+1}}{G'(x)^{p}} = 1$.

For $p=1$, this matches the previous equation, and already this should remind us of the equation we started with. But that equation isn’t just an inverse power, it looks more like an inverse power times a function. So what happens to something like that under this operation? Let’s take $F(x) = f(x)/x$ and put it through the grinder. We find that

$-\frac{F(x)^2}{F'(x)} = \frac{f(x)}{1-xf'(x)/f(x)}$.

It’s close, but not quite $f(x)$. However, we don’t really care about the function, but rather it’s limit as you approach the singularity, i.e. $x\rightarrow0$. In this limit, the denominator goes to 1, or at least I couldn’t find a counterexample to that fact (and really we only need this to hold for the Gamma function, which it does). So the whole expression goes to $f(0)$.

###### The Gamma Function Knows

Let’s consolidate the discussion so far. First, we had the factorial recurrence that, when iterated backwards, immediately ran into problems, but formally gave us

$(-k)! = \frac{1}{0}\times\frac{(-1)^{k-1}}{(k-1)!}$.

Then, we introduced the Gamma function, which also obeys the (shifted) recurrence relation, and therefore has Singular Points corresponding to these negative factorials. Finally, we showed that there is a simple operation involving derivatives that strips the $x^{-p}$ behavior from a function and leaves whatever is left. If we combine these facts with the knowledge that $\Gamma$ behaves like $1/x$ at Singular Points, then we should see

$\displaystyle\lim_{x\rightarrow-n}\left[-\frac{\Gamma^2(x)}{\Gamma'(x)}\right]=\frac{(-1)^n}{n!}$,

which is indeed the case as we saw at the beginning of the post! This has a special name in complex analysis: the residue, though this is not the typical way of computing it. If you have ever seen this method of computing the residue before, let me know!