# Gamma function

In mathematics, the Gamma function extends the factorial function to complex and non natural numbers (where it is defined). The factorial function of an integer n is written n! and is equal to the product n! = 1 × 2 × 3 × ... × n. The Gamma function "fills in" the factorial function for fractional values of n and for complex values of n. If z is a complex variable, then for integer values only, we have

$\Gamma (z+1)=z!\,$ but for fractional and complex values of z, the above equation does not apply, since the factorial function is not defined.

## Definition

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

$\Gamma (z)=\int _{0}^{\infty }t^{z-1}\,e^{-t}\,dt$ converges absolutely. Using integration by parts, one can show that

$\Gamma (z+1)=z\,\Gamma (z)\,.$ Because Γ(1) = 1, this relation implies that

$\Gamma (n+1)=n\,\Gamma (n)=\cdots =n!\,\Gamma (1)=n!\,$ for all natural numbers n. 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.

File:Gamma abs.png
The Gamma function in the complex numbers

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:

$\Gamma (z)=\lim _{n\to \infty }{\frac {n!\;n^{z}}{z\;(z+1)\cdots (z+n)}}$ $\Gamma (z)={\frac {e^{-\gamma z}}{z}}\prod _{n=1}^{\infty }\left(1+{\frac {z}{n}}\right)^{-1}e^{z/n}$ where γ is the Euler-Mascheroni constant.

## Properties

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

$\Gamma (1-z)\;\Gamma (z)={\pi \over \sin \pi z}$ and the duplication formula

$\Gamma (z)\;\Gamma \left(z+{\frac {1}{2}}\right)=2^{1-2z}\;{\sqrt {\pi }}\;\Gamma (2z).$ The duplication formula is a special case of the multiplication theorem

$\Gamma (z)\;\Gamma \left(z+{\frac {1}{m}}\right)\;\Gamma \left(z+{\frac {2}{m}}\right)\cdots \Gamma \left(z+{\frac {m-1}{m}}\right)=(2\pi )^{(m-1)/2}\;m^{1/2-mz}\;\Gamma (mz).$ Perhaps the most well-known value of the Gamma function at a non-integer argument is

$\Gamma \left({\frac {1}{2}}\right)={\sqrt {\pi }},$ which can be found by setting z=1/2 in the reflection formula or by noticing the beta function for (1/2, 1/2), which is ${\sqrt {\pi }}$ .

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

$\Gamma '(z)=\Gamma (z)\psi _{0}(z).\,$ The Gamma function has a pole of order 1 at z = −n for every natural number n; the residue there is given by

$\operatorname {Res} (\Gamma ,-n)={\frac {(-1)^{n}}{n!}}.$ 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.

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

$\Pi (z)=\Gamma (z+1)=z\;\Gamma (z),$ so that

$\Pi (n)=n!.\,$ Using the Pi function the reflection formula takes on the form

$\Pi (z)\;\Pi (-z)={\frac {\pi z}{\sin \pi z}}={\frac {1}{\mathrm {sinc} _{N}(x)}}$ where sincN is the normalized Sinc function, while the multiplication theorem takes on the form

$\Pi \left({\frac {z}{m}}\right)\,\Pi \left({\frac {z-1}{m}}\right)\cdots \Pi \left({\frac {z-m+1}{m}}\right)=\left({\frac {(2\pi )^{m}}{2\pi m}}\right)^{1/2}\,m^{-z}\,\Pi (z).$ We also sometimes find

$\pi (z)={1 \over \Pi (z)}\,$ 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 incomplete Gamma function is the function obtained by allowing either the upper or lower limit of integration to be variable.

The Gamma function is related to the Beta function by the formula

$\mathrm {B} (x,y)={\frac {\Gamma (x)\;\Gamma (y)}{\Gamma (x+y)}}.$ The derivative of the logarithm of the Gamma function is called the digamma function; higher derivatives are the polygamma functions.

## Particular values

 $\Gamma (-2)\,$ (undefined) $\Gamma (-3/2)\,$ = ${\frac {4{\sqrt {\pi }}}{3}}\,$ $\Gamma (-1)\,$ (undefined) $\Gamma (-1/2)\,$ = $-2{\sqrt {\pi }}\,$ $\Gamma (0)\,$ (undefined) $\Gamma (1/2)\,$ = ${\sqrt {\pi }}\,$ $\Gamma (1)\,$ = $0!\,$ =$1\,$ $\Gamma (3/2)\,$ = ${\frac {\sqrt {\pi }}{2}}\,$ $\Gamma (2)\,$ = $1!\,$ =$1\,$ $\Gamma (5/2)\,$ = ${\frac {3{\sqrt {\pi }}}{4}}\,$ $\Gamma (3)\,$ = $2!\,$ =$2\,$ $\Gamma (7/2)\,$ = ${\frac {15{\sqrt {\pi }}}{8}}\,$ $\Gamma (4)\,$ = $3!\,$ =$6\,$ ## Approximations

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

As an alternative that can be implemented easily on most calculators, Toth (2004) suggests the approximation

$\Gamma (z)\cong {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}\left[+{\frac {1}{810z^{6}}}\right]}}\right)^{z}$ which is good to more than 8 decimal digits for z with a real part greater than 8, and may be combined with the reflection formula for negative z. The optional term in square brackets increases the accuracy slightly.