What this calculator does
This tool tabulates two closely related special functions over a range of x for shape parameters a and b. The lower incomplete beta function \(B_x(a,b)\) is the integral of the beta kernel from 0 to x, and the regularized incomplete beta function \(I_x(a,b)\) is that integral divided by the complete beta function \(B(a,b)\). \(I_x(a,b)\) is also the cumulative distribution function of the Beta(a,b) distribution and underlies the CDFs of the binomial, Student t, F and many other distributions.
How to use it
Enter the shape parameters a and b (both must be positive). Choose a starting x (the Initial value of x), an Increment step, and the Number of repetitions (rows). Row i uses \(x = \text{initialX} + i \times \text{step}\). Values are kept inside [0, 1]; once x reaches 1 the table stops. The hero box shows the complete beta \(B(a,b)\) and the final row, while the scrollable table lists every x with \(B_x(a,b)\) and \(I_x(a,b)\).
The formula explained
The complete beta is computed stably as $$B(a,b) = \exp(\operatorname{lgamma}(a) + \operatorname{lgamma}(b) - \operatorname{lgamma}(a+b))$$ using a Lanczos approximation for the log-gamma function. The regularized value \(I_x(a,b)\) is evaluated with the classic Numerical Recipes continued-fraction (Lentz's algorithm): with \(bt = \exp(\operatorname{lgamma}(a+b) - \operatorname{lgamma}(a) - \operatorname{lgamma}(b) + a\cdot\ln x + b\cdot\ln(1-x))\), we use \(I_x = bt\cdot\operatorname{betacf}(a,b,x)/a\) when \(x < (a+1)/(a+b+2)\), otherwise \(I_x = 1 - bt\cdot\operatorname{betacf}(b,a,1-x)/b\). Finally \(B_x(a,b) = I_x(a,b) \times B(a,b)\). The endpoints \(I_0 = 0\) and \(I_1 = 1\) are handled exactly to avoid \(\log(0)\).
Worked example
For a = 1, b = 3: $$B(1,3) = \frac{\Gamma(1)\Gamma(3)}{\Gamma(4)} = \frac{1\cdot 2}{6} = \frac{1}{3} \approx 0.333333.$$ At x = 0.5 the closed form gives $$B_x = \frac{1 - (1-x)^3}{3} = \frac{1 - 0.125}{3} = 0.291667,$$ so \(I_x = 0.291667 / 0.333333 = 0.875\). The symmetry check \(I_x(1,3) = 1 - (1-x)^3 = 1 - 0.125 = 0.875\) confirms it.
FAQ
What is the difference between Bx and Ix? \(B_x(a,b)\) is the raw integral; \(I_x(a,b) = B_x(a,b)/B(a,b)\) is normalized to lie between 0 and 1.
Why must a and b be positive? The integral and the gamma functions only converge for \(a > 0\) and \(b > 0\).
What if my step pushes x past 1? Each x is clamped to 1 and the table stops at x = 1, where \(B_x(a,b) = B(a,b)\) and \(I_x(a,b) = 1\).