## Monday Math 41: The Digamma Function

Finding the derivative of the gamma function is not an easy task. However, there are reasons to do so. In particular, mathematicians define the digamma function (which I’ve mentioned here), the logarithmic derivative of the gamma function:
$\psi_0(z)\equiv\frac{d}{dz}\ln{\Gamma}(x)=\frac{{\Gamma}'(x)}{{\Gamma}(x)}$
This is continuous except for the poles at zero and the negative integers.
We can use the Weierstrass form to find some useful expressions for the digamma function. We have:
$\Gamma(z)=e^{-\gamma{z}}\frac{1}{z}\prod_{k=1}^{\infty}\frac{e^{z/k}}{1+\frac{z}{k}}$,
where γ is the Euler-Mascheroni constant, and thus
$\begin{array}{rcl}\ln\Gamma(z)&=&\ln\left[e^{-\gamma{z}}\frac{1}{z}\prod_{k=1}^{\infty}\frac{e^{z/k}}{1+\frac{z}{k}}\right]\\&=&-\gamma{z}-\ln{z}+\sum_{k=1}^{\infty}\ln\left[\frac{e^{z/k}}{1+\frac{z}{k}}\right]\\&=&-\gamma{z}-\ln{z}+\sum_{k=1}^{\infty}\left[\frac{z}{k}-\ln\left(1+\frac{z}{k}\right)\right]\end{array}$.
Taking the derivative with respect to z, we get
$\begin{array}{rcl}\psi_0(z)&=&-\gamma-\frac{1}{z}+\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k}\right]\\&=&-\gamma+\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k-1}\right]\end{array}$

Now, note immediately what happens if z is a positive integer n; the terms $-\frac{1}{n+k-1}$, k=1,2,3,… are canceled by the terms $\frac{1}{k}$ for k=n,n+1,n+2,…, and thus the sum $\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k-1}\right]$ collapses for positive integer n to the finite sum
$\sum_{k=1}^{n-1}\frac{1}{k}=H_{n-1}$, where Hn are the harmonic numbers. Thus for positive integer n,
$\psi_0(n)=-\gamma+\sum_{k=1}^{n-1}\frac{1}{k}=-\gamma+H_{n-1}$
and so we see immediately that ψ0(1)=-γ and ψ0(2)=1-γ (and thus the only positive zero of ψ0 lies between these two).

Using the series form
$\psi_0(z)=-\gamma+\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k-1}\right]$,
we see
$\psi_0(z+1)=-\gamma+\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k}\right]$,
and so we have
$\begin{array}{rcl}\psi_0(z+1)-\psi_0(z)&=&\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k}\right]-\sum_{k=1}^{\infty}\left[\frac{1}{k}-\frac{1}{z+k-1}\right]\\&=&\sum_{k=1}^{\infty}\left[\frac{1}{z+k-1}-\frac{1}{z+k}\right]\\&=&\frac{1}{z}\\\psi_0(z+1)&=&\psi_0(z)+\frac{1}{z}\end{array}$
as a recurrence relation for ψ0.

Now, recall the Euler reflection formula we derived previously:
$\Gamma(x)\Gamma(1-x)=\frac{\pi}{\sin\pi{x}}$
Taking the logarithm of both sides, and then differentiating,
$\begin{array}{rcl}\ln\left(\Gamma(x)\Gamma(1-x)\right)&=&\ln\left(\frac{\pi}{\sin\pi{x}}\right)\\\ln{\Gamma}(x)+\ln{\Gamma}(1-x)&=&\ln\pi-\ln\sin\pi{x}\\\psi_0(x)-\psi_0(1-x)&=&-\pi\cot\pi{x}\\\psi_0(1-x)&=&\psi_0(x)+\pi\cot\pi{x}\end{array}$.

Applying a similar process to the Legendre duplication formula:
$\begin{array}{rcl}{\Gamma}(2z)&=&\frac{2^{2z-1}}{\sqrt{\pi}}{\Gamma}(z+\frac{1}{2}){\Gamma}(z)\\\ln{\Gamma}(2z)&=&\ln\left(\frac{2^{2z-1}}{\sqrt{\pi}}\right)+\ln{\Gamma}(z)+\ln{\Gamma}(z+\frac{1}{2})\\\ln{\Gamma}(2z)&=&(2z-1)\ln2-\frac{1}{2}\ln\pi+\ln{\Gamma}(z)+\ln{\Gamma}(z+\frac{1}{2})\\2\psi_0(2z)&=&2\ln2+\psi_0(z)+\psi_0(z+\frac{1}{2})\\\psi_0(2z)&=&\frac{1}{2}\psi_0(z)+\frac{1}{2}\psi_0(z+\frac{1}{2})+\ln2\end{array}$
Plugging in z=1/2, we get
$\begin{array}{rcl}\psi_0(1)&=&\frac{1}{2}\psi_0\left(\frac{1}{2}\right)+\frac{1}{2}\psi_0(1)+\ln2\\\frac{1}{2}\psi_0(1)&=&\frac{1}{2}\psi_0\left(\frac{1}{2}\right)+\ln2\\\psi_0(1)&=&\psi_0\left(\frac{1}{2}\right)+2\ln2\\\psi_0\left(\frac{1}{2}\right)&=&\psi_0(1)-2\ln2\\\psi_0\left(\frac{1}{2}\right)&=&-\gamma-2\ln2\end{array}$

In fact, Gauss proved a formula (Gauss’s DIgamma Theorem) for the exact value of the digamma function for any rational value between 0 and 1: given 0<p<q,
$\psi_0\left(\frac{p}{q}\right)=-\gamma-\frac{\pi}{2}\cot\left(\frac{\pi{p}}{q}\right)-\ln(2q)+\sum_{k=1}^{q-1}\cos\left(\frac{2\pi{kp}}{q}\right)\ln\sin\left(\frac{\pi{k}}{q}\right)$.

Lastly, recall that $\gamma=\lim_{n\to\infty}(H_n-\ln{n})$. From this, and that $\phi_0(n)=H_{n-1}-\gamma$, we expect that $\phi_0(x)$ should approach $\ln(x-1)$, and thus approach $\ln{x}$, as z goes to infinity. Now, using the Stirling’s approximation for the gamma function,
${\Gamma}(x)\approx\sqrt{2\pi}x^{x-\frac{1}{2}}e^{-x}=\sqrt{\frac{2\pi}{x}}\left(\frac{x}{e}\right)^x$
we see
$\ln{\Gamma}(x)\approx\left(x-\frac{1}{2}\right)\ln{x}-x+\frac{1}{2}\ln(2\pi)$
$\phi_0(x)\approx\frac{x-\frac{1}{2}}{x}+\ln{x}-1$
$\phi_0(x)\approx\ln{x}-\frac{1}{2x}$,
which actually lies sandwiched between $\ln{x}$ and $\ln(x-1)$.

### 3 Responses to “Monday Math 41: The Digamma Function”

1. Monday Math 42 « Twisted One 151’s Weblog Says:

[…] ? How about the general , for non-negative integer n? First, recall that . Thus, Recall from the previous Monday Math post the digamma function: , and thus . In particular, , with γ the Euler-Mascheroni […]

2. Monday Math 43 « Twisted One 151’s Weblog Says:

[…] Math 43 Now, we’ve introduced the digamma function, which allows us to find the derivative of the gamma function. But what about higher order […]

3. Michael Says:

I recomend my article “Construction of the digamma function by derivative definition” in http://arxiv.org/abs/0804.1081

My regards,