# Gamma function

File:Gamma plot.svg
The Gamma function along part of the real axis

In mathematics, the Gamma function (represented by the capitalized Greek letter Γ) is an extension of the factorial function to real and complex numbers. For a complex number z with positive real part it is defined by

'"`UNIQ--postMath-00000001-QINU`"'

which can be extended to the rest of the complex plane, excepting the non-positive integers.

If n is a positive integer, then

'"`UNIQ--postMath-00000002-QINU`"'

showing the connection to the factorial function. The Gamma function generalizes the factorial function for non-integer and complex values of n.

The Gamma function is a component in various probability-distribution functions, and as such it is applicable in the fields of probability and statistics, as well as combinatorics.

## Definition

### Main definition

File:Complex gamma.jpg
The extended version of the Gamma function in the complex plane

The notation Γ(z) is due to Adrien-Marie Legendre. If the real part of the complex number z is positive (Re[z] > 0), then the integral

'"`UNIQ--postMath-00000003-QINU`"'

converges absolutely. Using integration by parts, one can show that

'"`UNIQ--postMath-00000004-QINU`"'.

This functional equation generalizes the relation n! = n×(n-1)! of the factorial function. We can evaluate Γ(1) analytically:

'"`UNIQ--postMath-00000005-QINU`"'.

Combining these two relations shows how the factorial function is a special case of the Gamma function:

'"`UNIQ--postMath-00000006-QINU`"'

for all natural numbers n.

File:GammaAbsSmallPlot.png
The absolute value of the Gamma function on the complex plane.

It is a meromorphic function of x with simple poles at x = −n (n = 0, 1, 2, 3, ...) and residues (−1)n/n!. [1] It can further be used to extend Γ(z) to a meromorphic function defined for all complex numbers z except z = 0, −1, −2, −3, ... by analytic continuation. It is this extended version that is commonly referred to as the Gamma function.

### Alternative definitions

The following infinite product definitions for the Gamma function, due to Euler and Weierstrass respectively, are valid for all complex numbers z which are not non-positive integers:

'"`UNIQ--postMath-00000007-QINU`"'

where γ is the Euler-Mascheroni constant.

It is straightforward to show that the Euler definition satisfies the functional equation (1) above, as follows. Provided z is not equal to 0, -1, -2, ...

'"`UNIQ--postMath-00000008-QINU`"'

In a different way it can be shown that...

'"`UNIQ--postMath-00000009-QINU`"'

## Derivation via integration by parts

Finding '"`UNIQ--postMath-0000000A-QINU`"' is easy:

'"`UNIQ--postMath-0000000B-QINU`"'

Next, we derive an expression for '"`UNIQ--postMath-0000000C-QINU`"' as a function of '"`UNIQ--postMath-0000000D-QINU`"':

'"`UNIQ--postMath-0000000E-QINU`"'

We use integration by parts to solve this integral, with the following substitutions:

Let '"`UNIQ--postMath-0000000F-QINU`"'

---then, '"`UNIQ--postMath-00000010-QINU`"'

Let '"`UNIQ--postMath-00000011-QINU`"'

---then, '"`UNIQ--postMath-00000012-QINU`"'

'"`UNIQ--postMath-00000013-QINU`"'

We need to express this as a definite integral. Note that the first expression on the right side of the equation can be reduced by L'Hôpital's rule to

'"`UNIQ--postMath-00000014-QINU`"'.

This quantity takes on a value of zero for both x equal to zero and for x equal to infinity. Thus, the entire term is zero, leaving

'"`UNIQ--postMath-00000015-QINU`"'

So,

'"`UNIQ--postMath-00000016-QINU`"'

The far right side of the equation is nothing more than n'"`UNIQ--postMath-00000017-QINU`"'. Thus,

'"`UNIQ--postMath-00000018-QINU`"'.

Using this n + 1 formula we derive a pattern:

'"`UNIQ--postMath-00000019-QINU`"'
'"`UNIQ--postMath-0000001A-QINU`"'
'"`UNIQ--postMath-0000001B-QINU`"'
'"`UNIQ--postMath-0000001C-QINU`"'
'"`UNIQ--postMath-0000001D-QINU`"'

## Properties

### General

Other important functional equations for the Gamma function are Euler's reflection formula

'"`UNIQ--postMath-0000001E-QINU`"'

and the duplication formula

'"`UNIQ--postMath-0000001F-QINU`"'

The duplication formula is a special case of the multiplication theorem

'"`UNIQ--postMath-00000020-QINU`"'

A basic but useful property, which can be seen from the limit definition, is:

'"`UNIQ--postMath-00000021-QINU`"'

Perhaps the most well-known value of the Gamma function at a non-integer argument is

'"`UNIQ--postMath-00000022-QINU`"'

which can be found by setting z=1/2 in the reflection or duplication formulas, by using the relation to the Beta function given below with x = y = 1/2, or simply by making the substitution '"`UNIQ--postMath-00000023-QINU`"' in the integral definition of the Gamma function, resulting in a Gaussian integral. In general, for odd integer values of n we have:

'"`UNIQ--postMath-00000024-QINU`"'    (n odd)

where n!! denotes the double factorial.

The derivatives of the Gamma function are described in terms of the polygamma function. For example:

'"`UNIQ--postMath-00000025-QINU`"'

The Gamma function has a pole of order 1 at z = −n for every natural number n; the residue there is given by

'"`UNIQ--postMath-00000026-QINU`"'

The Bohr-Mollerup theorem states that among all functions extending the factorial functions to the positive real numbers, only the Gamma function is log-convex, that is, its natural logarithm is convex.

'"`UNIQ--postMath-00000027-QINU`"' because:
'"`UNIQ--postMath-00000028-QINU`"'

And with integration by parts:

'"`UNIQ--postMath-00000029-QINU`"'

The derivative of the Gamma function is:

'"`UNIQ--postMath-0000002A-QINU`"'

### Pi function

An alternative notation which was originally introduced by Gauss and which is sometimes used is the Pi function, which in terms of the Gamma function is

'"`UNIQ--postMath-0000002B-QINU`"'

so that

'"`UNIQ--postMath-0000002C-QINU`"'.

Using the Pi function the reflection formula takes on the form

'"`UNIQ--postMath-0000002D-QINU`"'

where sinc is the normalized sinc function, while the multiplication theorem takes on the form

'"`UNIQ--postMath-0000002E-QINU`"'

We also sometimes find

'"`UNIQ--postMath-0000002F-QINU`"'

which is an entire function, defined for every complex number. That π(z) is entire entails it has no poles, so Γ(z) has no zeros.

### Relation to other functions

• In the first integral above, which defines the Gamma function, the limits of integration are fixed. The upper and lower incomplete Gamma functions are the functions obtained by allowing the lower or upper (respectively) limit of integration to vary.
• The Gamma function is related to the Beta function by the formula
'"`UNIQ--postMath-00000030-QINU`"'
'"`UNIQ--postMath-00000031-QINU`"'
And also in the following elegant formula:
'"`UNIQ--postMath-00000032-QINU`"' Which is only valid for Re(z) > 1.

## Particular values

Main article: Particular values of the Gamma function

'"`UNIQ--postMath-00000033-QINU`"'

## Approximations

Complex values of the Gamma function can be computed numerically with arbitrary precision using Stirling's approximation or the Lanczos approximation.

Applying integration by parts to Euler's integral, the Gamma function can also be written

'"`UNIQ--postMath-00000034-QINU`"'

where, if Re(z) has been reduced to the interval [1, 2], the last integral is smaller than x exp(-x) < 2-N. Thus by choosing an appropriate x, the Gamma function can be evaluated to N bits of precision with the above series. If z is rational, the computation can be performed with binary splitting in time O( (log(N)2 M(N) ) where M(N) is the time needed to multiply two N-bit numbers.

For arguments that are integer multiples of 1/24 the Gamma function can also be evaluated quickly using arithmetic-geometric mean iterations (see particular values of the Gamma function).

Because the Gamma and factorial functions grow so rapidly for moderately-large arguments, many computing environments include a function that returns the natural logarithm of the Gamma function (often given the name lngamma); this grows much more slowly, and for combinatorial calculations allows adding and subtracting logs instead of multiplying and dividing very large values. The digamma function, which is the derivative of this function, is also commonly seen.

## References

1. George Allen, and Unwin, Ltd., The Universal Encyclopedia of Mathematics. United States of America, New American Library, Simon and Schuster, Inc., 1964. (Forward by James R. Newman)
• Philip J. Davis, "Leonhard Euler's Integral: A Historical Profile of the Gamma Function," Am. Math. Monthly 66, 849-869 (1959)
• Template:Mathworld
• Pascal Sebah and Xavier Gourdon. Introduction to the Gamma Function. In PostScript and HTML formats.
• Bruno Haible & Thomas Papanikolaou. Fast multiprecision evaluation of series of rational numbers. Technical Report No. TI-7/97, Darmstadt University of Technology, 1997
• Julian Havil, Gamma, Exploring Euler's Constant", ISBN 0-691-09983-9 (c) 2003
• Emil Artin, "The Gamma function", in Rosen, Michael (ed.) Exposition by Emil Artin: a selection; History of Mathematics 30. Providence, RI: American Mathematical Society (2006).