# Trigamma function

In mathematics, the trigamma function, denoted ψ$_1$(z) or ψ$^{(1)}$(z), is the second of the polygamma functions, and is defined by
    $\psi _{1}(z)={\frac {d^{2}}{dz^{2}}}\ln \Gamma (z)$.
It follows from this definition that
    $\psi _{1}(z)={\frac {d}{dz}}\psi (z)$
where ψ(z) is the digamma function. It may also be defined as the sum of the series
    $\psi _{1}(z)=\sum _{n=0}^{\infty }{\frac {1}{(z+n)^{2}}},$
making it a special case of the Hurwitz zeta function
    $\psi _{1}(z)=\zeta (2,z).$
Note that the last two formulas are valid when 1 − z is not a natural number.

## Calculation

A double integral representation, as an alternative to the ones given above, may be derived from the series representation:
    $\psi _{1}(z)=\int _{0}^{1}\!\!\int _{0}^{x}{\frac {x^{z-1}}{y(1-x)}}\,dy\,dx$
using the formula for the sum of a geometric series. Integration over y yields:
    $\psi _{1}(z)=-\int _{0}^{1}{\frac {x^{z-1}\ln {x}}{1-x}}\,dx$
An asymptotic expansion as a Laurent series can be obtained via the derivative of the asymptotic expansion of the digamma function:
    ${\begin{aligned}\psi _{1}(z)&\sim {\operatorname {d} \over \operatorname {d} \!z}\left(\ln z-\sum _{n=1}^{\infty }{\frac {B_{n}}{nz^{n}}}\right)\\&={\frac {1}{z}}+\sum _{n=1}^{\infty }{\frac {B_{n}}{z^{n+1}}}=\sum _{n=0}^{\infty }{\frac {B_{n}}{z^{n+1}}}\\&={\frac {1}{z}}+{\frac {1}{2z^{2}}}+{\frac {1}{6z^{3}}}-{\frac {1}{30z^{5}}}+{\frac {1}{42z^{7}}}-{\frac {1}{30z^{9}}}+{\frac {5}{66z^{11}}}-{\frac {691}{2730z^{13}}}+{\frac {7}{6z^{15}}}\cdots \end{aligned}}$
where B$_n$ is the nth Bernoulli number and we choose B$_1$ = ⁠1/2⁠.

### Recurrence and reflection formulae

The trigamma function satisfies the recurrence relation
    $\psi _{1}(z+1)=\psi _{1}(z)-{\frac {1}{z^{2}}}$
and the reflection formula
    $\psi _{1}(1-z)+\psi _{1}(z)={\frac {\pi ^{2}}{\sin ^{2}\pi z}}\,$
which immediately gives the value for z = ⁠1/2⁠: $\psi _{1}({\tfrac {1}{2}})={\tfrac {\pi ^{2}}{2}}$.

### Special values

At positive integer values we have that
    $\psi _{1}(n)={\frac {\pi ^{2}}{6}}-\sum _{k=1}^{n-1}{\frac {1}{k^{2}}},\qquad \psi _{1}(1)={\frac {\pi ^{2}}{6}},\qquad \psi _{1}(2)={\frac {\pi ^{2}}{6}}-1,\qquad \psi _{1}(3)={\frac {\pi ^{2}}{6}}-{\frac {5}{4}}.$
At positive half integer values we have that
    $\psi _{1}\left(n+{\frac {1}{2}}\right)={\frac {\pi ^{2}}{2}}-4\sum _{k=1}^{n}{\frac {1}{(2k-1)^{2}}},\qquad \psi _{1}\left({\tfrac {1}{2}}\right)={\frac {\pi ^{2}}{2}},\qquad \psi _{1}\left({\tfrac {3}{2}}\right)={\frac {\pi ^{2}}{2}}-4.$
The trigamma function has other special values such as:
    $\psi _{1}\left({\tfrac {1}{4}}\right)=\pi ^{2}+8G$
where G represents Catalan's constant.
There are no roots on the real axis of ψ$_1$, but there exist infinitely many pairs of roots z$_n$, z$_n$ for Re z < 0. Each such pair of roots approaches Re z$_n$ = −n + ⁠1/2⁠ quickly and their imaginary part increases slowly logarithmic with n. For example, z$_1$ = −0.4121345... + 0.5978119...i and z$_2$ = −1.4455692... + 0.6992608...i are the first two roots with Im(z) > 0.

### Relation to the Clausen function

The digamma function at rational arguments can be expressed in terms of trigonometric functions and logarithm by the digamma theorem. A similar result holds for the trigamma function but the circular functions are replaced by Clausen's function. Namely,
    $\psi _{1}\left({\frac {p}{q}}\right)={\frac {\pi ^{2}}{2\sin ^{2}(\pi p/q)}}+2q\sum _{m=1}^{(q-1)/2}\sin \left({\frac {2\pi mp}{q}}\right){\textrm {Cl}}_{2}\left({\frac {2\pi m}{q}}\right).$

## Appearance

The trigamma function appears in this sum formula:
    $\sum _{n=1}^{\infty }{\frac {n^{2}-{\frac {1}{2}}}{\left(n^{2}+{\frac {1}{2}}\right)^{2}}}\left(\psi _{1}{\biggn-{\frac {i}{\sqrt {2}}}{\bigg )}+\psi _{1}{\biggn+{\frac {i}{\sqrt {2}}}{\bigg )}\right)=-1+{\frac {\sqrt {2}}{4}}\pi \coth {\frac {\pi }{\sqrt {2}}}-{\frac {3\pi ^{2}}{4\sinh ^{2}{\frac {\pi }{\sqrt {2}}}}}+{\frac {\pi ^{4}}{12\sinh ^{4}{\frac {\pi }{\sqrt {2}}}}}\left(5+\cosh \pi {\sqrt {2}}\right).$