The digamma function, usually written , is the logarithmic derivative of the gamma function:
It extends the relationship between harmonic sums and logarithms to real and complex arguments. The digamma function is a basic special function in mathematical analysis and occurs in the evaluation of infinite sums, differentiation of special functions, and statistical calculations involving gamma, beta, and Dirichlet distributions.
Definition and analytic structure
Where a local logarithm of is defined, the defining relation can also be written
The quotient is the more general formulation: it does not require a global choice of logarithm.
As a function of a complex variable, is meromorphic on the complex plane. It is analytic except for simple poles at
each with residue . These poles arise from the poles of the gamma function; the gamma function itself has no zeros.
Near , where is a nonnegative integer,
where ,
and is the Euler–Mascheroni constant:
The digamma function is not the same as the Barnes double gamma function. In particular, “digamma” names a logarithmic derivative, not an iteration of the gamma function.
Recurrence and functional identities
Recurrence relation
Differentiating the gamma identity gives the recurrence relation
Repeated application yields
for positive integers , wherever the expressions are defined. Thus a finite sum of reciprocals in an arithmetic progression can be expressed as a difference of digamma values.
Since , the recurrence gives
The digamma function therefore provides an extension of harmonic numbers beyond integer arguments:
Reflection formula
Logarithmic differentiation of the gamma reflection formula gives
for noninteger . This identity relates values on opposite sides of and is useful for transforming arguments with negative real part.
Multiplication formula
For a positive integer ,
The case is the duplication identity:
Together, recurrence, reflection, and multiplication formulas produce many exact values at rational arguments.
Series and integral representations
A fundamental series representation is
valid away from the poles. The paired summands decay as , and the series converges uniformly on compact sets avoiding those poles.
An equivalent form is
For , an integral representation is
For , the power is defined using the real logarithm of . The apparent singularity at is removable.
Another representation on the same half-plane is
The two terms must be integrated together: each separately has a divergent integral near zero, while their difference is integrable.
These representations support proofs of identities and inequalities. Analytic continuation extends the resulting identities beyond their initial domains when appropriate.
Special values and local expansions
Some basic values are
and
Here and throughout, denotes the natural logarithm for positive real arguments.
Around , a convergent Taylor expansion is
where is the Riemann zeta function. In particular,
Derivatives and real-variable behavior
The higher derivatives of are the polygamma functions:
with . The first derivative is called the trigamma function.
For ,
away from the poles.
For positive real ,
Consequently, is strictly increasing and strictly concave on . Its endpoint behavior is
It therefore has exactly one positive zero:
Because and for , this point is also the unique minimum of the gamma function on the positive real axis.
The trigamma series is positive at every real nonpole, so is also strictly increasing on each interval between consecutive negative integer poles. Its one-sided limits imply exactly one real zero in each interval
Asymptotic behavior and numerical evaluation
For large , the digamma function has the asymptotic expansion
where are Bernoulli numbers. The first terms are
This expansion applies as in sectors bounded away from the negative real axis, using the principal branch of . It is generally not a convergent series; its usefulness depends on truncating it appropriately.
A standard numerical evaluation strategy combines argument transformations with this expansion:
- Use recurrence to shift the argument into a region with sufficiently large positive real part.
- Evaluate an asymptotic approximation there.
- Undo the shift using the corresponding finite reciprocal sum.
- Use reflection when appropriate for arguments with negative real part.
Near a pole, the singular term dominates. Near a zero, cancellation can reduce relative accuracy, so robust implementations may use local expansions or specialized approximations. Directly evaluating and separately is usually less suitable because the gamma function can overflow even when their ratio is moderate.
Applications
Summation and integration
The recurrence gives the finite-sum identity
A related convergent infinite sum is
for distinct away from the nonpositive integers.
Differentiating integrals containing gamma-function factors also produces digamma values. For example, differentiating the gamma integral with respect to its parameter gives
Probability and statistical inference
If has a gamma distribution with shape and rate , then its logarithmic expectation is
Its log variance is
For a beta distribution with parameters ,
More generally, for a Dirichlet distribution with parameter vector ,
These expectations appear in Bayesian inference and variational inference.
The digamma function also enters maximum likelihood estimation. For independent positive observations from a gamma distribution with unknown shape and rate, eliminating the rate parameter gives the shape equation
This equation generally requires numerical solution. Its derivative,
allows the use of Newton's method. Trigamma and higher polygamma functions likewise appear in likelihood derivatives and information matrices.