There are few creatures in mathematics as interesting yet, somehow,
useful as the Gamma function,
Γ:Cs→C↦0∫∞xs−1e−xdx.An interesting result about this function is that
Γ(n) = (n−1)! for positive integers n∈N.
But why is that so?
Better yet, why is the gamma function defined so,
how is it related to factorials,
and what does its values at non-integers mean?
An interesting integral
First, consider the integral
I(x)=∫lnxdx.It is not a polynomial function, so we cannot use the power rule.
However, if you remember your calculus well, you may recall integration
by parts:
∫udv=uv−∫vdu.Write u = lnx and dv = dx.
Then du = x1dx and v = x.
So
I(x)=∫lnxdx=xlnx−∫xx1dx=xlnx−x+C.Power TWO
What happens if we have higher powers of lnx?
I2(x)=∫ln2xdxSubstitute u = ln2x and dv = dx.
Then du = x2lnxdx and v = x.
Using integration by parts;
I2(x)=∫ln2xdx=xln2x−∫xx2lnxdx=xln2x−2∫lnxdxInterestingly, we get I(x) as part of the integration result of I2(x).
If we fully integrate the result, we get:
I2(x)=xln2x−2∫lnxdx=xln2x−2(xlnx−x)+C=xln2x−2xlnx+2x+C.Power THREE
What happens with the third power?
Take a guess, you're probably right.
I3(x)=∫ln3xdxTake u = ln3x and dv = dx.
Then du = x3ln2xdx and v = x.
I3(x)=∫ln3xdx=xln3x−∫x⋅3ln2x⋅x1dx=xln3x−3∫ln2xdxAgain, we have I2(x) as part of the integration result of I3(x).
Evaluating the integral fully gives:
I3(x)=xln3x−3∫ln2xdx=xln3x−3(xln2x−2xlnx+2x)+C=xln3x−3xln2x+6xlnx−6x+C.A pattern in the chaos?
Indeed, it always occurs that
In(x) = xlnnx−nIn−1(x).
But why is this a useful result?
Take a look at the coefficients of the last term, x.
I(x)I2(x)I3(x)I4(x)I5(x)=xlnx−x+C=xln2x−2xlnx+2x+C=xln3x−3xln2x+6xlnx−6x+C=xln4x−4xln3x+12xln2x−24xlnx+24x+C=xln5x−5xln4x+20xln3x−60xln2x+120xlnx−120x+C⋮Those are factorials, with alternating signs (positive, negative).
Recovering the factorial
Our goal is two-fold:
- To get rid of the leading terms involving lnx.
- To get rid of the alternation in signs.
Removing the Leading Terms
The leading terms have one thing in common: they are all a product of x and a power of lnx.
Thus, they all tend to zero at both x = 1 (since ln1 = 0) and at x = 0.
We need to retain the last term with just x, which we can do by evaluating the integral
over the interval (0,1).
[In]01 = 0∫1lnnxdx=[(−1)n⋅n!⋅x]01=(−1)n⋅n!Removing the Sign Alternation
To do this, we need to negate the result for odd n.
This is easily achieved by dividing the result by (−1)n,
giving the integral
n!=(−1)n10∫1lnnxdx=0∫1(−1)nlnnxdx=0∫1(−1lnx)ndx=0∫1(−lnx)ndx=0∫1lnnx1dx.The Gamma Function
But the integral now looks complicated.
Can we simplify it?
Substitute u = lnx1, so that:
u−uxdx=lnx1=lnx=e−u=−e−uduNote that as x→0+, x1→∞+,
therefore u→∞+,
and when x→1, x1→1, so u→0.
Thus;
0∫1lnnx1dx=∞∫0un⋅(−e−u)du=−∞∫0un⋅e−udu=0∫∞un⋅e−uduThis is the exact form of the gamma function, evaluated at s = n+1.
info
Why is the gamma function shifted by 1?
The ideas behind the function started being developed
by Bernoulli and Goldbach in the early 1700s,
and Euler defined the eventual function in 1729
(Euler was Bernoulli's student).
However, the function, in its current form and name,
was defined by Legendre in 1811.
He most likely shifted the function by 1 to make it easier to work with
by giving it a pole1 at the origin instead of at s = −1.
The Gamma Extensions
The gamma function has various useful properties.
For example, although it collapses to the factorial function at positive integers,
it is well-defined for all complex numbers except zero and the non-negative integers.
It is sometimes used as an analytic continuation of the factorial function
to fractional and complex values.
Over non-integers, the logarithmic terms are consequential in the value
giving rise to the gamma extensions.
As an ode to its relevance, Γ appears in multiple areas of mathematics,
including:
ζ(s)=n=1∑∞ns1=Γ(s)10∫∞ex−1xs−1dx.β(a,b)=0∫1xa−1(1−x)b−1dx=Γ(a+b)Γ(a)Γ(b).π−s/2Γ(2s)ζ(s)=π−(1−s)/2Γ(21−s)ζ(1−s).