Beta Function Calculator screenshot

Beta Function Calculator

Evaluate the beta function through the gamma function, with the exact factorial ratio printed for whole-number parameters and the two forms compared.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact where arithmetic allows

Beta Function Calculator

Evaluate the beta function through the gamma function, with the exact factorial ratio printed for whole-number parameters and the two forms compared.

How this page computes

Each gamma value comes from the Lanczos g = 7, n = 9 approximation, and B is their product divided by Γ(a+b). The natural logarithm is taken of that result.

When both parameters are whole numbers, the factorial ratio is computed in BigInt, reduced by its greatest common divisor, and compared with the floating-point value.

The calculation runs entirely in this browser tab; nothing is uploaded.

The beta function is the integral of x^(a−1)(1−x)^(b−1) from 0 to 1, and it equals Γ(a)Γ(b)/Γ(a+b). For a = 2 and b = 3 that is 1 × 2 / 24 = 1/12, which the page prints both as an exact fraction and as a decimal.

Both forms are computed and compared. The gamma values come from a Lanczos approximation accurate to about 1e-13 relative, and the factorial ratio is exact integer arithmetic, so the two agreeing is a real check rather than a tautology.

How to use Beta Function Calculator

Type both parameters and press Run. Both must be above zero; a non-positive parameter hits a pole or continues analytically, which is a different question from the one this page answers.

The output gives each gamma value, B(a, b), its natural logarithm, the exact factorial ratio when both parameters are whole numbers, and the relative agreement between the two forms.

Why two routes to the same number

For a whole-number a the gamma function is (a−1)!, so B(a, b) becomes (a−1)!(b−1)!/(a+b−1)!. That is an integer ratio and can be computed exactly in BigInt, with no floating point at any step.

For a general positive a, Γ is evaluated by the Lanczos approximation: a shifted product of a polynomial and a power, tuned so the relative error is near machine precision. The page uses the same routine for all three gamma values, so a systematic error would cancel in the ratio.

What to Expect

Best for

  • B(a, b) for whole-number or simple fractional parameters
  • Checking a beta-integral result
  • Seeing the factorial identity behind the integral

Not ideal for

  • Non-positive parameters, which need an analytic continuation
  • A parameter so large that Γ overflows, around 171
  • The incomplete beta function, which is a different function

What this tool keeps

  • Both parameters exactly as typed

What may need cleanup

  • Nothing: the value and the exact ratio are final

Common errors

  • A parameter at or below zero is refused
  • A parameter beyond the double range is refused rather than printed as infinity

Example use cases

  • Find B(2, 3) as 1/12
  • Check that B(a, b) equals B(b, a)
  • See the gamma values behind a beta function

Sample input

a = 2, b = 3

Sample output

B(2, 3) = 0.0833333333, exactly 1/12

Who this is for

  • Students meeting the beta integral
  • Readers checking a probability density

Frequently asked questions

Why is B(2, 3) exactly one twelfth?

Because the factorial form gives 1! × 2! / 4! = 2/24, which reduces to 1/12. The page prints the unreduced ratio as well, so the arithmetic can be followed.

Is the beta function symmetric?

Yes. Swapping a and b leaves the product of the same two gamma values in the numerator and the same sum in the denominator, and the page checks that numerically for fractional parameters.

What does the logarithm add?

B(a, b) becomes very small or very large quickly, and its log stays readable. The log is also the quantity that appears in most statistical formulas, so it is printed rather than left to be taken again.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.