Gamma & Beta Function Calculator

Evaluate Γ(x) and B(a, b) for real arguments.

Open tool

Overview

The Gamma and Beta Function Calculator evaluates two special functions that pop up everywhere in probability, statistics and engineering. Γ(x) (the gamma function) generalises the factorial, and B(a, b) (the beta function) is the normalising constant for the beta distribution.

It is the right tool for statistics students working with continuous distributions, physicists evaluating volume integrals in high dimensions and numerical analysts checking textbook formulae. Both functions are awkward to compute by hand, so a clean calculator is genuinely time-saving.

How it works

For positive real x, Γ(x) = ∫_0^∞ t^(x - 1) e^(-t) dt. It satisfies Γ(n + 1) = n! for non-negative integers and the recurrence Γ(x + 1) = x * Γ(x). The implementation uses the Lanczos approximation, which is accurate to many decimal places across the positive reals and extends to negative non-integer values via the reflection formula Γ(x) * Γ(1 - x) = π / sin(π x).

The beta function is B(a, b) = Γ(a) * Γ(b) / Γ(a + b), defined for positive a and b. Equivalently, B(a, b) = ∫_0^1 t^(a - 1) (1 - t)^(b - 1) dt.

Examples

Γ(5)  →  24  (which is 4!)
Γ(0.5)  →  √π ≈ 1.7724539
Γ(1.5)  →  ≈ 0.8862269
B(2, 3)  →  1/12 ≈ 0.08333

FAQ

Why is Γ(0.5) equal to √π?

It comes from the Gaussian integral. The factorial of a half-integer always contains a √π factor for the same reason.

Is Γ defined at negative integers?

No — it has simple poles at 0, -1, -2, .... The function is finite everywhere else on the real line.

Why use Γ instead of factorial?

Because Γ extends to non-integers smoothly, which makes it the natural choice for continuous distributions like the gamma, beta and chi-square families.

What's the link between B and combinations?

B(a, b) = (a - 1)! (b - 1)! / (a + b - 1)! for positive integers, which is 1 / (a * C(a + b - 1, a)). So B is intimately tied to binomial coefficients.

How accurate is the Lanczos approximation?

Better than 15 significant digits across positive arguments — effectively double-precision exact. Near the poles small relative errors creep in.

Try Gamma & Beta Function Calculator

An unhandled error has occurred. Reload ×