# Beta function

Contour plot of the beta function

In mathematics, the beta function, also called the Euler integral of the first kind, is a special function that is closely related to the gamma function and to binomial coefficients. It is defined by the integral

${\displaystyle \mathrm {B} (x,y)=\int _{0}^{1}t^{x-1}(1-t)^{y-1}\,dt}$

for complex number inputs x, y such that Re x > 0, Re y > 0.

The beta function was studied by Euler and Legendre and was given its name by Jacques Binet; its symbol Β is a Greek capital beta.

## Properties

The beta function is symmetric, meaning that

${\displaystyle \mathrm {B} (x,y)=\mathrm {B} (y,x)}$

for all inputs x and y.[1]

A key property of the beta function is its close relationship to the gamma function: one has that[1]

${\displaystyle \mathrm {B} (x,y)={\frac {\Gamma (x)\,\Gamma (y)}{\Gamma (x+y)}}.}$

(A proof is given below in § Relationship to the gamma function.)

The beta function is also closely related to binomial coefficients. When x and y are positive integers, it follows from the definition of the gamma function Γ that[2]

${\displaystyle \mathrm {B} (x,y)={\dfrac {(x-1)!\,(y-1)!}{(x+y-1)!}}={\frac {x+y}{xy}}\cdot {\frac {1}{\binom {x+y}{x}}}.}$

## Relationship to the gamma function

A simple derivation of the relation ${\displaystyle \mathrm {B} (x,y)={\frac {\Gamma (x)\,\Gamma (y)}{\Gamma (x+y)}}}$  can be found in Emil Artin's book The Gamma Function, page 18–19.[3] To derive this relation, write the product of two factorials as

{\displaystyle {\begin{aligned}\Gamma (x)\Gamma (y)&=\int _{u=0}^{\infty }\ e^{-u}u^{x-1}\,du\cdot \int _{v=0}^{\infty }\ e^{-v}v^{y-1}\,dv\\[6pt]&=\int _{v=0}^{\infty }\int _{u=0}^{\infty }\ e^{-u-v}u^{x-1}v^{y-1}\,du\,dv.\end{aligned}}}

Changing variables by u = zt and v = z(1 − t) produces

{\displaystyle {\begin{aligned}\Gamma (x)\Gamma (y)&=\int _{z=0}^{\infty }\int _{t=0}^{1}e^{-z}(zt)^{x-1}(z(1-t))^{y-1}z\,dt\,dz\\[6pt]&=\int _{z=0}^{\infty }e^{-z}z^{x+y-1}\,dz\cdot \int _{t=0}^{1}t^{x-1}(1-t)^{y-1}\,dt\\&=\Gamma (x+y)\cdot \mathrm {B} (x,y).\end{aligned}}}

Dividing both sides by ${\displaystyle \Gamma (x+y)}$  gives the desired result.

The stated identity may be seen as a particular case of the identity for the integral of a convolution. Taking

{\displaystyle {\begin{aligned}f(u)&:=e^{-u}u^{x-1}1_{\mathbb {R} _{+}}\\g(u)&:=e^{-u}u^{y-1}1_{\mathbb {R} _{+}},\end{aligned}}}

one has:

${\displaystyle \Gamma (x)\Gamma (y)=\int _{\mathbb {R} }f(u)\,du\cdot \int _{\mathbb {R} }g(u)\,du=\int _{\mathbb {R} }(f*g)(u)\,du=\mathrm {B} (x,y)\,\Gamma (x+y).}$

## Derivatives

We have

${\displaystyle {\frac {\partial }{\partial x}}\mathrm {B} (x,y)=\mathrm {B} (x,y)\left({\frac {\Gamma '(x)}{\Gamma (x)}}-{\frac {\Gamma '(x+y)}{\Gamma (x+y)}}\right)=\mathrm {B} (x,y){\big (}\psi (x)-\psi (x+y){\big )},}$

where ψ(x) is the digamma function.

## Approximation

Stirling's approximation gives the asymptotic formula

${\displaystyle \mathrm {B} (x,y)\sim {\sqrt {2\pi }}{\frac {x^{x-1/2}y^{y-1/2}}{({x+y})^{x+y-1/2}}}}$

for large x and large y. If on the other hand x is large and y is fixed, then

${\displaystyle \mathrm {B} (x,y)\sim \Gamma (y)\,x^{-y}.}$

## Other identities and formulas

The integral defining the beta function may be rewritten in a variety of ways, including the following:

{\displaystyle {\begin{aligned}\mathrm {B} (x,y)&=2\int _{0}^{\pi /2}(\sin \theta )^{2x-1}(\cos \theta )^{2y-1}\,d\theta ,\\[6pt]&=\int _{0}^{\infty }{\frac {t^{x-1}}{(1+t)^{x+y}}}\,dt,\\[6pt]&=n\int _{0}^{1}t^{nx-1}(1-t^{n})^{y-1}\,dt,\end{aligned}}}

where in the last identity n is any positive real number.

The beta function can be written as an infinite sum

${\displaystyle \mathrm {B} (x,y)=\sum _{n=0}^{\infty }{\frac {\binom {n-y}{n}}{x+n}}}$ [dubious ]

and as an infinite product

${\displaystyle \mathrm {B} (x,y)={\frac {x+y}{xy}}\prod _{n=1}^{\infty }\left(1+{\dfrac {xy}{n(x+y+n)}}\right)^{-1}.}$

The beta function satisfies several identities analogous to corresponding identities for binomial coefficients, including a version of Pascal's identity

${\displaystyle \mathrm {B} (x,y)=\mathrm {B} (x,y+1)+\mathrm {B} (x+1,y)}$

and a simple recurrence on one coordinate:

${\displaystyle \mathrm {B} (x+1,y)=\mathrm {B} (x,y)\cdot {\dfrac {x}{x+y}},\quad \mathrm {B} (x,y+1)=\mathrm {B} (x,y)\cdot {\dfrac {y}{x+y}}.}$

For ${\displaystyle x,y\geq 1}$ , the beta function may be written in terms of a convolution involving the truncated power function ttx
+
:

${\displaystyle \mathrm {B} (x,y)\cdot \left(t\mapsto t_{+}^{x+y-1}\right)={\Big (}t\mapsto t_{+}^{x-1}{\Big )}*{\Big (}t\mapsto t_{+}^{y-1}{\Big )}}$

Evaluations at particular points may simplify significantly; for example,

${\displaystyle \mathrm {B} (1,x)={\dfrac {1}{x}}}$

and
${\displaystyle \mathrm {B} (x,1-x)={\dfrac {\pi }{\sin(\pi x)}}.}$

By taking ${\displaystyle x={\frac {1}{2}}}$  in this last formula, one may conclude in particular that Γ(1/2) = π. One may also generalize the last formula into a bivariate identity for a product of beta functions:
${\displaystyle \mathrm {B} (x,y)\cdot \mathrm {B} (x+y,1-y)={\frac {\pi }{x\sin(\pi y)}}.}$

Euler's integral for the beta function may be converted into an integral over the Pochhammer contour C as

${\displaystyle \left(1-e^{2\pi i\alpha }\right)\left(1-e^{2\pi i\beta }\right)\mathrm {B} (\alpha ,\beta )=\int _{C}t^{\alpha -1}(1-t)^{\beta -1}\,dt.}$

This Pochhammer contour integral converges for all values of α and β and so gives the analytic continuation of the beta function.

Just as the gamma function for integers describes factorials, the beta function can define a binomial coefficient after adjusting indices:

${\displaystyle {\binom {n}{k}}={\frac {1}{(n+1)\mathrm {B} (n-k+1,k+1)}}.}$

Moreover, for integer n, Β can be factored to give a closed form interpolation function for continuous values of k:

${\displaystyle {\binom {n}{k}}=(-1)^{n}\,n!\cdot {\frac {\sin(\pi k)}{\pi \displaystyle \prod _{i=0}^{n}(k-i)}}.}$

The beta function was the first known scattering amplitude in string theory, first conjectured by Gabriele Veneziano. It also occurs in the theory of the preferential attachment process, a type of stochastic urn process.

## Incomplete beta function

The incomplete beta function, a generalization of the beta function, is defined as

${\displaystyle \mathrm {B} (x;\,a,b)=\int _{0}^{x}t^{a-1}\,(1-t)^{b-1}\,dt.}$

For x = 1, the incomplete beta function coincides with the complete beta function. The relationship between the two functions is like that between the gamma function and its generalization the incomplete gamma function.

The regularized incomplete beta function (or regularized beta function for short) is defined in terms of the incomplete beta function and the complete beta function:

${\displaystyle I_{x}(a,b)={\frac {\mathrm {B} (x;\,a,b)}{\mathrm {B} (a,b)}}.}$

The regularized incomplete beta function is the cumulative distribution function of the beta distribution, and is related to the cumulative distribution function ${\displaystyle F(k;\,n,p)}$  of a random variable X following a binomial distribution with probability of single success p and number of Bernoulli trials n:

${\displaystyle F(k;\,n,p)=\Pr \left(X\leq k\right)=I_{1-p}(n-k,k+1)=1-I_{p}(k+1,n-k).}$

### Properties

{\displaystyle {\begin{aligned}I_{0}(a,b)&=0\\I_{1}(a,b)&=1\\I_{x}(a,1)&=x^{a}\\I_{x}(1,b)&=1-(1-x)^{b}\\I_{x}(a,b)&=1-I_{1-x}(b,a)\\I_{x}(a+1,b)&=I_{x}(a,b)-{\frac {x^{a}(1-x)^{b}}{a\mathrm {B} (a,b)}}\\I_{x}(a,b+1)&=I_{x}(a,b)+{\frac {x^{a}(1-x)^{b}}{b\mathrm {B} (a,b)}}\\\mathrm {B} (x;a,b)&=(-1)^{a}\mathrm {B} \left({\frac {x}{x-1}};a,1-a-b\right)\end{aligned}}}

## Multivariate beta function

The beta function can be extended to a function with more than two arguments:

${\displaystyle \mathrm {B} (\alpha _{1},\alpha _{2},\ldots \alpha _{n})={\frac {\Gamma (\alpha _{1})\,\Gamma (\alpha _{2})\cdots \Gamma (\alpha _{n})}{\Gamma (\alpha _{1}+\alpha _{2}+\cdots +\alpha _{n})}}.}$

This multivariate beta function is used in the definition of the Dirichlet distribution. Its relationship to the beta function is analogous to the relationship between multinomial coefficients and binomial coefficients.

## Software implementation

Even if unavailable directly, the complete and incomplete beta function values can be calculated using functions commonly included in spreadsheet or computer algebra systems. In Excel, for example, the complete beta value can be calculated from the GammaLn function:

Value = Exp(GammaLn(a) + GammaLn(b) − GammaLn(a + b))

An incomplete beta value can be calculated as:

Value = BetaDist(x, a, b) * Exp(GammaLn(a) + GammaLn(b) − GammaLn(a + b)).

These result follow from the properties listed above.

Similarly, betainc (incomplete beta function) in MATLAB and GNU Octave, pbeta (probability of beta distribution) in R, or special.betainc in Python's SciPy package compute the regularized incomplete beta function—which is, in fact, the cumulative beta distribution—and so, to get the actual incomplete beta function, one must multiply the result of betainc by the result returned by the corresponding beta function. In Mathematica, Beta[x, a, b] and BetaRegularized[x, a, b] give ${\displaystyle \mathrm {B} (x;\,a,b)}$  and ${\displaystyle I_{x}(a,b)}$ , respectively.