How did Lanczos find his approximation for the Gamma function?

314 Views Asked by At

The Lanczos approximation gives a fixed-precision method for calculating the Gamma function. It is used in Desmos in their factorial function.

According to this Wikipedia page, Lanczos derived his approximation of the Gamma function by rewriting its defining integral, $$\Gamma(z+1)=\int_0^{\infty}t^ze^{-t}dt$$Into the following form:

$$= (z + g + 1)^{z+1}e^{-(z+g+1)} \int_0^e \Big( v \left( 1-\log{v} \right) \Big)^zv^gdv$$

He then found a series representation for the integral in this expression.

What kind of substitution would you have to use to get this form of the integral? Moreover, where did the constant $g$ come from, and what motivated Lanczos to include this constant in his formula? Finally, how could you derive a series expansion for this integral?


EDIT

@Kstargamer gave me a hint to help with the first part of this problem, the rewriting of the Gamma function. It only requires a couple of substitutions.

Start with the substitution $t = u(z+g+1) \iff dt=(z+g+1)du$. The limits of integration remain the same. This gives: $$\Gamma(z+1)=\int_0^{\infty} (u(z+g+1))^ze^{-u(z+g+1)} (z+g+1) \,du \\ = (z+g+1)^{z+1} \int_0^{\infty} u^ze^{-u(z+g+1)} \,du $$

Next, substitute $u = 1-\log{v} \iff v = e^{1-u}, du = -\frac{dv}{v}$. As $u \to 0, v \to e$. As $u \to \infty, v \to 0$. This gives: $$\Gamma(z+1) = (z+g+1)^{z+1} \int_e^0 (1-\log{v})^z \left(\frac{v}{e}\right)^{z+g+1}\frac{-dv}{v} \\ = (z+g+1)^{z+1}e^{-(z+g+1)} \int_0^e (1-\log{v})^z v^{z+g}\, dv \\ \therefore \Gamma(z+1) = (z+g+1)^{z+1}e^{-(z+g+1)} \int_0^e \Big(v(1-\log{v})\Big)^z v^g\, dv $$

And with that, we have the simple manipulations that give the integral that Lanczos used.

However, this does not close the question. I’m still looking for a way to derive the series expansion for this integral that Lanczos used. I’m open to ANY suggestions as to how to find this.