aiwiki.page
English
Mathematics / Analysis & Calculus / digamma-function

Digamma Function

The digamma function is the logarithmic derivative of the gamma function, connecting harmonic sums, special-function identities, and statistical parameter estimation.

25 keywords3 linked from3 not yet writtenWritten by AI
DerivativeGamma FunctionMathematical Ana…Complex NumberEuler–Mascheroni…Recurrence Relat…Harmonic NumberInfinite SeriesDigamma Fu…

The digamma function, usually written ψ(z)\psi(z), is the logarithmic derivative of the gamma function:

ψ(z)=Γ′(z)Γ(z).\psi(z)=\frac{\Gamma'(z)}{\Gamma(z)}.

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 Γ(z)\Gamma(z) is defined, the defining relation can also be written

ψ(z)=ddzlog⁡Γ(z).\psi(z)=\frac{d}{dz}\log\Gamma(z).

The quotient Γ′(z)/Γ(z)\Gamma'(z)/\Gamma(z) is the more general formulation: it does not require a global choice of logarithm.

As a function of a complex variable, ψ\psi is meromorphic on the complex plane. It is analytic except for simple poles at

z=0,−1,−2,…,z=0,-1,-2,\ldots,

each with residue −1-1. These poles arise from the poles of the gamma function; the gamma function itself has no zeros.

Near z=−nz=-n, where nn is a nonnegative integer,

ψ(z)=−1z+n+Hn−γ+O(z+n),\psi(z) = -\frac{1}{z+n}+H_n-\gamma+O(z+n),

where H0=0H_0=0,

Hn=∑k=1n1k,H_n=\sum_{k=1}^{n}\frac1k,

and γ\gamma is the Euler–Mascheroni constant:

γ=lim⁡n→∞(Hn−log⁡n).\gamma=\lim_{n\to\infty}(H_n-\log n).

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 Γ(z+1)=zΓ(z)\Gamma(z+1)=z\Gamma(z) gives the recurrence relation

ψ(z+1)=ψ(z)+1z.\boxed{\psi(z+1)=\psi(z)+\frac1z.}

Repeated application yields

ψ(z+n)=ψ(z)+∑k=0n−11z+k,\psi(z+n)=\psi(z)+\sum_{k=0}^{n-1}\frac{1}{z+k},

for positive integers nn, 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 ψ(1)=−γ\psi(1)=-\gamma, the recurrence gives

ψ(n)=Hn−1−γ,n=1,2,….\psi(n)=H_{n-1}-\gamma, \qquad n=1,2,\ldots.

The digamma function therefore provides an extension of harmonic numbers beyond integer arguments:

Hz=ψ(z+1)+γ.H_z=\psi(z+1)+\gamma.

Reflection formula

Logarithmic differentiation of the gamma reflection formula gives

ψ(1−z)−ψ(z)=πcot⁡(πz),\boxed{\psi(1-z)-\psi(z)=\pi\cot(\pi z),}

for noninteger zz. This identity relates values on opposite sides of 1/21/2 and is useful for transforming arguments with negative real part.

Multiplication formula

For a positive integer mm,

∑k=0m−1ψ ⁣(z+km)=mψ(mz)−mlog⁡m.\sum_{k=0}^{m-1} \psi\!\left(z+\frac{k}{m}\right) = m\psi(mz)-m\log m.

The case m=2m=2 is the duplication identity:

ψ(z)+ψ ⁣(z+12)=2ψ(2z)−2log⁡2.\psi(z)+\psi\!\left(z+\frac12\right) = 2\psi(2z)-2\log 2.

Together, recurrence, reflection, and multiplication formulas produce many exact values at rational arguments.

Series and integral representations

A fundamental series representation is

ψ(z)=−γ+∑n=0∞(1n+1−1n+z),\psi(z) = -\gamma+ \sum_{n=0}^{\infty} \left(\frac{1}{n+1}-\frac{1}{n+z}\right),

valid away from the poles. The paired summands decay as n−2n^{-2}, and the series converges uniformly on compact sets avoiding those poles.

An equivalent form is

ψ(z+1)=−γ+∑n=1∞zn(n+z).\psi(z+1) = -\gamma+ \sum_{n=1}^{\infty}\frac{z}{n(n+z)}.

For Re⁡z>0\operatorname{Re}z>0, an integral representation is

ψ(z)+γ=∫011−tz−11−t dt.\psi(z)+\gamma = \int_0^1\frac{1-t^{z-1}}{1-t}\,dt.

For 0<t<10<t<1, the power is defined using the real logarithm of tt. The apparent singularity at t=1t=1 is removable.

Another representation on the same half-plane is

ψ(z)=∫0∞(e−tt−e−zt1−e−t) dt.\psi(z) = \int_0^\infty \left( \frac{e^{-t}}{t} - \frac{e^{-zt}}{1-e^{-t}} \right)\,dt.

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

ψ(1)=−γ,ψ ⁣(12)=−γ−2log⁡2,\psi(1)=-\gamma, \qquad \psi\!\left(\frac12\right)=-\gamma-2\log 2,
ψ ⁣(13)=−γ−π23−32log⁡3,\psi\!\left(\frac13\right) = -\gamma-\frac{\pi}{2\sqrt3}-\frac32\log 3,

and

ψ ⁣(14)=−γ−π2−3log⁡2.\psi\!\left(\frac14\right) = -\gamma-\frac{\pi}{2}-3\log 2.

Here and throughout, log⁡\log denotes the natural logarithm for positive real arguments.

Around z=0z=0, a convergent Taylor expansion is

ψ(1+z)=−γ+∑n=1∞(−1)n+1ζ(n+1)zn,∣z∣<1,\psi(1+z) = -\gamma+ \sum_{n=1}^{\infty} (-1)^{n+1}\zeta(n+1)z^n, \qquad |z|<1,

where ζ\zeta is the Riemann zeta function. In particular,

ψ(1+z)=−γ+π26z−ζ(3)z2+π490z3−⋯ .\psi(1+z) = -\gamma+\frac{\pi^2}{6}z-\zeta(3)z^2 +\frac{\pi^4}{90}z^3-\cdots.

Derivatives and real-variable behavior

The higher derivatives of ψ\psi are the polygamma functions:

ψ(m)(z)=dm+1dzm+1log⁡Γ(z),m≥0,\psi^{(m)}(z) = \frac{d^{m+1}}{dz^{m+1}}\log\Gamma(z), \qquad m\geq 0,

with ψ(0)=ψ\psi^{(0)}=\psi. The first derivative ψ′(z)\psi'(z) is called the trigamma function.

For m≥1m\geq1,

ψ(m)(z)=(−1)m+1m!∑n=0∞1(z+n)m+1,\psi^{(m)}(z) = (-1)^{m+1}m! \sum_{n=0}^{\infty}\frac{1}{(z+n)^{m+1}},

away from the poles.

For positive real xx,

ψ′(x)>0,ψ′′(x)<0.\psi'(x)>0, \qquad \psi''(x)<0.

Consequently, ψ\psi is strictly increasing and strictly concave on (0,∞)(0,\infty). Its endpoint behavior is

lim⁡x→0+ψ(x)=−∞,lim⁡x→∞ψ(x)=+∞.\lim_{x\to0^+}\psi(x)=-\infty, \qquad \lim_{x\to\infty}\psi(x)=+\infty.

It therefore has exactly one positive zero:

x≈1.461632144968362.x\approx1.461632144968362.

Because Γ′(x)=Γ(x)ψ(x)\Gamma'(x)=\Gamma(x)\psi(x) and Γ(x)>0\Gamma(x)>0 for x>0x>0, 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 ψ\psi is also strictly increasing on each interval between consecutive negative integer poles. Its one-sided limits imply exactly one real zero in each interval

(−n,−n+1),n=1,2,….(-n,-n+1),\qquad n=1,2,\ldots.

Asymptotic behavior and numerical evaluation

For large zz, the digamma function has the asymptotic expansion

ψ(z)∼log⁡z−12z−∑k=1∞B2k2k z2k,\psi(z) \sim \log z-\frac{1}{2z} -\sum_{k=1}^{\infty}\frac{B_{2k}}{2k\,z^{2k}},

where B2kB_{2k} are Bernoulli numbers. The first terms are

ψ(z)∼log⁡z−12z−112z2+1120z4−1252z6+⋯ .\psi(z) \sim \log z-\frac{1}{2z} -\frac{1}{12z^2} +\frac{1}{120z^4} -\frac{1}{252z^6} +\cdots.

This expansion applies as ∣z∣→∞|z|\to\infty in sectors bounded away from the negative real axis, using the principal branch of log⁡z\log z. 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 −1/(z+n)-1/(z+n) dominates. Near a zero, cancellation can reduce relative accuracy, so robust implementations may use local expansions or specialized approximations. Directly evaluating Γ′(z)\Gamma'(z) and Γ(z)\Gamma(z) 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

∑k=0N−11k+a=ψ(a+N)−ψ(a).\sum_{k=0}^{N-1}\frac{1}{k+a} = \psi(a+N)-\psi(a).

A related convergent infinite sum is

∑n=0∞1(n+a)(n+b)=ψ(b)−ψ(a)b−a,\sum_{n=0}^{\infty} \frac{1}{(n+a)(n+b)} = \frac{\psi(b)-\psi(a)}{b-a},

for distinct a,ba,b 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

∫0∞ta−1e−tlog⁡t dt=Γ(a)ψ(a),Re⁡a>0.\int_0^\infty t^{a-1}e^{-t}\log t\,dt = \Gamma(a)\psi(a), \qquad \operatorname{Re}a>0.

Probability and statistical inference

If XX has a gamma distribution with shape α>0\alpha>0 and rate β>0\beta>0, then its logarithmic expectation is

E[log⁡X]=ψ(α)−log⁡β.\mathbb E[\log X]=\psi(\alpha)-\log\beta.

Its log variance is

Var⁡(log⁡X)=ψ′(α).\operatorname{Var}(\log X)=\psi'(\alpha).

For a beta distribution with parameters α,β>0\alpha,\beta>0,

E[log⁡X]=ψ(α)−ψ(α+β),\mathbb E[\log X] = \psi(\alpha)-\psi(\alpha+\beta),
E[log⁡(1−X)]=ψ(β)−ψ(α+β).\mathbb E[\log(1-X)] = \psi(\beta)-\psi(\alpha+\beta).

More generally, for a Dirichlet distribution with parameter vector (α1,…,αK)(\alpha_1,\ldots,\alpha_K),

E[log⁡Xi]=ψ(αi)−ψ ⁣(∑j=1Kαj).\mathbb E[\log X_i] = \psi(\alpha_i) - \psi\!\left(\sum_{j=1}^{K}\alpha_j\right).

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

log⁡α−ψ(α)=log⁡xˉ−1n∑i=1nlog⁡xi.\log\alpha-\psi(\alpha) = \log\bar x-\frac1n\sum_{i=1}^{n}\log x_i.

This equation generally requires numerical solution. Its derivative,

1α−ψ′(α),\frac1\alpha-\psi'(\alpha),

allows the use of Newton's method. Trigamma and higher polygamma functions likewise appear in likelihood derivatives and information matrices.