# Gamma and Related Functions

The Gamma function, Γ(x) is a generalization of the factorial. It is defined as

The GammaFunctions class provides static methods for evaluating the Gamma function and its variants, including Beta functions and the Digamma function.

## Gamma functions

The Gamma method evaluates the standard Gamma function. The LogGamma method evaluates the natural logarithm of (the absolute value of) the Gamma function. Both methods have overloads for real and complex arguments. This method has an overload that takes an additional integer out parameter. On exit, this parameter contains the sign of the Gamma function.

The incomplete Gamma function is defined as

It is implemented as the IncompleteGamma method. Allowing the upper bound of the integral to vary as well leads to a second variant of IncompleteGamma that takes three arguments.

The regularized Gamma functions are defined by

and implemented by the RegularizedGammaP and RegularizedGammaQ methods. Table 1 summarizes the methods that implement Gamma functions.

Method

Description

(Overloaded.) Gamma function for real or complex argument.

(Overloaded.) Natural logarithm of the Gamma function for real or complex argument. Optionally returns the sign in a second out parameter.

IncompleteGamma

(Overloaded.) Incomplete Gamma function for two or three real arguments.

RegularizedGammaP

Regularized Gamma function of the first kind.

RegularizedGammaQ

Regularized Gamma function of the second kind.

InverseRegularizedGammaP

Inverse of the regularized Gamma function of the first kind.

InverseRegularizedGammaQ

Inverse of the regularized Gamma function of the second kind.

Table 1. Gamma functions.

## Beta functions

The Beta function is closely related to the Gamma function. It is defined as:

The methods that implement the Beta function and related functions are listed below:

Method

Description

Beta

Beta function for real arguments.

LogBeta

Natural logarithm of the Beta function for real arguments.

RegularizedBeta

Regularized Beta function for real arguments.

InverseRegularizedBeta

Inverse of the regularized Beta function for real arguments.

Table 2. Beta functions.

## Other Gamma-related functions

The DiGamma function Psi(x) is the derivative of the logarithm of the Gamma function. It is implemented by the Digamma method, with overloads for real and integer arguments. When the argument is an integer, the following special relation holds:

where γ is EulersConstant and the second term is a so-called harmonic number, also available through the HarmonicNumber method.

The TaylorCoefficient method evaluates the Taylor coefficient of the specified degree for a specified value of the argument.