|MATLAB Function Reference|
Psi (polygamma) function
Y = psi(X)
evaluates the function for each element of array
X must be real and nonnegative. The function, also known as the digamma function, is the logarithmic derivative of the gamma function
Y = psi(k,X)
kth derivative of at the elements of
psi(0,X) is the digamma function,
psi(1,X) is the trigamma function,
psi(2,X) is the tetragamma function, etc.
Y = psi(k0:k1,X)
evaluates derivatives of order
Y(k,j) is the
(k-1+k0)th derivative of , evaluated at
Example 1. Use the
psi function to calculate Euler's constant, .
Example 2. The trigamma function of 2,
psi(1,2), is the same as .
Example 3. This code produces the first page of Table 6.1 in Abramowitz and Stegun .
Example 4. This code produces a portion of Table 6.2 in .
 Abramowitz, M. and I. A. Stegun, Handbook of Mathematical Functions, Dover Publlications, 1965, Sections 6.3 and 6.4.