Results 1 to 9 of 9

Thread: Extending Factorials

  1. Top | #1
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84

    Extending Factorials

    I have fond memories from long ago of Abramowitz and Stegun's fat book "Handbook of Mathematical Functions". It is online at Abramowitz and Stegun: Handbook of Mathematical Functions

    One of the chapters is "Gamma Function and Related Functions", about an extension of the factorial function. To understand that extension, consider an integral representation of it:

     n! = \int_0^\infty t^n e^{-t} dt

    It is easy to find 0! from it, and also to find the factorial recurrence relation, n! = n*(n-1)! from it. One does integration by parts:

     n! = \int t^n d(-e^{-t}) = - t^n e^{-t} + n \int t^{n-1} e^{-t} dt

    Can we extend this integral representation to non-integer n? We can indeed do so, and that is the Euler gamma function:

     n! = \Gamma(n+1)

     \Gamma(z) = \int_0^\infty t^{z-1} e^{-t} dt

    One can express the exponential function as the limit of a polynomial function:

     \Gamma(z) = \lim_{n\to\infty} \int_0^n t^{z-1} \left( 1 - \frac{t}{n} \right)^n dt = \lim_{n\to\infty} \frac{n! n^z}{\prod_{k=0}^n (z+k)}

    This is Euler's formula, and it yields Euler's infinite product:

     \frac{1}{\Gamma(z)} = z e^{\gamma z} \prod_{n=1}^\infty \left( 1 + \frac{z}{n} \right) e^{-z/n}

    where γ is the Euler-Mascheroni constant:

     \gamma = 0.57721\ 56649 \ldots

  2. Top | #2
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
    The derivative of the logarithm of the Euler gamma function is the psi or digamma function:

     \psi(z) = \frac{d}{dz} (\log \Gamma(z) )

    From Euler's formula,

     \psi(z) = \lim_{n\to\infty} \left( \log n - \sum_{k=0}^n \frac{1}{z+k} \right) = - \gamma - \frac{1}{z} + \sum_{n=1}^\infty \frac{z}{n(n+z)}

    Taking another derivative gives the trigamma function,

     \psi'(z) = \sum_{n=0}^\infty \frac{1}{(z+n)^2}

    Or more generally, the polygamma function,

     \psi^{(n)}(z) = (-1)^{n+1} n! \sum_{k=0}^\infty \frac{1}{(z+k)^{n+1}}

    This gives us an integral form:

     \psi^{(n)}(z) = (-1)^{n+1} \int_0^{\infty} \frac{t^n e^{-z t}}{1 - e^{-t}} dt

    Integrating it gives us

     \psi(z) = \int_0^\infty \left( \frac{e^{-t}}{t} - \frac{e^{-z t}}{1 - e^{-t}} \right) dt

    and

     \log \Gamma(z) = \int_0^\infty \left( (z-1) e^{-t} - \frac{e^{-t} - e^{-z t}}{1 - e^{-t}} \right) \frac{dt}{t}

    The last one is easy to verify for z = 1 and z = 2. One can also verify the recurrence relation

     \log \Gamma(z+1) = \log \Gamma(z) + \log z

  3. Top | #3
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
    One can find a reflection formula:

     \Gamma(z) \Gamma(1-z) = \frac{\pi}{\sin (\pi z)}

    Also Gauss's multiplication formula:

     \Gamma(n z) = (2\pi)^{(1-n)/2} n^{n z - 1/2} \prod_{k=0}^{n-1} \Gamma \left( z + \frac{k}{n} \right)

    One can get an interesting result with n = 2 and z = 1/2 in the multiplication formula, and z = 1/2 in the reflection formula:

     \Gamma(1/2) = \sqrt{\pi}

  4. Top | #4
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
    The recurrence:
     \psi(z+1) = \psi(z) + \frac{1}{z}
    and
     \psi^{(n)}(z+1) = \psi^{(n)}(z) + \frac{(-1)^n n!}{z^{n+1}}

    The reflection formula uses this infinite product for the sine:
     \sin (\pi z) = \pi z \prod_{n=1}^{\infty} \left( 1 - \frac{z^2}{n^2} \right)

    There is a similar formula for the cosine:
     \cos (\pi z) = \prod_{n=1}^{\infty} \left( 1 - \frac{z^2}{(n-1/2)^2} \right)

  5. Top | #5
    Quantum Hot Dog Kharakov's Avatar
    Join Date
    Aug 2000
    Location
    OCCaUSA
    Posts
    4,370
    Archived
    3,383
    Total Posts
    7,753
    Rep Power
    77
    The Gamma function is one of the functions connecting discrete and continuous mathematics.

    Euler's Formula (from A & S) is a nice, fully written out version. Loren had it, but I didn't see it at first when I glanced over his formulas. I think this version looks nicer:






    1) Weird. I couldn't post in this thread earlier. Maybe I timed out when reading some other site. Reopened the thread, and it seems to work...

    2) Now it says "the message you have entered is too short". ETA: fixed. While the editor allows you to copy and paste an image, whenever you do that (instead of using the image button), it gives you the "message is less than 2 characters" popup.


    3) I think all of it was me copying and pasting an image. Both errors. One time I had written out a decent sized post.. and lost the whole thing when I clicked "go advanced". It showed a blank edit window. Copied stuff into it, and it sort of worked, tried to back out and go forward in the browser, and lost everything. mehh. That used to fix it here. Maybe new version of firefox, or ES7? I dunno.
    Last edited by Kharakov; 03-13-2020 at 02:47 AM.

  6. Top | #6
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
    Here is Euler's formula, for deriving the reflection formula:
     \Gamma(z) = \lim_{n\to\infty} \frac{n^z}{z (1+z)(1+z/2) \cdots (1+z/n)}

     \Gamma(1+z) = \lim_{n\to\infty} \frac{n^z}{(1+z)(1+z/2) \cdots (1+z/n)}


     \Gamma(1-z) = \lim_{n\to\infty} \frac{n^{-z}}{(1-z)(1-z/2) \cdots (1-z/n)}

     \Gamma(z) \Gamma(1-z) = \frac{1}{z (1 - z^2) (1 - z^2/2^2) (1 - z^2/3^2) \cdots} = \frac{\pi}{\sin (\pi z)}

  7. Top | #7
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
    Now the multiplication formula.
     \sum_{k=0}^{n-1} \psi^{(m)}(z+k/n) = \sum_{k=0}^{n-1} (-1)^{m+1} \int_0^\infty \frac{t^m e^{-(z+k/n)t}}{1 - e^{-t}} dt

     \sum_{k=0}^{n-1} e^{-(z+k/n)t} = e^{-z t} \frac{1 - e^{-t}}{1 - e^{-t/n}}

     (-1)^{m+1} \int_0^\infty \frac{t^m e^{-z t}}{1 - e^{-t/n}} dt = n^{m+1} \psi^{(m)}(n z)

    In summary,

     \psi^{(m)}(n z) = n^{-(m+1)} \sum_{k=0}^{n-1} \psi^{(m)}(z+k/n)

    That gives us

     \psi(n z) = C_0(n) + \frac{1}{n} \sum_{k=0}^{n-1} \psi(z+k/n)

    and

     \log \Gamma(n z) = n z C_0(n) + C_1(n) + \sum_{k=0}^{n-1} \log\Gamma(z+k/n)

    Here, C0(n) and C1(n) are constants of integration, and we must find those constants.

  8. Top | #8
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
     \sum_{k=0}^{n-1} \psi(z + k/n) = \sum_{k=0}^{n-1} \int_{\epsilon}^\infty \left( \frac{e^{-t}}{t} - \frac{e^{-t} - e^{- (z+k/n) t}}{1 - e^{-t}} \right) dt = n \int_{\epsilon}^\infty \left( \frac{e^{-t}}{t} - \frac{e^{-t}}{1 - e^{-t}} \right) dt + \int_{\epsilon}^\infty \frac{e^{-z}}{1 - e^{-t/n}} dt

    where ε has limit 0.

    Multiply t by n in the second integral on the right:
     n \int_{n \epsilon}^\infty \frac{e^{- n z t}}{1 - e^{-t}} dt = n \int_{\epsilon}^\infty \frac{e^{- n z t}}{1 - e^{-t}} dt - n \int_{\epsilon}^{n \epsilon} \frac{dt}{t}

    The second integral evaluates to n*log(n), and we find

     \psi(n z) = \log n + \frac{1}{n} \sum_{k=0}^{n-1} \psi(z + k/n)

    This gives us C0(n).

  9. Top | #9
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    9,573
    Archived
    16,829
    Total Posts
    26,402
    Rep Power
    84
     \sum_{k=0}^{n-1} \log \Gamma(z+k/n) = \int_{\epsilon}^\infty \left( (n z - (n+1)/2) e^{-t} - n \frac{e^{-t}}{1 - e^{-t}} + \frac{e^{- z t}}{1 - e^{-t/n}} \right) \frac{dt}{t}

    with the integral including the multiplied gamma function:
     \log \Gamma(n z) + \int_{\epsilon}^\infty \left( - ((n-1)/2) e^{-t} - (n-1) \frac{e^{-t}}{1 - e^{-t}} + \frac{e^{- z t}}{1 - e^{-t/n}} - \frac{e^{-n z t}}{1 - e^{-t}} \right) \frac{dt}{t}

    One can expand the integral as a series in z, and powers of z greater than 1 will vanish, because the integrand has no divergences in it in that case. It is the presence of those divergences that makes nonzero coefficients of 1 and z. The part with z is

     \int_{\epsilon}^\infty \left( \frac{- z t}{1 - e^{-t/n}} - \frac{-n z t}{1 - e^{-t}} \right) \frac{dt}{t} = z \int_{\epsilon}^\infty \left( - \frac{1}{1 - e^{-t/n}} + \frac{n}{1 - e^{-t}} \right) dt = - n z \int_{\epsilon}^{n \epsilon} \frac{dt}{t} = - n z \log n

     \log \Gamma(n z) - n z \log n+ \int_{\epsilon}^\infty \left( - ((n-1)/2) e^{-t} - (n-1) \frac{e^{-t}}{1 - e^{-t}} + \frac{1}{1 - e^{-t/n}} - \frac{1}{1 - e^{-t}} \right) \frac{dt}{t}

    Simplifying the integral gives us

     \log \Gamma(n z) - n z \log n+ \int_{\epsilon}^\infty \left( (n-1) - ((n-1)/2) e^{-t} + \frac{1}{1 - e^{-t/n}} - \frac{n}{1 - e^{-t}} \right) \frac{dt}{t}

    It's necessary to reshuffle the integral so we can do some cancellation on it:
     \int_{\epsilon}^\infty \left[ \frac12 (e^{-t} - e^{-t/n}) + \left( \frac{1}{1 - e^{-t/n}} - \frac{n}{t} - 1 + \frac12 e^{-t/n} \right) - \left( \frac{n}{1 - e^{-t}} - \frac{n}{t} - n + \frac{n}{2} e^{-t} \right) \right] \frac{dt}{t}

    The first term in parens can be turned into the integral
     - \frac12 \int_{\epsilon/n}^{\epsilon}\frac{e^{-t}}{t} dt = - \frac12 \log n

    The second and third terms in parens are well-behaved for small t, and the second one can be shifted by taking t -> n*t. This gives us
     - \frac12 \log n - (n - 1) \int_0^\infty \left( \frac{1}{1 - e^{-t}} - \frac{1}{t} - 1 + \frac12 e^{-t} \right) \frac{dt}{t}

    The remaining integral is equal to -(1/2)*log(2*pi)

    I don't know why the sign on (1/2)*log(n) is - instead of + as it's supposed to be -- any typo anywhere?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •