Skip to content

polygamma

Polygamma function ψ^(k)(x).

v = polygamma(k, x)

Returns the k-th derivative of the digamma function ψ(x) = d/dx ln(Γ(x)). With k = 0, returns ψ(x) itself; k = 1 gives the trigamma function, etc.

polygamma(0, 1) % ≈ -0.5772 (Euler-Mascheroni constant)
  • gamma — Gamma function Γ(x).
  • gammaln — Natural logarithm of the gamma function, ln(|Γ(x)|).