*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 ,

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 (), 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 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 different rankings. In general, we can define the factorial of as being the product of all the whole numbers up to .

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. is the product of the first whole numbers, which just so happens to contain the product of the first whole numbers. In our frisbee example, contains the product of the first 2 whole numbers, which is also called . In general, we can write

.

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,

,

we can see that for , this gives . 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.

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).

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

.

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, . 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 . 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, , but it satisfies this property for non-integer 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, . It can be defined in terms of Euler’s gamma function as

.

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 . Using our intuition for how the gamma function behaves near a singularity, we can think of this as being like near . Our goal is to get rid of the factor of without disturbing the underlying function . The easy thing may be to just multiply everything by , 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 has a particular relationship with its derivative, :

.

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

.

For , 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 and put it through the grinder. We find that

.

It’s close, but not quite . However, we don’t *really* care about the function, but rather it’s limit as you approach the singularity, i.e. . 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 .

###### 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

.

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 behavior from a function and leaves whatever is left. If we combine these facts with the knowledge that behaves like at Singular Points, then we should see

,

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!