Connect via MCP →

Enter Calculation

n = -1, 0, 1, 2, 3, 4
argument (real number, valid for a > 0)

Formula

Advertisement

Results

Polygamma value Ψn(a)
0.221322955737
at n = 1, a = 5.0
Derivative order n 1
Argument a 5.0
Function Trigamma Ψ1(a)

What is the polygamma function?

The polygamma function of order n, written \(\psi^{(n)}(a)\), is the (n+1)-th derivative of the natural logarithm of the gamma function. With the indexing used here, \(n = -1\) returns the log-gamma function \(\ln\Gamma(a)\) itself, \(n = 0\) returns the digamma function \(\psi(a)\), \(n = 1\) the trigamma function, \(n = 2\) the tetragamma, and so on. These special functions appear throughout probability, statistics (maximum-likelihood for gamma and beta distributions), number theory and asymptotic analysis. This is pure mathematics and applies identically everywhere.

Curves showing log-gamma and its successive derivatives the polygamma functions
The polygamma functions arise as successive derivatives of the log-gamma function.

How to use this calculator

Pick the derivative order n from the dropdown (-1, 0, 1, 2, 3, or 4) and type the argument a as a real number. Press calculate to get \(\psi^{(n)}(a)\) to about 12 significant digits. The rebuild is fully valid for \(a > 0\); for a less than or equal to 0 the functions require reflection and the calculator flags non-positive integers (the poles of the gamma function) as undefined.

The formula explained

For \(n = -1\) the value is computed with the Lanczos approximation for \(\ln\Gamma\). For \(n = 0\) the digamma is found by the recurrence $$\psi(x) = \psi(x+1) - \frac{1}{x}$$ to push the argument above 6, followed by the asymptotic series $$\psi(x) \sim \ln x - \frac{1}{2x} - \frac{1}{12 x^2} + \cdots$$ For \(n \geq 1\) the recurrence $$\psi^{(n)}(x) = \psi^{(n)}(x+1) + (-1)^{n+1} \frac{n!}{x^{n+1}}$$ shifts the argument past 10, then a Bernoulli-number asymptotic series finishes the evaluation.

Diagram of taking successive derivatives of log-gamma to form polygamma orders
Each polygamma order n is obtained by differentiating ln Γ(a) a further n+1 times.

Worked example

Take \(n = 1\), \(a = 5\) (the trigamma at 5). Using the identity \(\psi^{(1)}(m) = \frac{\pi^2}{6} - \sum_{k=1}^{m-1} \frac{1}{k^2}\), we get $$1.6449340668 - \left(1 + \frac{1}{4} + \frac{1}{9} + \frac{1}{16}\right) = 1.6449340668 - 1.4236111111 = 0.2213229557$$ The calculator returns approximately \(0.221322955737\).

FAQ

Why is a = 0 or a negative integer undefined? The gamma function has poles at 0, -1, -2, ..., so \(\ln\Gamma\) and every polygamma diverge there.

What is the difference between digamma and trigamma? Digamma (\(n = 0\)) is the first derivative of \(\ln\Gamma\); trigamma (\(n = 1\)) is the second derivative, equal to the derivative of digamma.

How accurate is the result? Double-precision arithmetic with the shift-and-asymptotic method gives roughly 12-15 correct significant digits for \(a > 0\).

Last updated: