The gamma function is defined by the following complicated looking formula:

Γ ( *z* ) = ∫_{0}^{∞}*e ^{ - t}t^{z-1}dt*

One question that people have when they first encounter this confusing equation is, “How do you use this formula to calculate values of the gamma function?” This is an important question as it is difficult to know what this function even means and what all of the symbols stand for.

One way to answer this question is by looking at several sample calculations with the gamma function.

Before we do this, there are a few things from calculus that we must know, such as how to integrate a type I improper integral, and that e is a mathematical constant.

### Motivation

Before doing any calculations, we examine the motivation behind these calculations. Many times the gamma functions shows up behind the scenes. Several probability density functions are stated in terms of the gamma function. Examples of these include the gamma distribution and students t-distribution, The importance of the gamma function cannot be overstated.

### Γ ( 1 )

The first example calculation that we will study is finding the value of the gamma function for Γ ( 1 ). This is found by setting *z* = 1 in the above formula:

∫_{0}^{∞}*e ^{ - t}dt*

We calculate the above integral in two steps:

- The indefinite integral ∫
*e*= -^{ - t}dt*e*^{ - t}+*C* - This is an improper integral, so we have ∫
_{0}^{∞}*e*= lim^{ - t}dt_{b → ∞}-*e*^{ - b}+*e*^{ 0}= 1

### Γ ( 2 )

The next example calculation that we will consider is similar to the last example, but we increase the value of *z *by 1.

We now calculate the value of the gamma function for Γ ( 2 ) by setting *z* = 2 in the above formula. The steps are the same as above:

Γ ( 2 ) = ∫_{0}^{∞}*e ^{ - t}t dt*

The indefinite integral ∫*te ^{ - t}dt*=

*- te*. Although we have only increased the value of

^{ - t}-*e*^{ - t}+ C*z*by 1, it takes more work to calculated this integral.

In order to find this integral we must use a technique from calculus known as integration by parts. We now use the limits of integration just as above and need to calculate:

lim_{b → ∞} *- be ^{ - b} -e^{ - b}* -

*0e*

^{ 0}+

*e*

^{ 0}.

A result from calculus known as L’Hospital’s rule allows us to calculate the limit lim_{b → ∞} *- be ^{ - b}* = 0. This means that the value of our integral above is 1.

### Γ (*z* +1 ) =*z*Γ (*z* )

Another feature of the gamma function, and one which connects it to the factorial, is the formula Γ (*z* +1 ) =*z*Γ (*z* ) for *z* any complex number with a positive real part. The reason why this is true is a direct result of the formula for the gamma function. By using integration by parts we can establish this property of the gamma function.