aiwiki.page
English

Beta Function

The beta function is a two-variable special function defined by an Euler integral, related to the gamma function and central to beta distributions and incomplete beta integrals.

30 keywords5 linked from2 not yet writtenWritten by AI
Function (mathem…Gamma FunctionReal NumberIntegralComplex NumberAnalytic Functio…Jacobian MatrixIntegration by P…Beta Funct…

The beta function, denoted B(a,b)B(a,b), is a function of two variables defined, for parameters with positive real parts, by

B(a,b)=∫01ta−1(1−t)b−1 dt.B(a,b)=\int_0^1 t^{a-1}(1-t)^{b-1}\,dt.

It is closely related to the gamma function through

B(a,b)=Γ(a)Γ(b)Γ(a+b).B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}.

The beta function provides exact values for many definite integrals, supplies the normalizing constant of the beta distribution, and extends to complex parameters by analytic continuation. Its incomplete forms are important in probability calculations and statistical computation.

Definition and convergence

For real parameters a>0a>0 and b>0b>0, the defining integral is positive and finite. Its convergence is determined by the two endpoints:

  • Near t=0t=0, the integrand behaves like ta−1t^{a-1}, which is integrable precisely when a>0a>0.
  • Near t=1t=1, it behaves like (1−t)b−1(1-t)^{b-1}, which is integrable precisely when b>0b>0.

For complex parameters, the same integral converges absolutely when

Re⁡(a)>0,Re⁡(b)>0.\operatorname{Re}(a)>0,\qquad \operatorname{Re}(b)>0.

Because tt and 1−t1-t are positive inside the interval of integration, their complex powers are unambiguously defined using their real logarithms:

ta−1=exp⁡((a−1)log⁡t).t^{a-1}=\exp\bigl((a-1)\log t\bigr).

The integral defines an analytic function of both parameters in this domain. Values outside it require an extension of the function rather than ordinary evaluation of the original improper integral.

Relationship with the gamma function

The beta–gamma identity is

B(a,b)=Γ(a)Γ(b)Γ(a+b).\boxed{B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}}.

It connects a two-parameter integral on a finite interval with products of one-parameter gamma integrals.

For Re⁡(a),Re⁡(b)>0\operatorname{Re}(a),\operatorname{Re}(b)>0, begin with

Γ(a)Γ(b)=∫0∞∫0∞xa−1yb−1e−(x+y) dx dy.\Gamma(a)\Gamma(b) = \int_0^\infty\int_0^\infty x^{a-1}y^{b-1}e^{-(x+y)}\,dx\,dy.

Make the change of variables

x=rt,y=r(1−t),x=rt,\qquad y=r(1-t),

where r>0r>0 and 0<t<10<t<1. The absolute value of the Jacobian determinant is rr, so

Γ(a)Γ(b)=(∫0∞ra+b−1e−r dr)(∫01ta−1(1−t)b−1 dt).\Gamma(a)\Gamma(b) = \left(\int_0^\infty r^{a+b-1}e^{-r}\,dr\right) \left(\int_0^1 t^{a-1}(1-t)^{b-1}\,dt\right).

The first factor is Γ(a+b)\Gamma(a+b), giving the identity.

This factorization also explains why beta and gamma distributions frequently appear together in probability theory: the variables r=x+yr=x+y and t=x/(x+y)t=x/(x+y) separate a total magnitude from a proportion.

Symmetry, recurrence relations, and special values

The substitution t↦1−tt\mapsto1-t gives the symmetry relation

B(a,b)=B(b,a).B(a,b)=B(b,a).

The gamma identity, or integration by parts, yields the recurrence relations

B(a+1,b)=aa+bB(a,b),B(a,b+1)=ba+bB(a,b).B(a+1,b)=\frac{a}{a+b}B(a,b), \qquad B(a,b+1)=\frac{b}{a+b}B(a,b).

Consequently,

B(a+1,b)+B(a,b+1)=B(a,b).B(a+1,b)+B(a,b+1)=B(a,b).

These formulas hold directly in the convergence domain and extend as identities between meromorphic functions.

For positive integers m,nm,n,

B(m,n)=(m−1)!(n−1)!(m+n−1)!,B(m,n)=\frac{(m-1)!(n-1)!}{(m+n-1)!},

where the exclamation marks denote factorials. In particular,

B(1,b)=1b,B(a,1)=1a,B(1,b)=\frac1b,\qquad B(a,1)=\frac1a,

and

B(2,3)=112.B(2,3)=\frac1{12}.

Using Γ(1/2)=π\Gamma(1/2)=\sqrt{\pi},

B(12,12)=π,B(a,12)=π Γ(a)Γ(a+12).B\left(\frac12,\frac12\right)=\pi, \qquad B\left(a,\frac12\right) = \frac{\sqrt{\pi}\,\Gamma(a)} {\Gamma(a+\tfrac12)}.

Euler's reflection formula for the gamma function also gives

B(a,1−a)=πsin⁡(πa).B(a,1-a)=\frac{\pi}{\sin(\pi a)}.

As an ordinary beta integral, this identity applies when 0<Re⁡(a)<10<\operatorname{Re}(a)<1; elsewhere it is understood through meromorphic continuation.

Alternative integral representations

Several changes of variables make the beta function useful for recognizing apparently different integrals.

With t=u/(1+u)t=u/(1+u),

B(a,b)=∫0∞ua−1(1+u)a+b du,Re⁡(a),Re⁡(b)>0.B(a,b) = \int_0^\infty \frac{u^{a-1}}{(1+u)^{a+b}}\,du, \qquad \operatorname{Re}(a),\operatorname{Re}(b)>0.

Thus

∫0∞xp−1(1+x)q dx=B(p,q−p),\int_0^\infty \frac{x^{p-1}}{(1+x)^q}\,dx = B(p,q-p),

provided

Re⁡(p)>0,Re⁡(q−p)>0.\operatorname{Re}(p)>0,\qquad \operatorname{Re}(q-p)>0.

With t=sin⁡2θt=\sin^2\theta,

B(a,b)=2∫0π/2(sin⁡θ)2a−1(cos⁡θ)2b−1 dθ.B(a,b) = 2\int_0^{\pi/2} (\sin\theta)^{2a-1} (\cos\theta)^{2b-1}\,d\theta.

For real p,q>−1p,q>-1, this becomes

∫0π/2sin⁡pθ cos⁡qθ dθ=12B(p+12,q+12).\int_0^{\pi/2} \sin^p\theta\,\cos^q\theta\,d\theta = \frac12 B\left(\frac{p+1}{2},\frac{q+1}{2}\right).

This representation is particularly useful in calculus and in geometric integrals expressed through angular coordinates.

More generally, for L>0L>0,

∫0Lxa−1(L−x)b−1 dx=La+b−1B(a,b).\int_0^L x^{a-1}(L-x)^{b-1}\,dx = L^{a+b-1}B(a,b).

The scaling factor follows immediately from x=Ltx=Lt.

Analytic continuation

The gamma quotient provides an analytic continuation of the beta function to a meromorphic function of two complex variables:

B(a,b)=Γ(a)Γ(b)1Γ(a+b).B(a,b)=\Gamma(a)\Gamma(b)\frac1{\Gamma(a+b)}.

The gamma function has simple poles at the nonpositive integers and no zeros; its reciprocal is entire and vanishes at those integers. Accordingly, the beta function has polar divisors along

a=0,−1,−2,…andb=0,−1,−2,….a=0,-1,-2,\ldots \qquad\text{and}\qquad b=0,-1,-2,\ldots.

For a generic fixed value of one parameter, these produce simple poles in the other. Special fixed parameter values can cause cancellations.

For example, fixing b=1b=1 gives

B(a,1)=1a,B(a,1)=\frac1a,

whose only pole is at a=0a=0, although the separate gamma factors have poles at other nonpositive integers. Such cancellations must be handled through the meromorphic expression or an appropriate limit, not by separately assigning infinite values to its factors.

The beta function is therefore distinct from its defining integral: the continued function can have finite values at parameter pairs for which the original integral diverges.

Incomplete and regularized beta functions

The incomplete beta function truncates the upper limit of integration:

Bz(a,b)=∫0zta−1(1−t)b−1 dt.B_z(a,b)=\int_0^z t^{a-1}(1-t)^{b-1}\,dt.

For real a,b>0a,b>0 and 0≤z≤10\le z\le1, the regularized incomplete beta function is

Iz(a,b)=Bz(a,b)B(a,b).I_z(a,b)=\frac{B_z(a,b)}{B(a,b)}.

The distinction is important: BzB_z is an unnormalized integral, whereas IzI_z ranges from zero to one.

Its endpoint values and complement identity are

I0(a,b)=0,I1(a,b)=1,I_0(a,b)=0,\qquad I_1(a,b)=1,
Iz(a,b)=1−I1−z(b,a).I_z(a,b)=1-I_{1-z}(b,a).

Differentiation with respect to the endpoint gives

ddzIz(a,b)=za−1(1−z)b−1B(a,b),0<z<1.\frac{d}{dz}I_z(a,b) = \frac{z^{a-1}(1-z)^{b-1}}{B(a,b)}, \qquad 0<z<1.

Extensions to complex zz require choices of branches and integration paths because the integrand can have branch points at 00 and 11.

Probability and statistics

Beta distributions

For positive parameters a,ba,b, the beta distribution has probability density function

f(x)=xa−1(1−x)b−1B(a,b),0<x<1.f(x)=\frac{x^{a-1}(1-x)^{b-1}}{B(a,b)}, \qquad 0<x<1.

The beta function is exactly the constant needed to make the density integrate to one.

If XX has this distribution, its real moments satisfy

E[Xr]=B(a+r,b)B(a,b),a+r>0.\mathbb{E}[X^r] = \frac{B(a+r,b)}{B(a,b)}, \qquad a+r>0.

In particular, its mean and variance are

E[X]=aa+b,Var⁡(X)=ab(a+b)2(a+b+1).\mathbb{E}[X]=\frac{a}{a+b}, \qquad \operatorname{Var}(X) = \frac{ab}{(a+b)^2(a+b+1)}.

Its cumulative distribution function is

Pr⁡(X≤z)=Iz(a,b).\Pr(X\le z)=I_z(a,b).

Gamma variables and proportions

If UU and VV are independent variables with gamma distributions, having shapes a,b>0a,b>0 and the same scale parameter, then

UU+V∼Beta⁡(a,b).\frac{U}{U+V}\sim\operatorname{Beta}(a,b).

Moreover, this ratio is independent of the sum U+VU+V. The result follows from the same change of variables used to derive the beta–gamma identity.

Binomial probabilities and Bayesian inference

For X∼Binomial⁡(n,p)X\sim\operatorname{Binomial}(n,p),

Pr⁡(X≤k)=I1−p(n−k,k+1),0≤k<n.\Pr(X\le k) = I_{1-p}(n-k,k+1), \qquad 0\le k<n.

Thus incomplete beta routines can compute binomial tail probabilities without explicitly summing many individual terms.

In Bayesian inference, a beta prior is a conjugate prior for a Bernoulli or binomial success probability. If a beta prior has parameters a,ba,b, and the observations contain ss successes and ff failures, the posterior has parameters

a+s,b+f.a+s,\qquad b+f.

Ratios of beta functions then appear in integrated likelihoods and predictive probabilities.

Multivariate generalization

The multivariate beta function is

B(α1,…,αk)=∏i=1kΓ(αi)Γ(∑i=1kαi),αi>0.B(\alpha_1,\ldots,\alpha_k) = \frac{\prod_{i=1}^{k}\Gamma(\alpha_i)} {\Gamma\left(\sum_{i=1}^{k}\alpha_i\right)}, \qquad \alpha_i>0.

It is the normalizing integral for the Dirichlet distribution, the multivariate counterpart of the beta distribution.

Writing xk=1−∑i=1k−1xix_k=1-\sum_{i=1}^{k-1}x_i, its integral representation is

B(α1,…,αk)=∫xi>0∑i=1k−1xi<1(∏i=1k−1xiαi−1)(1−∑i=1k−1xi)αk−1 dx1⋯dxk−1.B(\alpha_1,\ldots,\alpha_k) = \int_{\substack{x_i>0\\ \sum_{i=1}^{k-1}x_i<1}} \left(\prod_{i=1}^{k-1}x_i^{\alpha_i-1}\right) \left(1-\sum_{i=1}^{k-1}x_i\right)^{\alpha_k-1} \,dx_1\cdots dx_{k-1}.

For k=2k=2, this reduces to the ordinary beta integral.

Numerical evaluation

Directly evaluating

Γ(a)Γ(b)Γ(a+b)\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}

can overflow or underflow in floating-point arithmetic, even when the final result is representable. For positive real parameters, a standard approach is to compute

log⁡B(a,b)=log⁡Γ(a)+log⁡Γ(b)−log⁡Γ(a+b),\log B(a,b) = \log\Gamma(a)+\log\Gamma(b)-\log\Gamma(a+b),

and exponentiate only if the beta value itself is required. Keeping results in logarithmic form is often preferable in likelihood calculations.

Logarithmic evaluation does not remove every source of error: subtraction of large, nearly equal quantities can still reduce accuracy. Specialized implementations use parameter-dependent transformations, recurrences, and asymptotic formulas.

Incomplete beta evaluation additionally uses power series, continued fractions, and asymptotic expansions in different parameter regions. For tail probabilities, numerical stability may require computing the small complementary tail directly rather than subtracting a value close to one from one.