If is an integer, then, using integration by parts repeatedly, we see that (see Exercise 2 in this post!). We can now use this integral form of the factorial of a non-negative integer to define the factorial of any real number which is not a negative integer.

**Definition 1**. The *gamma function* is defined by

**Remark**. By definition, for all integers and so for all integers So we may define for all real numbers but, in order to do that, we need to show that is well-defined, i.e. is convergent for all real numbers (Problem 2).

**Example 1**. Show that In other words,

**Solution**. By definition, and so the substitution gives (see this post!).

**Problem 1**. Show that for all

**Solution**. Intgeration by parts with and gives

**Example 2**. Show that for all integers In other words,

**Solution**. By Problem 1 and Example 2, we have

**Problem 2**. Show that is well-defined, i.e. is convergent for all real numbers

**Solution**. By Problem 1, we have and so we only need to show that is convergent for We have

The integral is a proper integral and so it is convergent. Now choose an integer such that Then

So, by the comparison test, is convergent. Thus, by is convergent too.

**Definition 2**. We now use Problem 1 to extend the domain of from to the set If then and so is defined; we then define If then and we just defined we then again define etc. Now if is a real number which is not a negative integer, we may define

**Example 3**. By the above definition and Example 1,

**Exercise**. Show that if then is divergent.

*Hint*.