Gamma function: Difference between revisions
imported>Fredrik Johansson No edit summary |
imported>Fredrik Johansson No edit summary |
||
Line 9: | Line 9: | ||
Does it at all make sense to define the ''factorial'' of a fraction? Whether or not such numbers are useful, it is easy to see that they could at least be defined. By plotting the factorial of a few small integers, it becomes apparent that the dots can be connected with a smooth curve. We could, very roughly, calculate fractional factorials by just inspecting the graph. The problem is that it is not so easy to find a ''formula'' that exactly describes the curve. In fact, we now know that no ''simple'' such formula exists — "simple" meaning that no finite combination of [[elementary function]]s such as the usual arithmetic operations and the [[exponential function]] will do. Considering the simple solution for triangular numbers, it may come as surprise that changing "+" to "·" makes such a difference. But it ''is'' possible to find a general formula for factorials, if we deploy tools from [[calculus]]. As it turns out, the idea of a fractional factorial makes a lot of sense. | Does it at all make sense to define the ''factorial'' of a fraction? Whether or not such numbers are useful, it is easy to see that they could at least be defined. By plotting the factorial of a few small integers, it becomes apparent that the dots can be connected with a smooth curve. We could, very roughly, calculate fractional factorials by just inspecting the graph. The problem is that it is not so easy to find a ''formula'' that exactly describes the curve. In fact, we now know that no ''simple'' such formula exists — "simple" meaning that no finite combination of [[elementary function]]s such as the usual arithmetic operations and the [[exponential function]] will do. Considering the simple solution for triangular numbers, it may come as surprise that changing "+" to "·" makes such a difference. But it ''is'' possible to find a general formula for factorials, if we deploy tools from [[calculus]]. As it turns out, the idea of a fractional factorial makes a lot of sense. | ||
== | ==Defining the gamma function== | ||
In modern treatments, the gamma function is usually defined using ''Euler's integral'', | In modern treatments, the gamma function is usually defined using ''Euler's integral'', | ||
Line 32: | Line 32: | ||
for positive natural numbers ''n'', or equivalently, that <math>\Gamma(n+1)=n!</math>. We may use these formulas to explicitly calculate <math>\Gamma(n)</math> or, conversely, to define ''z''! for non-integers in terms of the gamma function. | for positive natural numbers ''n'', or equivalently, that <math>\Gamma(n+1)=n!</math>. We may use these formulas to explicitly calculate <math>\Gamma(n)</math> or, conversely, to define ''z''! for non-integers in terms of the gamma function. | ||
The | The problem of extending the factorial to non-integer arguments was apparently first considered by [[Daniel Bernoulli]] and [[Christian Goldbach]] in the 1720s. <ref>{{cite book | author = Andrews, G. E., Askey, R. & Roy, R. | title = Special Functions | publisher = Cambridge University Press | date = 2001 | isbn = 0521789885 | pages = 2}}</ref> The Swiss mathematician [[Leonhard Euler]] found a solution: on October 13, 1729, he wrote to Goldbach that the factorial can be represented by the [[infinite product]] | ||
:<math>n! = \prod_{k=1}^\infty \frac{\left(1+\frac{1}{k}\right)^n}{1+\frac{n}{k}},</math> | |||
which easily generalizes to non-integer ''n''. He wrote to Goldbach again on January 8, 1730, to announce a different solution: the integral representation | |||
:<math>n!=\int_{0}^{1}(-\log s)^{n}\, ds,</math> | |||
which is valid for ''n'' > 0. By the change of varibles <math>t = -\log s</math>, this becomes the familiar "Euler integral". | |||
A contemporary of Euler, [[James Stirling]], also attempted to find a continuous expression for the factorial. In his ''Methodus Differentialis'' (1730), he published the famous ''[[Stirling's formula]]'' | |||
:<math>n!\approx\sqrt{2\pi n}\left(\frac{n}{e}\right)^{n}</math> | |||
Although Stirling's formula gives a good estimate of ''n''!, also for non-integers, it does not provide the exact value. Stirling made several attempts to refine his approximation, and eventually found a solution, although he never managed to prove that the extended version of his formula indeed corresponds exactly to the factorial. A proof was first given by [[Charles Hermite]] in 1900.<ref name="Knuth">{{cite book | author = Knuth, D. E. | title = The Art of Computer Programming, volume 1 (Fundamental Algorithms) | publisher = Addison-Wesley | date = 1997}}</ref> | |||
We have seen that the factorial can be extended to non-integers, but we have not yet considered whether the extensions are unique. How do we know that Euler's integral and product formulas define the same function? What about Stirling's formula, which was derived using a different approach? There are many other definitions for the gamma function as well. There are in fact infinitely many ways to extend the factorial, but the gamma function is the unique analytic solution, subject to the additional condition of being ''logarithmically convex'' for positive arguments. This fact was first proved by [[Harald Bohr]] and [[Johannes Mollerup]] in 1922 and is now known as the ''[[Bohr-Mollerup theorem]]''. Instead of using any particular formula, we could take the conditions of the Bohr-Mollerup theorem to be the definition of the gamma function, and then choose any formula we like that satisfies the conditions as a starting point for studying the gamma function. | |||
The name gamma function and the symbol <math>\Gamma</math> were introduced by [[Adrien-Marie Legendre]] around 1811. Although the symbol is an upper-case Greek Gamma, there is no accepted standard for whether the function name should be written "Gamma function" or "gamma function" (some authors simply write "<math>\Gamma</math>-function"). The alternative "Pi function" notation <math>\Pi(z)=z!</math> due to Gauss is sometimes encountered in older literature, but Legendre's notation is dominant in modern works. | |||
It is justified to ask why we distinguish between the "ordinary factorial" and the gamma function by using distinct symbols, and particularly why the gamma function should be normalized to <math>\Gamma(n+1)=n!</math> instead of simply using "<math>\Gamma(n)=n!</math>". Legendre's motivation for the normalization | |||
does not appear to be known, and has been criticized as cumbersome by some mathematicians ([[Cornelius Lanczos]], for example, called it "void of any rationality" and used <math>z!</math> instead). The normalization does simplify some formulas, but complicates others. | |||
==Main properties== | |||
The functional equation allows us to extend our definition to the entire complex plane, including negative real numbers for which, formally, the Euler's integral does not converge. Indeed, by rewriting the equation as | |||
:<math>\Gamma(z)=\frac{\Gamma(z+n)}{z(z+1)\cdots(z+n-1)},</math> | :<math>\Gamma(z)=\frac{\Gamma(z+n)}{z(z+1)\cdots(z+n-1)},</math> | ||
which we might call the ''forward recurrence relation'', and choosing ''n'' such that ''z''+''n'' lies in the positive half-plane, we can | which we might call the ''forward recurrence relation'', and choosing ''n'' such that ''z''+''n'' lies in the positive half-plane, we can compute <math>\Gamma(z)</math> for ''z'' different from <math>0,-1,-2,\ldots</math> (the right-hand side blows up, so the gamma function must be undefined at these points). Clearly, our extension defines an analytic function everywhere else. Therefore, by uniqueness, it is the above mentioned analytic continuation of the Euler integral. It follows that the gamma function is a [[meromorphic function]] with poles at the nonpositive integers. The following image shows the graph of the gamma function along the real line: | ||
[[Image:Gamma function.png|center]] | [[Image:Gamma function.png|center]] | ||
Line 51: | Line 75: | ||
</center> | </center> | ||
An important property of the gamma function is the ''reflection formula'' | |||
:<math>\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z}</math> | :<math>\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z}</math> | ||
Line 60: | Line 84: | ||
Hence, by the recurrence formula, the gamma function or factorial of any half-integer is a rational multiple of <math>\sqrt{\pi}</math>. | Hence, by the recurrence formula, the gamma function or factorial of any half-integer is a rational multiple of <math>\sqrt{\pi}</math>. | ||
[[Carl Friedrich Gauss]] considered the extended factorial in 1811. He started from the formula | [[Carl Friedrich Gauss]] considered the extended factorial in 1811. He started from the formula | ||
Line 97: | Line 103: | ||
</math> | </math> | ||
is a special case. | is a special case. Although Euler was a pioneer in the theory of complex variables, he does not appear to have considered the factorial of a complex number; this was first done by Gauss. <ref name="Remmert">{{cite book | author = Remmert, R., Kay, L. D. (translator) | title = Classical Topics in Complex Function Theory | publisher = Springer | date = 2006 | isbn = 0387982213}}</ref> | ||
==Derivatives and the zeta function== | ==Derivatives and the zeta function== | ||
Line 148: | Line 145: | ||
Among other things, this provides an explicit form for the [[analytic continuation]] of the zeta function to a meromorphic function in the complex plane and leads to an immediate proof that the zeta function has infinitely many so-called "trivial" zeros on the real line. Borwein ''et al''. call this formula "one of the most beautiful findings in mathematics".<ref>{{cite book | author = Borwein, J., Bailey, D. H. & Girgensohn, R. | date = 2003 | title = Experimentation in Mathematics | publisher = A. K. Peters | pages = 133 | isbn = 1-56881-136-5}}</ref> | Among other things, this provides an explicit form for the [[analytic continuation]] of the zeta function to a meromorphic function in the complex plane and leads to an immediate proof that the zeta function has infinitely many so-called "trivial" zeros on the real line. Borwein ''et al''. call this formula "one of the most beautiful findings in mathematics".<ref>{{cite book | author = Borwein, J., Bailey, D. H. & Girgensohn, R. | date = 2003 | title = Experimentation in Mathematics | publisher = A. K. Peters | pages = 133 | isbn = 1-56881-136-5}}</ref> | ||
The gamma function is unusual among the important special functions in mathematics in that it does not appear to satisfy any simple [[differential equation]]. The term "simple" can be qualified: [[Hölder's theorem]], proved by [[Otto Hölder]] in 1887, states that the gamma function does not satisfy any [[algebraic differential equation]] whose coefficients are rational functions. | |||
==Applications== | ==Applications== |
Revision as of 14:12, 19 April 2007
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 in 1729.
Motivation
Is there a "closed-form expression" for the product 1·2·3···n? To be in closed form, the number of arithmetic operations should not depend on the size of n. Such an expression would have several uses; first of all, we could calculate n! in a less tedious manner than by performing (n-1) multiplications. As a famous anecdote tells, Carl Friedrich Gauss found as a child that the sum can be written as — and was thereby able to quickly sum all the integers between 1 and 100, to the astonishment of his teacher. But a closed-form expression has more benefits than just computational convenience. If a formula does not depend on the size of n, it is also irrelevant whether the n is precisely an integer, and the formula should work for fractional numbers. Gauss's formula for sums of consecutive integers (such sums are now called triangular numbers) is obviously valid for non-integer values of n — in fact, when plotted for a continuously changing variable n, it describes a parabola.
Does it at all make sense to define the factorial of a fraction? Whether or not such numbers are useful, it is easy to see that they could at least be defined. By plotting the factorial of a few small integers, it becomes apparent that the dots can be connected with a smooth curve. We could, very roughly, calculate fractional factorials by just inspecting the graph. The problem is that it is not so easy to find a formula that exactly describes the curve. In fact, we now know that no simple such formula exists — "simple" meaning that no finite combination of elementary functions such as the usual arithmetic operations and the exponential function will do. Considering the simple solution for triangular numbers, it may come as surprise that changing "+" to "·" makes such a difference. But it is possible to find a general formula for factorials, if we deploy tools from calculus. As it turns out, the idea of a fractional factorial makes a lot of sense.
Defining the gamma function
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 and to determine its domain. It is easy to see that the integral converges if z is a positive real number or a complex number with positive real part. In fact, the integral defines an analytic function in the positive complex half-plane. Then, the definition of the function can be extended to the rest of the plane as well using the 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 problem of extending the factorial to non-integer arguments was apparently first considered by Daniel Bernoulli and Christian Goldbach in the 1720s. [1] The Swiss mathematician Leonhard Euler found a solution: on October 13, 1729, he wrote to Goldbach that the factorial can be represented by the infinite product
which easily generalizes to non-integer n. He wrote to Goldbach again on January 8, 1730, to announce a different solution: the integral representation
which is valid for n > 0. By the change of varibles , this becomes the familiar "Euler integral".
A contemporary of Euler, James Stirling, also attempted to find a continuous expression for the factorial. In his Methodus Differentialis (1730), he published the famous Stirling's formula
Although Stirling's formula gives a good estimate of n!, also for non-integers, it does not provide the exact value. Stirling made several attempts to refine his approximation, and eventually found a solution, although he never managed to prove that the extended version of his formula indeed corresponds exactly to the factorial. A proof was first given by Charles Hermite in 1900.[2]
We have seen that the factorial can be extended to non-integers, but we have not yet considered whether the extensions are unique. How do we know that Euler's integral and product formulas define the same function? What about Stirling's formula, which was derived using a different approach? There are many other definitions for the gamma function as well. There are in fact infinitely many ways to extend the factorial, but the gamma function is the unique analytic solution, subject to the additional condition of being logarithmically convex for positive arguments. This fact was first proved by Harald Bohr and Johannes Mollerup in 1922 and is now known as the Bohr-Mollerup theorem. Instead of using any particular formula, we could take the conditions of the Bohr-Mollerup theorem to be the definition of the gamma function, and then choose any formula we like that satisfies the conditions as a starting point for studying the gamma function.
The name gamma function and the symbol were introduced by Adrien-Marie Legendre around 1811. Although the symbol is an upper-case Greek Gamma, there is no accepted standard for whether the function name should be written "Gamma function" or "gamma function" (some authors simply write "-function"). The alternative "Pi function" notation due to Gauss is sometimes encountered in older literature, but Legendre's notation is dominant in modern works.
It is justified to ask why we distinguish between the "ordinary factorial" and the gamma function by using distinct symbols, and particularly why the gamma function should be normalized to instead of simply using "". Legendre's motivation for the normalization does not appear to be known, and has been criticized as cumbersome by some mathematicians (Cornelius Lanczos, for example, called it "void of any rationality" and used instead). The normalization does simplify some formulas, but complicates others.
Main properties
The functional equation allows us to extend our definition to the entire complex plane, including negative real numbers for which, formally, the Euler's integral does not converge. Indeed, by rewriting the equation as
which we might call the forward recurrence relation, and choosing n such that z+n lies in the positive half-plane, we can compute for z different from (the right-hand side blows up, so the gamma function must be undefined at these points). Clearly, our extension defines an analytic function everywhere else. Therefore, by uniqueness, it is the above mentioned analytic continuation of the Euler integral. It follows that the gamma function is a meromorphic function with poles at the nonpositive integers. The following image shows the graph of the gamma function along the real line:
The gamma function is nonzero everywhere along the real line, although it comes arbitrarily close as . There is in fact no complex number z for which , and hence the reciprocal gamma function is an entire function, with zeros at . 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.
Plotting the gamma function in the complex plane yields beautiful graphs:
An important property of the gamma function is the reflection formula
which gives a concise relation between the gamma function of positive and negative numbers. The division by a sine, which is periodically zero, again indicates the existence of the gamma function's periodically occurring poles. Further, inserting z = 1/2 reveals the surprising fact that
Hence, by the recurrence formula, the gamma function or factorial of any half-integer is a rational multiple of .
Carl Friedrich Gauss considered the extended factorial in 1811. He started from the formula
which, although often attributed him, was apparently known to Euler. Gauss proved a new functional equation of the gamma function, namely the multiplication theorem
of which the duplication formula
is a special case. Although Euler was a pioneer in the theory of complex variables, he does not appear to have considered the factorial of a complex number; this was first done by Gauss. [3]
Derivatives and the zeta function
With the gamma function, it becomes possible to calculate the "derivative of the factorial".
Karl Weierstrass rewrote Euler's product as
where is Euler's constant. This expression is a product taken over the gamma function's poles at the nonpositive integers; that is, it is the product of simple factors that each contribute a single pole. Weierstrass originally considered , in which case the product is taken over the function's zeroes. Inspired by this result, he proved what is known as the Weierstrass factorization theorem — that any entire function can be written as a product over its zeroes.
We will use Weierstrass's product as a starting point for investigating the derivatives of the gamma function. Taking logarithms of both sides in Weierstrass's product, we can write the logarithm of the gamma function in the form of a series
Differentiating termwise renders the logarithmic derivative of the gamma function
which is called the digamma function, denoted by . The expression for the digamma function is simpler than the series we started with, all logarithms notably absent. If , a positive integer, all but finitely many terms in the series cancel and we are left with
where is the harmonic number . As it generalizes harmonic numbers to non-integer indices, we could say that the digamma function is to harmonic numbers as the gamma function is to the factorials. Since , we can recover the ordinary derivative of the gamma function as ; the derivative at an integer is then and in particular, , providing a geometric interpretation of Euler's constant as the slope of the gamma function's graph at 1.
Continuing in a similar manner, it is possible to derive higher-order derivatives of the gamma function. We define the polygamma function (of order m) as
Of course, the digamma function is the special case . The polygamma functions are of great importance in analytic number theory due to their relation to the Riemann zeta function. In particular, it can be shown that the polygamma function at an integer value is expressible in terms of the zeta function at integers. With the higher-order derivatives available, it becomes possible to calculate the Taylor series of the gamma function around any integer in terms of Euler's constant and the zeta function. Choosing instead of for convenience, since the former is an entire function and hence has an everywhere convergent Taylor series in the simple point , we can compute
where , ,
and is the Riemann zeta function. This is merely one of many connections between the gamma function and the zeta function. An important property of the Riemann zeta function is its functional equation:
Among other things, this provides an explicit form for the analytic continuation of the zeta function to a meromorphic function in the complex plane and leads to an immediate proof that the zeta function has infinitely many so-called "trivial" zeros on the real line. Borwein et al. call this formula "one of the most beautiful findings in mathematics".[4]
The gamma function is unusual among the important special functions in mathematics in that it does not appear to satisfy any simple differential equation. The term "simple" can be qualified: Hölder's theorem, proved by Otto Hölder in 1887, states that the gamma function does not satisfy any algebraic differential equation whose coefficients are rational functions.
Applications
Frequently encountered generalizations of the gamma function include the incomplete gamma functions
and the beta function
There are many other generalizations of the gamma function, including a multivariate gamma function and a q-series analog, the elliptic gamma function. Two analogs of the gamma function are the Barnes G-function, which extends superfactorials to the complex numbers, and the K-function which does the same for hyperfactorials. The Glaisher-Kinkelin constant sometimes appears in formulas related to these functions and the gamma function.
A variety of definite and indefinite integrals whose solutions are nonelementary can be expressed in terms of some combination of gamma functions and incomplete gamma functions. An example is that the Laplace transform of the power function xc reduces to the Euler integral and hence the gamma function. Watson's triple integrals provide a more complicated example.
Integrands involving powers are particularly often susceptible to evaluation in terms of gamma functions, as it may be possible to consider the exponent an integer, eliminate it by repeated integration by parts to obtain a factorial times a solvable integral, and generalizing the result to arbitrary complex exponents by replacing the factorial with a gamma function. At other times, it is possible to directly transform an integral into an Euler integral by an appropriate change of variables.
Viewed as a non-elementary integral of an elementary function, the gamma function belongs to the same category of special functions as the error function, the exponential integral, the logarithmic integral, and the sine integral. There are many known interrelations between these functions and the gamma function.
The gamma function is also important in the theory of hypergeometric functions, the Meijer G-function and the Fox H-function. The G and H-functions are defined in terms of Mellin-Barnes integrals which are certain complex contour integrals of products of gamma functions.
The gamma function can be used to express many types of products besides the ordinary factorial, such as multiple factorials, Pochhammer symbols and binomial coefficients. For a monic polynomial P with roots p1...pn, one has the general formula
which in turn can be generalized to a formula for quotients of polynomials. Summation of series where each term is a rational function of the running index can be performed in an analogous manner using polygamma functions.
The gamma function is also used in statistics to define the gamma distribution, the inverse-gamma distribution, and the beta distribution.
Numerical 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.
References
- ↑ Andrews, G. E., Askey, R. & Roy, R. (2001). Special Functions. Cambridge University Press, 2. ISBN 0521789885.
- ↑ Knuth, D. E. (1997). The Art of Computer Programming, volume 1 (Fundamental Algorithms). Addison-Wesley.
- ↑ Remmert, R., Kay, L. D. (translator) (2006). Classical Topics in Complex Function Theory. Springer. ISBN 0387982213.
- ↑ Borwein, J., Bailey, D. H. & Girgensohn, R. (2003). Experimentation in Mathematics. A. K. Peters, 133. ISBN 1-56881-136-5.