# Intuiting the gamma function, part 3

21 Jul 2017 · 5 min read## The gamma function as a superset of the traditional factorial

We ended Part 2 with the stunning result that

Of course, this is not exactly the same as the gamma function, because the gamma function is defined as:

A direct observation of the above leads to the conclusion that:

This ‘shift’ is a minor annoyance and is largely a historical artifact, but don’t let it distract you from the fact that **the gamma function is a superset of the factorial**. That is quite a bold statement (no pun intended), so it is worth proving. To show it, we must simply demonstrate that the gamma function can satisfy the definition of the factorial which we discussed in Part 1, reproduced here:

- $1! = 1$
- $n! = n(n-1)!$

In terms of the gamma function, we thus need to show that

- $\Gamma (2) = 1$, the
**boundary condition** - $\Gamma (x+1) = x \Gamma (x)$, the
**recursion condition**

## The boundary condition

To evaluate $\Gamma(2)$, we can start by substituting $x=2$ into the definition of the gamma function:

We can use standard integration by parts (IBP) to evaluate this:

I can tell you very quickly that this limit is equal to zero – look at what happens to the expression within the limit as $t$ grows. The $e^t$ on the denominator clearly grows much faster than the $t$ on the numerator, so as $t \rightarrow \infty$, this expression will tend to zero. In fact this is the intuition behind L’Hopital’s rule, which we could apply by differentiating the top and the bottom of the fraction.

In any case, we can conclude that

## The recursion condition

As a quick reminder, we need to show that:

This proof is really rather elegant, so I hope you’ll be as impressed with it as I was when I first understood it.

We will start by evaluating the left hand side (LHS) using IBP, though we will do it without our table method. Choosing an $f$ and a $g’$ then substituting them into the IBP formula:

To evaluate the RHS, we can split up the expression (noting that *x* can be treated as a constant)

Let us evaluate the first term (in square brackets):

I could just apply the same intuition as before to find this limit, but in this case it’s not immediately obvious that $e^t$ grows faster than $t^x$. To show this, we just repeated differentiate the top and bottom as per L’Hopital’s rule, until we can ‘substitute’ $t = \infty$ with sensible results (please don’t show that statement to any mathematicians):

To summarise:

We have successfully shown that the gamma function satisfies both the boundary condition and the recursion condition of the factorial function. This means that it will *always* give the same result as the traditional factorial (ignoring the shift). For example, we know for sure that $1729! = \Gamma(1730)$ without having to calculate either quantity.

## Extending the factorial

It is a fact that $\Gamma(x)$ is defined for all complex numbers except the negative integers (and zero), but unfortunately, its values are rarely ‘nice’ and can often only be evaluated with a computer. However, I’d like to show you one example that *does* turn out nicely: $\Gamma(\frac 1 2)$.

We start by substituting 1/2 into the definition of the gamma function:

To evaluate the RHS, we make a substitution:

You may recognise this very special integral, which is called the *Gaussian integral*. Although the indefinite integral has no elementary antiderivative, this *definite* integral has a beautifully simple result (the derivation of which I won’t show):

I hope it’s clear just how unexpected and *weird* this result is. We are saying that $\left( -\frac 1 2 \right)! = \sqrt \pi$, which is when you should realise that this whole series of posts has been a practical joke…

Not really.

Anyway, note how we can use this value to find $\frac 1 2 !$ We see that $\frac 1 2 ! = \Gamma(\frac 3 2)$, and we can easily write this in terms of $\Gamma(\frac 1 2)$ using the recursion condition.

This is a result with which I like to surprise people at parties, because it’s slightly more believable than the result of $(- \frac 1 2)!$. Maybe this is why nobody invites me to parties.

## Conclusion

We have reached the end of the series on understanding the intuition behind the gamma function. I hope you now see that the weird integral really does ‘contain’ the traditional factorial, which you can verify at any time by doing repeated integration by parts.

Unfortunately, despite my efforts, I can offer no intuition regarding the freaky results like $(1/2)! = \sqrt{\pi}/2$. But fortunately, you don’t have to take these results on faith – you can prove them to be true (as we have done).