Gamma function

From Citizendium
Revision as of 17:02, 7 April 2007 by imported>Fredrik Johansson (new, in progress, several sections to be filled in)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The gamma function is a mathematical function that extends the domain of factorials to non-integers. The factorial of a positive integer n, written n!, is the product 1·2·3···n. The gamma function, denoted by , is defined to satisfy for all positive integers n and to smoothly interpolate the factorial between the integers. The gamma function is one of the most commonly occurring examples of a nonelementary function; that is, a function that cannot be expressed in finite terms using algebraic operations, exponentials, and logarithms. Its study dates back to Leonhard Euler, who gave a formula for its calculation 1729.

Definition and basic properties

The product cannot be expressed in closed form using only regular arithmetic operations and elementary functions. This is perhaps surprising, since the analogous sum is simply , a triangular number. To find a closed-form expression for factorials, it is necessary to deploy tools from calculus. In modern treatments, the gamma function is usually defined using Euler's integral,

It is a slight technicality to prove that this integral defines a well-behaved function. The integral converges uniformly if z is a positive real number or a complex number with positive real part, and hence the gamma function is a continuous function in this domain. In fact, the integral defines an analytic function in the positive complex half-plane. The integral is only valid for positive z, but the gamma function can be defined for negative numbers as well using analytic continuation. We will give the continuation explicitly in a moment.

To see why we are justified in calling the gamma function as defined above an extension of the factorial, we insert z+1 instead of z and perform an integration by parts to obtain

This relation is called the functional equation of the gamma function. It is analogous to the recurrence formula for the factorial, , the only difference being that the function argument has been shifted by 1. More generally, a repeated application of the functional equation gives

With the initial value , this establishes that

for positive natural numbers n, or equivalently, that . We may use these formulas to explicitly calculate , or conversely, to define z! for non-integers in terms of the gamma function. The functional equation allows us to extend our definition to the entire complex plane — including negative numbers — by rewriting the functional equation as

which we might call the forward recurrence relation, and choosing n such that z+n lies in the positive half-plane. The right-hand side blows up for , so the gamma function must be undefined at these points, but our extension defines an analytic function everywhere else. Hence, the gamma function is a meromorphic function with poles at the nonpositive integers.

We see that the gamma function has a local minimum at where it attains the value . The gamma function must alternate sign between the poles because the product in the forward recurrence contains an odd number of negative factors if the number of poles between z and z+n is odd, and an even number if the number of poles is even.

History and notation

Derivatives

Relation to the Riemann zeta function

Use in integration

Calculation

Although the gamma function cannot be expressed exactly in terms of elementary functions, the graphs and numerical values given in this article imply the existence of methods for its numerical calculation. One straightforward approach would be to perform numerical integration of Euler's integral, but there are more efficient methods. The most popular is an extended version of Stirling's formula known as Stirling's series

where the coefficients in the series can be calculated analytically in terms of Bernoulli numbers. The "" sign in this formula denotes an asymptotic equality: the series diverges for every z, but yields arbitrarily accurate approximations of the gamma function as if truncated appropriately. A practical way to calculate the gamma function is to calculate for some large integer n using Stirling's series and then repeatedly apply the recurrence formula to obtain . Taking and including the three first terms in Stirling's series, we obtain

This particular approximation is good to five decimal places on the interval [1, 2]. With larger n and more terms, Stirling's formula can be used to calculate the gamma function with arbitrary precision. Other practical methods include the Lanczos approximation and Spouge's approximation.

In general, the following properties of the gamma function are useful to have in mind for numerical calculations:

  • Due to the recurrence formula, the gamma function can be calculated anywhere in the complex plane if it can be calculated in some region with real part in .
  • If the gamma function can be calculated in the positive half-plane, the reflection formula permits its computation in the negative half-plane as well.
  • It may be convenient to work with the logarithm of the gamma function to avoid overflow for large arguments. It is common to encounter a quotient of two gamma functions, which are best computed by subtracting logarithms.

Double-precision (16-digit) floating-point implementations of the gamma function are available in most scientific computing software and special functions libraries, for example Matlab, GNU Octave, and the GNU Scientific Library. The gamma function was also added to the C mathematics library (math.h) as part of the C99 standard, but is not implemented by all C compilers. Arbitrary-precision implementations are available in most computer algebra systems, such as Mathematica and Maple. Pari/GP and MPFR provide free arbitrary-precision implementations.