Digamma in LaTeX (\psi(x))
- LaTeX command
\psi(x)- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Digamma function, the logarithmic derivative of the gamma function: Gamma'(x)/Gamma(x).
\psi(x) = \frac{d}{dx}\ln\Gamma(x) satisfies \psi(x+1) = \psi(x) + 1/x, so \psi(n+1) = H_n - \gamma with H_n the harmonic number and \gamma the Euler-Mascheroni constant, and \psi(1) = -\gamma. It appears in variational Bayes for Dirichlet distributions, where \mathbb{E}[\ln \theta_k] = \psi(\alpha_k) - \psi(\sum_j \alpha_j). The Greek \psi is standard; some texts write F(x). Do not use \digamma, which prints the archaic Greek letter digamma rather than the function. In quantum mechanics \psi is the wavefunction, so define it.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Digamma: $\psi(x)$
\[ \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}, \quad \psi(1) = -\gamma \]
\end{document}Related symbols
- Polygamma
\psi^{(n)}(x) - Hypergeometric
{}_2F_1(a,b;c;z) - Elliptic Integral K
K(k) - Chebyshev U
U_n(x) - Elliptic Integral E
E(k) - Chebyshev T
T_n(x)
Frequently asked questions
- How do I write Digamma in LaTeX?
- Type \psi(x) in math mode, for example $\psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}, \quad \psi(1) = -\gamma$. It works in plain LaTeX without loading any package.
- Which package do I need for \psi(x)?
- None. \psi(x) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \psi(x) in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\psi(x)$ in running text.
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث