Trigamma function
The trigamma function, denoted \psi_1(z) or \psi'(z), is a special function in mathematics defined as the first derivative of the digamma function \psi(z), which is the logarithmic derivative of the gamma function \Gamma(z): \psi(z) = \frac{\Gamma'(z)}{\Gamma(z)} and \psi'(z) = \frac{d}{dz} \psi(z) https://dlmf.nist.gov/5.15 https://mathworld.wolfram.com/PolygammaFunction.html. It belongs to the broader class of polygamma functions, which are higher-order derivatives of the digamma function, and plays a key role in analytic number theory, complex analysis, and the evaluation of sums and integrals involving the gamma function https://dlmf.nist.gov/5.15. One of the primary representations of the trigamma function is the infinite series \psi'(z) = \sum_{k=0}^{\infty} \frac{1}{(z+k)^2} for \Re(z) > 0, which connects it directly to the Hurwitz zeta function as \psi'(z) = \zeta(2,z) https://dlmf.nist.gov/5.15 https://mathworld.wolfram.com/PolygammaFunction.html. It satisfies the recurrence relation \psi'(z+1) = \psi'(z) - \frac{1}{z^2}, allowing computation for larger arguments from values at smaller ones, and a reflection formula \psi'(1-z) + \psi'(z) = \frac{\pi^2}{\sin^2(\pi z)} that relates values across the unit interval https://dlmf.nist.gov/5.15 https://mathworld.wolfram.com/PolygammaFunction.html. For large |z|, it has an asymptotic expansion \psi'(z) \sim \frac{1}{z} + \frac{1}{2z^2} + \sum_{n=1}^{\infty} \frac{B_{2n}}{z^{2n+1}}, where B_{2n} are Bernoulli numbers, facilitating approximations in the complex plane https://dlmf.nist.gov/5.15. Notable special values include \psi'(1) = \zeta(2) = \frac{\pi^2}{6} and \psi'(\frac{1}{2}) = \frac{\pi^2}{2}, linking the trigamma function to the Riemann zeta function and fundamental constants in number theory https://dlmf.nist.gov/5.15 https://mathworld.wolfram.com/PolygammaFunction.html. These properties make it essential in applications such as the evaluation of definite integrals, series summations in statistical mechanics, and the study of harmonic numbers, where it generalizes expressions like the sum of reciprocal squares https://dlmf.nist.gov/5.15.Definition and Basics
As a derivative of the digamma function
The trigamma function, denoted \psi_1(z) or \psi'(z), is defined as the first derivative of the digamma function \psi(z) with respect to the complex variable z, that is, \psi_1(z) = \frac{d}{dz} \psi(z). Since the digamma function is the logarithmic derivative of the gamma function \Gamma(z), given by \psi(z) = \frac{d}{dz} \ln \Gamma(z) = \frac{\Gamma'(z)}{\Gamma(z)}, it follows that the trigamma function is the second derivative of the logarithm of the gamma function: \psi_1(z) = \frac{d^2}{dz^2} \ln \Gamma(z). [1][2] This function was introduced by Leonhard Euler in the 18th century during his foundational studies on the gamma function and its higher-order logarithmic derivatives, collectively known as the polygamma functions of order one and above. For real z > 0, the trigamma function exhibits several basic properties that stem from its role in the analytic continuation of the gamma function. It is positive, strictly decreasing from +\infty as z \to 0^+ to 0 as z \to +\infty, and convex, as established by its complete monotonicity on (0, \infty).[3][4] A brief illustration of its behavior arises in the local expansion of \ln \Gamma(z) near positive integers, where \Gamma(n) = (n-1)! for positive integer n; the trigamma function quantifies the second-order curvature term in the Taylor series of \ln \Gamma(z) around such points, reflecting the function's smoothness away from the poles of \Gamma(z).[1]Integral and series representations
The trigamma function admits an infinite series representation that is valid in the right half-plane and serves as a basis for its analytic continuation. Specifically, for \operatorname{Re}(z) > 0, \psi_1(z) = \sum_{k=0}^\infty \frac{1}{(z + k)^2}. This series converges absolutely for \operatorname{Re}(z) > 0 and can be used to define \psi_1(z) meromorphically in the complex plane, with poles of order 2 at the non-positive integers z = -m for m = 0, 1, 2, \dots. An equivalent integral representation, valid for \operatorname{Re}(z) > 0, is obtained via differentiation of the integral form of the digamma function: \psi_1(z) = -\int_0^1 \frac{t^{z-1} \ln t}{1 - t} \, dt, where this representation facilitates evaluation through contour integration or series expansion of $1/(1-t).[5] This integral form is closely related to the Laplace transform, as \psi_1(z) equals the Laplace transform of the function t / (1 - e^{-t}): \psi_1(z) = \int_0^\infty \frac{t e^{-z t}}{1 - e^{-t}} \, dt, \quad \operatorname{Re}(z) > 0. The kernel t / (1 - e^{-t}) expands as \sum_{k=0}^\infty t e^{-k t}, recovering the series upon integration term by term, and this Laplace form underscores the complete monotonicity properties of \psi_1(z) for real positive arguments. Both the series and integral representations enable analytic continuation beyond \operatorname{Re}(z) > 0 by deforming contours or using functional equations, excluding the poles at non-positive integers.[6]Analytic Properties
Recurrence relations
The trigamma function, denoted \psi_1(z) or \psi'(z), satisfies the recurrence relation \psi_1(z+1) = \psi_1(z) - \frac{1}{z^2}, valid for z \neq 0, -1, -2, \dots. This relation follows from differentiating the corresponding recurrence for the digamma function, \psi(z+1) = \psi(z) + \frac{1}{z}, with respect to z.[1] Iterating the recurrence yields the extension for positive integers n: \psi_1(z + n) = \psi_1(z) - \sum_{k=0}^{n-1} \frac{1}{(z + k)^2}. This general form enables iterative computation of the trigamma function at large z by shifting to smaller arguments where series representations may converge more rapidly.[1]Reflection formula
The trigamma function satisfies the reflection formula \psi_1(1 - z) + \psi_1(z) = \frac{\pi^2}{\sin^2(\pi z)} for all complex numbers z that are not integers.[1] This identity provides a bilateral symmetry relating the function's values at complementary points z and $1 - z, facilitating computations and analytic continuations throughout the complex plane, excluding the poles of \psi_1 at non-positive integers.[1] The formula is derived by differentiating the reflection relation for the digamma function, \psi(1 - z) - \psi(z) = \pi \cot(\pi z). Differentiating both sides with respect to z yields -\psi_1(1 - z) - \psi_1(z) = \pi \cdot \frac{d}{dz} [\cot(\pi z)], where \frac{d}{dz} \cot(\pi z) = -\pi \csc^2(\pi z). Simplifying gives \psi_1(1 - z) + \psi_1(z) = \pi^2 \csc^2(\pi z), or equivalently, \frac{\pi^2}{\sin^2(\pi z)}.[1] This relation traces its origins to Euler's reflection formula for the gamma function, \Gamma(z) \Gamma(1 - z) = \frac{\pi}{\sin(\pi z)}, first published in 1769. Taking the logarithmic derivative of Euler's formula produces the digamma reflection, and a second differentiation yields the trigamma identity.[7][1]Asymptotic behavior
The trigamma function \psi_1(z) admits an asymptotic expansion for large |z| in the sector |\arg z| < \pi. Specifically, \psi_1(z) \sim \frac{1}{z} + \frac{1}{2z^2} + \sum_{k=1}^\infty \frac{B_{2k}}{z^{2k+1}}, where B_{2k} are the Bernoulli numbers of even index.\ This series is valid as |z| \to \infty with |\arg z| \leq \pi - \delta for any fixed \delta > 0, ensuring the expansion holds uniformly in that angular sector.$$](https://dlmf.nist.gov/5.15) For large \operatorname{Re}(z) > 0, the dominant behavior is captured by the leading term \psi_1(z) \approx 1/z, reflecting the function's monotonic decay along the positive real axis.\ This approximation provides a simple yet effective estimate for applications requiring rough scaling, such as bounding integrals involving \psi_1(z). The expansion arises from term-by-term differentiation of the corresponding asymptotic series for the digamma function \psi(z), and it connects directly to the Stirling series for \ln \Gamma(z), whose higher derivatives yield the polygamma asymptotics.[](https://dlmf.nist.gov/5.11) The Bernoulli numbers B_{2k} appear prominently here, as in many related expansions for gamma and zeta functions.\ Truncation of the series after the term involving B_{2m} yields a remainder whose magnitude is bounded by that of the subsequent term, O(1/|z|^{2m+2}), under the sector condition |\arg z| \leq \pi - \delta; this facilitates high-precision approximations by selecting an optimal number of terms based on |z|.[](https://dlmf.nist.gov/5.15)Computation
Special values at integers and half-integers
The trigamma function \psi_1(z), defined as the derivative of the digamma function \psi(z), admits exact closed-form expressions at positive integers n \geq 1. Specifically, \psi_1(n) = \sum_{k=0}^{\infty} \frac{1}{(n+k)^2} = \zeta(2) - H_{n-1}^{(2)}, where \zeta(2) = \frac{\pi^2}{6} is the Riemann zeta function at 2 and H_m^{(2)} = \sum_{k=1}^m \frac{1}{k^2} is the generalized harmonic number of order 2 (with H_0^{(2)} = 0). This follows from the recurrence relation \psi_1(z+1) = \psi_1(z) - \frac{1}{z^2}, iterated from the base value \psi_1(1) = \frac{\pi^2}{6}. At half-integers, exact values are also available, starting with \psi_1\left(\frac{1}{2}\right) = 3\zeta(2) = \frac{\pi^2}{2}. Subsequent values follow the recurrence: for example, \psi_1\left(\frac{3}{2}\right) = \psi_1\left(\frac{1}{2}\right) - \frac{1}{(1/2)^2} = \frac{\pi^2}{2} - 4. These can be derived using the reflection formula \psi_1(1-z) + \psi_1(z) = \pi^2 \csc^2(\pi z) or multiplication theorems for the gamma function.[1] The trigamma function exhibits poles at the non-positive integers z = 0, -1, -2, \dots, where it has singularities of order 2, arising from the simple poles of the gamma function \Gamma(z) at these points. The following table lists exact values for the first few positive integers and half-integers:| Argument z | \psi_1(z) |
|---|---|
| 1 | \frac{\pi^2}{6} |
| 2 | \frac{\pi^2}{6} - 1 |
| 3 | \frac{\pi^2}{6} - \frac{5}{4} |
| \frac{1}{2} | \frac{\pi^2}{2} |
| \frac{3}{2} | \frac{\pi^2}{2} - 4 |
| \frac{5}{2} | \frac{\pi^2}{2} - \frac{40}{9} |
Numerical evaluation methods
The numerical evaluation of the trigamma function \psi_1(z) for complex arguments z with \operatorname{Re}(z) > 0 typically involves reducing the argument to a fundamental strip using recurrence relations and the reflection formula, followed by series summation or asymptotic expansions depending on the magnitude of |z|. The recurrence \psi_1(z+1) = \psi_1(z) - 1/z^2 allows repeated application to shift z rightward until \operatorname{Re}(z) exceeds a threshold, such as 10, minimizing the number of terms in subsequent computations while avoiding poles at non-positive integers. For arguments near the poles or with small \operatorname{Re}(z), the reflection formula \psi_1(1-z) = -\psi_1(z) + \pi^2 / \sin^2(\pi z) maps the computation to the strip $0 < \operatorname{Re}(z) < 1, ensuring stability by evaluating the less singular side. This combined strategy, as implemented in modern libraries, balances efficiency and accuracy across the complex plane.[1][8] For arguments in the fundamental strip with moderate |z|, direct series summation provides a reliable method: \psi_1(z) = \sum_{k=0}^\infty 1/(z + k)^2. Truncation after M terms, where M is chosen such that the remainder is below machine epsilon (e.g., M \approx 20 + 10 \operatorname{Re}(z) for double precision), yields high accuracy, but convergence slows for large \operatorname{Re}(z). Acceleration techniques, such as Euler-Maclaurin summation or Levin transformations, can reduce the effective number of terms by an order of magnitude, particularly for real positive z > 1. An alternative finite-sum approximation, derived from contour integrals and Stirling's series, uses precomputed coefficients c_k = (-1)^{k-1} (a - k)^{k - 1/2} e^{a - k} / \sqrt{2\pi (k-1)!} for k = 1 to N = \lfloor a \rfloor - 1, with a \geq 7 for double precision, approximating \psi_1(z) via differentiation of the gamma approximation; this method achieves relative errors under $10^{-15} for |z| > 1 with fixed N.[8] For large |z| in |\arg z| \leq \pi - \delta (\delta > 0), the asymptotic series offers rapid convergence:[ \psi_1(z) \sim \frac{1}{z} + \frac{1}{2z^2} + \sum_{k=1}^m \frac{B_{2k}}{z^{2k+1}} + R_m(z), where $B_{2k}$ are Bernoulli numbers (precomputable up to high order using recursive formulas or tables), and the remainder $R_m(z)$ satisfies $|R_m(z)| < |B_{2m+2}| / (|z|^{2m+2} (1 - |z|^{-2}))$ for $m \geq 1$. Truncation at the term where coefficients begin increasing ensures optimal accuracy, typically requiring 10–20 terms for $|z| > 10$ to achieve double precision. This expansion stems from differentiating the [digamma](/page/Digamma) asymptotic and is particularly efficient for $|z| \gg 1$, complementing the series method.[](https://dlmf.nist.gov/5.15) Implementations in scientific computing libraries leverage these techniques for robust evaluation. The [SciPy](/page/SciPy) library's `scipy.special.polygamma(1, z)` function supports real and complex arguments, employing recurrence reduction, reflection for the left half-plane, series summation for small $|z|$, and asymptotic expansions for large $|z|$, with automatic handling up to machine precision.[](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.polygamma.html) Similarly, Mathematica's `PolyGamma[1, z]` uses [arbitrary-precision arithmetic](/page/Arbitrary-precision_arithmetic), combining the above methods with internal optimizations like continued fractions for intermediate ranges, enabling evaluation to hundreds of decimal places.[](https://reference.wolfram.com/language/ref/PolyGamma.html) Precision considerations are critical due to the trigamma function's poles at $z = 0, -1, -2, \dots$, where it diverges as $1/(z + n)^2$, and its branch cut along the negative real axis for complex arguments. Libraries detect proximity to poles (e.g., within $10^{-8}$) and return warnings or infinities, while for branch cuts, the principal value is taken with $\arg z \in (-\pi, \pi]$; high-precision modes require scaling $a$ in approximations like Spouge's to control rounding errors below $10^{-d}$ for $d$-digit accuracy.[](https://epubs.siam.org/doi/10.1137/0731050) Special values serve as test cases to validate implementations, ensuring consistency across methods.[](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.polygamma.html) ## Relations to Other Functions ### Connection to the Hurwitz zeta function The trigamma function $\psi_1(z)$ is connected to the [Hurwitz zeta function](/page/Hurwitz_zeta_function) through the identity \psi_1(z) = \zeta(2, z) for $\Re(z) > 0$, where the [Hurwitz zeta function](/page/Hurwitz_zeta_function) is defined by the series \zeta(s, a) = \sum_{k=0}^\infty \frac{1}{(a + k)^s} with $\Re(s) > 1$ and $\Re(a) > 0$. This relation arises directly from the corresponding series representation of the trigamma function, \psi_1(z) = \sum_{k=0}^\infty \frac{1}{(z + k)^2}, which matches the Hurwitz zeta series specialized to $s = 2$ and $a = z$.[](https://dlmf.nist.gov/5.15#E10) The identity extends the domain of the trigamma function via the [analytic continuation](/page/Analytic_continuation) of the [Hurwitz zeta function](/page/Hurwitz_zeta_function), which is meromorphic in the entire [complex](/page/Complex) $s$-[plane](/page/Plane) (with a simple pole at $s=1$) and holomorphic in $a$ except for simple poles at non-positive integers; for fixed $s=2$, $\zeta(2, z)$ provides the continuation of $\psi_1(z)$ to the [complex](/page/Complex) $z$-[plane](/page/Plane), excluding simple poles at the non-positive integers $z = 0, -1, -2, \dots$. This continuation preserves the positive real axis definition while enabling evaluation and properties in broader regions.[](https://dlmf.nist.gov/25.11) A notable special case occurs at $z=1$, where $\psi_1(1) = \zeta(2, 1) = \zeta(2) = \frac{\pi^2}{6}$, linking the trigamma function to the [Riemann zeta function](/page/Riemann_zeta_function) $\zeta(s) = \zeta(s, 1)$. As $z \to \infty$ with $\Re(z) > 0$, both $\psi_1(z)$ and $\zeta(2, z)$ asymptotically approach 0, consistent with the diminishing terms in their series expansions. This connection facilitates the application of Hurwitz zeta properties to the trigamma function, such as its [functional equation](/page/Functional_equation)s and reflection formulas, which relate values at $z$ and $1-z$ through [Fourier series](/page/Fourier_series) expansions; for instance, the functional equation of $\zeta(s, a)$ can derive asymptotic expansions and reflection relations for $\psi_1(z)$ without relying solely on [gamma function](/page/Gamma_function) derivatives.[](https://dlmf.nist.gov/25.13) ### Relation to the Clausen function The Clausen function of order 2, denoted $\mathrm{Cl}_2(\theta)$, is defined by the infinite series \mathrm{Cl}2(\theta) = \sum{k=1}^\infty \frac{\sin(k \theta)}{k^2}. The trigamma function at rational arguments can be expressed in terms of the [Clausen function](/page/Clausen_function). Specifically, \psi_1\left( \frac{p}{q} \right) = \frac{\pi^2}{2 \sin^2 \left( \pi \frac{p}{q} \right)} + 2 q \sum_{m=1}^{(q-1)/2} \sin \left( \frac{2 \pi m p}{q} \right) \mathrm{Cl}_2 \left( \frac{2 \pi m}{q} \right), for integers $1 \leq p < q/2$ with $q$ odd. This relation arises from the reflection formula and series expansions, allowing evaluation at rational points using known values of the [Clausen function](/page/Clausen_function_of_complex_arguments), which is useful in number theory and the computation of polygamma values. The relation facilitates analytical evaluation of the trigamma function at rational arguments, which is particularly useful in contexts involving finite sums and trigonometric identities. Historically, the Clausen function traces its origins to the work of Thomas Clausen, who introduced it in 1832 while studying the decomposition of real fractional functions. It is closely linked to the [Lobachevsky function](/page/Lobachevsky_function), defined as $\Lambda(\theta) = -\int_0^\theta \ln \left| 2 \sin \frac{t}{2} \right| dt$, which coincides with $\mathrm{Cl}_2(\theta)$ up to a change of variables and was explored in 19th-century investigations of hyperbolic geometry by Nikolai Lobachevsky. These early studies laid the groundwork for the function's appearance in polygamma relations, bridging geometric and analytic number theory.[](https://mathworld.wolfram.com/ClausenFunction.html)[](https://mathworld.wolfram.com/LobachevskysFunction.html) ## Applications ### In probability and statistics The trigamma function arises naturally in the computation of variances for logarithmic transformations of random variables from distributions in the gamma family. Specifically, if $X$ follows a gamma distribution with shape parameter $\alpha > 0$ and rate parameter $\beta > 0$, then the variance of $\ln X$ is $\psi_1(\alpha)$, independent of $\beta$. This follows from the fact that $\ln X$ has mean $\psi(\alpha) + \ln \beta$ and variance equal to the second [derivative](/page/Derivative) of $\ln \Gamma(\alpha)$ with respect to $\alpha$.[](https://www.math.ucla.edu/~tom/LST/sec02.pdf) A similar role appears in the [beta distribution](/page/Beta_distribution), which models proportions and can be represented as the ratio of two independent gamma random variables. For $X \sim \mathrm{Beta}(\alpha, \beta)$, the variance of $\ln X$ is $\psi_1(\alpha) + \psi_1(\beta) - \psi_1(\alpha + \beta)$. This expression quantifies the variability of the log-odds or log-proportion in applications like Bayesian modeling of success probabilities.[](https://www.medrxiv.org/content/10.1101/2023.06.12.23291285v1.full.pdf) In [maximum likelihood estimation](/page/Maximum_likelihood_estimation), the trigamma function enters through the [Fisher information](/page/Fisher_information) matrix, which measures the amount of [information](/page/Information) data provide about parameters. For the [gamma distribution](/page/Gamma_distribution) with unknown shape $\alpha$ and rate $\lambda$, the [Fisher information](/page/Fisher_information) matrix has elements involving $\psi_1(\alpha)$ on the diagonal and cross terms with $1/\lambda$ and $\alpha/\lambda^2$. For the [beta distribution](/page/Beta_distribution), the information for $\alpha$ and $\beta$ similarly incorporates differences of trigamma functions at $\alpha$, $\beta$, and $\alpha + \beta$, aiding in asymptotic variance estimates for maximum likelihood estimators.[](https://www.stat.umn.edu/geyer/s13/5102/notes/mcmc.pdf) The [Dirichlet distribution](/page/Dirichlet_distribution), a multivariate [generalization](/page/Generalization) of the [beta](/page/Beta) used as a [prior](/page/Prior) for multinomial proportions in [Bayesian statistics](/page/Bayesian_statistics), features the trigamma function in its [Fisher information](/page/Fisher_information) matrix. The [metric tensor](/page/Metric_tensor) components are $\psi_1(\alpha_i) \delta_{ij} - \psi_1(\alpha_0)$, where $\alpha_0 = \sum \alpha_i$, determining the curvature and thus the asymptotic [covariance matrix](/page/Covariance_matrix) of maximum likelihood estimators for the parameters in multinomial models. This structure is crucial for inference in [compositional data](/page/Compositional_data) analysis and topic modeling.[](http://userhome.brooklyn.cuny.edu/Stephen.Preston/fisher_rao_dirichlet.pdf) An illustrative application occurs in Bayesian priors, where the Dirichlet serves as a [conjugate prior](/page/Conjugate_prior) for multinomial likelihoods, and the prior variance of the log-probabilities $\ln p_i$ for category $i$ is $\psi_1(\alpha_i) + \psi_1(\alpha_0 - \alpha_i) - \psi_1(\alpha_0)$. This variance computation supports approximations in variational Bayes for models like [latent Dirichlet allocation](/page/Latent_Dirichlet_allocation), enabling efficient posterior inference by quantifying uncertainty in log-probability estimates under the prior.[](https://arxiv.org/pdf/2410.20754) ### In harmonic analysis and physics In [harmonic analysis](/page/Harmonic_analysis), the trigamma function plays a key role in the partial fraction decompositions of [trigonometric functions](/page/Trigonometric_functions), particularly through its reflection formula, which connects it to the cosecant function. Specifically, the [identity](/page/Identity) $\psi_1(z) + \psi_1(1 - z) = \frac{\pi^2}{\sin^2(\pi z)}$ provides a bridge between the trigamma function and periodic structures, facilitating the summation of series in Fourier expansions. This relation arises from differentiating the reflection formula for the [digamma function](/page/Digamma_function) and is instrumental in deriving the Mittag-Leffler expansion of $\pi \cot(\pi z)$, whose [second derivative](/page/Second_derivative) yields sums expressible via $\psi_1(z)$. Such decompositions are foundational for analyzing [Fourier series](/page/Fourier_series) of rational functions on [the circle](/page/The_Circle) and in [spectral theory](/page/Spectral_theory) of differential operators on periodic domains.[](https://mathworld.wolfram.com/TrigammaFunction.html) In [string theory](/page/String_theory), the trigamma function evaluates volumes and metrics on [moduli spaces](/page/Moduli_space), particularly in the context of Kähler moduli for Calabi-Yau compactifications. For example, constant terms in the one-loop Kähler metric on the moduli space of type IIB orientifolds involve $\psi_1(x)$, arising from holomorphic integrals over the [worldsheet](/page/Worldsheet) that determine the curvature of the moduli space metric.[](https://projecteuclid.org/journals/advances-in-theoretical-and-mathematical-physics/volume-18/issue-5/Geometric-engineering-of-framed-BPS-states/atmp/1416929531.pdf) This usage ensures modular invariance in the [effective action](/page/Effective_action) and constrains the geometry of BPS states. The trigamma function also appears in black hole entropy calculations through polygamma sums that quantify microstate fluctuations. In the analysis of Hawking radiation decoherence for superposed black holes, the decoherence rate involves $\psi_1(y)$, where $y$ parameterizes the superposition separation, linking entanglement [entropy](/page/Entropy) corrections to [vacuum polarization](/page/Vacuum_polarization).[](https://www.nature.com/articles/s41467-019-08426-4)