Math Methods · Learn

The Gamma Function

Factorial only knows whole numbers. Euler found a curve that agrees with factorial everywhere it's defined, fills in every gap between, and keeps going past zero into a landscape of poles.

▶ Play the lab📖 Learn the theory

1Euler's integral

For $x>0$, define:

$$ \Gamma(x) = \int_0^\infty t^{x-1}e^{-t}\,dt $$

Integrate by parts and you get the recurrence $\Gamma(x+1)=x\,\Gamma(x)$. Combined with $\Gamma(1)=\int_0^\infty e^{-t}dt = 1$, induction gives $\Gamma(n+1)=n!$ for every non-negative integer $n$. So $\Gamma$ agrees with factorial exactly where factorial is defined — and is a perfectly smooth, well-defined number everywhere else for $x>0$, like $\Gamma(1.5)=0.5\sqrt\pi\approx0.886$.

2Extending past zero — and the poles

The recurrence $\Gamma(x)=\Gamma(x+1)/x$ can be run backwards to define $\Gamma$ for negative non-integers too. But run it through $x=0$: dividing a finite number by something approaching zero forces $\Gamma$ to diverge. The same happens at every non-positive integer $-1,-2,-3,\dots$ — these are simple poles, and the sign of $\Gamma$ flips each time you cross one.

▶ In the lab

Drag across $x=0,-1,-2,\dots$ and watch the curve shoot to $\pm\infty$ and flip sign at each pole. Open the lab →

3Two identities worth knowing

$$ \Gamma(x)\,\Gamma(1-x) = \frac{\pi}{\sin(\pi x)} \qquad\text{(reflection formula)} $$
$$ \Gamma\!\left(\tfrac12\right) = \sqrt{\pi} $$

The reflection formula is how you evaluate $\Gamma$ for negative arguments without a second integral — plug in $x=0.5$ and it immediately reproduces $\Gamma(1/2)^2=\pi$. It's also why $\Gamma$ has no real zeros at all: $1/\Gamma$ is entire, but $\Gamma$ itself never crosses zero, only blows up.

4Where it shows up in engineering

ContextRole of Γ
Weibull distribution (reliability)Mean time to failure $=\eta\,\Gamma(1+1/k)$, where $k$ is the shape parameter.
Chi-squared / Student's-t / Beta distributionsΓ appears in the normalizing constant of the probability density.
Volume of an $n$-ball$V_n(r)=\dfrac{\pi^{n/2}}{\Gamma(n/2+1)}r^n$ — Γ is what makes the formula work for any dimension, not just 1, 2, 3.
Fractional calculusDefines a "half-derivative" the same way Γ defines a "half-factorial."

5A short history

Leonhard Euler found the integral in 1729 in correspondence with Christian Goldbach, originally searching for a closed form to interpolate the factorial sequence. The now-standard notation $\Gamma$ and name "Gamma function" came later, from Adrien-Marie Legendre in the early 1800s. Carl Friedrich Gauss and Karl Weierstrass later gave alternative product-formula definitions that make the poles and the "no real zeros" property easy to see directly — but Euler's integral, two and a half centuries old, is still the one everyone meets first.

Key takeaways

Frequently asked questions

How does the Gamma function work?

It's defined by Euler's integral, $\Gamma(x)=\int_0^\infty t^{x-1}e^{-t}\,dt$. It agrees with the factorial at every positive integer ($\Gamma(n+1)=n!$), but stays smooth and well-defined everywhere in between, giving a real meaning to something like "5.5 factorial."

What is the Gamma function used for?

It shows up anywhere a continuous version of the factorial is needed: the Weibull distribution's mean in reliability engineering, the volume formula for an $n$-dimensional ball, the Beta distribution in statistics, and fractional calculus.

Why does the Gamma function have poles at zero and negative integers?

The recurrence $\Gamma(x+1)=x\Gamma(x)$ can be run backward as $\Gamma(x)=\Gamma(x+1)/x$. Starting from a finite value and stepping down through $x=0$ means dividing by a number heading to zero, forcing the function to diverge — and the same thing happens at every non-positive integer.

What is the reflection formula for the Gamma function?

$\Gamma(x)\Gamma(1-x)=\pi/\sin(\pi x)$. This identity links the value of the Gamma function at $x$ to its value at $1-x$, and explains the alternating sign the function takes between its poles at negative integers.

EngineeringCandy · Learn · the theory behind the playground