next up previous contents
Next: Beta Function Up: Special Functions Previous: Special Functions

Gamma Function

The gamma function is described by the integral

equation225

and for integer arguments is related to the factorial function

equation230

It is possible to numerically implement this function in Mathematica as

gammafn[n_] := NIntegrate[x^(n-1) Exp[-x], {x,0, Infinity}]
but the gamma function is already present as part of the standard built-in set.
gammafn[1]

1.

gammafn[2]

1.

Gamma[2]

1

gammafn[0.5]

1.77245

Gamma[0.5]

1.77245

The integer form of the Gamma function, the factorial function, appears in the classical density of states for a set of s harmonic oscillators

equation234

and allows the corresponding partition function to be determined

equation239



Harold Schranz
Tue Jul 1 19:43:28 EST 1997