Math Methods · interactive

The Gamma Function: Factorial, Smoothed Out

Factorial is only defined at whole numbers. Gamma fills in every gap between them with one smooth curve — and then keeps going to negative numbers too, blowing up at every non-positive integer.

Γ(x) = ∫₀^∞ tˣ⁻¹e⁻ᵗ dt, Γ(n+1) = n!
Defined by an integral for x>0, then extended to the rest of the real line (minus the poles) by the recurrence Γ(x+1)=xΓ(x).

Γ(x) — poles at x = 0, −1, −2, … · click anywhere to evaluate

Γ(x) your evaluation point poles (dashed)
x
5
Γ(x)
24
(x−1)! check
24

What you're seeing

Evaluate Γ(x)

5.00

Handy identities to try

Γ(1/2) = √π ≈ 1.7725
Γ(x+1) = xΓ(x)
Γ(x)Γ(1−x) = π/sin(πx)

Ask about this lab

Filling in the gaps in n!

Factorial only makes sense for whole numbers: 5! = 5·4·3·2·1. There's no obvious way to compute "5.5!" from that definition. Leonhard Euler found an integral that agrees with factorial at every integer (Γ(n+1)=n!) but is perfectly smooth everywhere in between, giving a real meaning to "half a factorial": Γ(1.5) = 0.5√π ≈ 0.886.

Why it blows up at zero and negative integers

The recurrence Γ(x+1)=xΓ(x) works backward too: Γ(x)=Γ(x+1)/x. Starting from a finite value like Γ(1)=1 and stepping down through x=0 means dividing by a number heading to zero — the function has to diverge. Same story at x=-1,-2,…. Gamma is finite and smooth everywhere except those non-positive integers, where it has simple poles.

▶ In the lab: type a negative non-integer like -2.5 and watch the sign flip between each pole — that alternating sign comes straight out of the reflection formula Γ(x)Γ(1-x) = π/sin(πx).

Where it shows up in engineering

The Gamma function is the normalizing constant behind the chi-squared, Student's t, Weibull, and beta probability distributions used throughout reliability engineering and statistics — Weibull's shape parameter directly controls failure-rate trends (infant mortality vs. wear-out), and its mean involves Γ(1+1/k). It also appears in the volume formula for an n-dimensional sphere, and in fractional calculus, where it lets you define a "half-derivative" the same way it let Euler define a "half-factorial."

EngineeringCandy · Gamma computed via the Lanczos approximation + reflection formula · click the curve to evaluate