Digamma Function Calculator

Data Visualization
x ψ(x) 0 1

Digamma Function Calculator

What is the Digamma Function?

The digamma function, denoted as \(\psi(x)\), is a special function defined as the logarithmic derivative of the gamma function. It plays a crucial role in various areas of mathematics, including complex analysis, number theory, and statistics.

Formula and Its Meaning

The digamma function is defined as:

\[\psi(x) = \frac{d}{dx} \ln(\Gamma(x)) = \frac{\Gamma'(x)}{\Gamma(x)}\]

Where \(\Gamma(x)\) is the gamma function.

For positive integers n, the digamma function can be expressed as:

\[\psi(n) = -\gamma + \sum_{k=1}^{n-1} \frac{1}{k}\]

Where \(\gamma\) is the Euler-Mascheroni constant.

Calculation Steps

  1. For large x, we use the asymptotic expansion:
  2. \[\psi(x) \approx \ln(x) - \frac{1}{2x} - \frac{1}{12x^2} + \frac{1}{120x^4} - \frac{1}{252x^6} + \cdots\]

  3. For smaller x, we use the recurrence relation:
  4. \[\psi(x) = \psi(x+1) - \frac{1}{x}\]

  5. Apply these formulas iteratively to calculate the digamma function value.

Example Calculation

Let's calculate \(\psi(5)\):

  1. Using the formula for positive integers:
  2. \[\psi(5) = -\gamma + (1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4})\]

  3. Substituting the value of \(\gamma \approx 0.5772156649\):
  4. \[\psi(5) \approx -0.5772156649 + 2.0833333333 \approx 1.5061176684\]

Visual Representation

x ψ(x)

This graph represents the general shape of the digamma function. It increases monotonically for x > 0 and has poles at non-positive integers.