# Some expectation values for a Gamma distribution

Assuming I have a Gamma distributed random Variable $x \sim Gamma( \alpha, \beta )$. Now I like to have the following two expectation values (integrals):

1. $E \left[ x \ln x \right]$
2. $E \left[ \ln \Gamma \left( x \right) \right]$ with $\Gamma \left( x \right)$ being the Gamma function

-
At least at first glance, the second integral seems quite complicated, considering the expressions for the Log Gamma Function (see, for example, mathworld.wolfram.com/LogGammaFunction.html). –  Shai Covo Feb 10 '11 at 3:42

First integral. $X$ has density function $$f(x;\alpha ,\beta ) = \frac{{\beta ^\alpha }}{{\Gamma (\alpha )}}x^{\alpha - 1} e^{ - \beta x},\;\; x > 0,$$ with $\alpha,\beta > 0$ fixed. It follows readily from $$\Gamma '(\alpha ) = \int_0^\infty {x^{\alpha - 1} e^{ - x} \ln x\,{\rm d}x}$$ and $$\Gamma '(\alpha ) = \Gamma (\alpha )\psi _0 (\alpha ),$$ where $\psi_0$ is the digamma function, that $${\rm E}[X\ln X] = \frac{{\beta ^\alpha }}{{\Gamma (\alpha )}}\int_0^\infty {(x\ln x)x^{\alpha - 1} e^{ - \beta x} dx} = \frac{\alpha }{\beta }[\psi_0 (\alpha + 1) - \ln \beta ].$$

EDIT: Elaborating (in response to the OP's request).

First, you can find here the above formulas for $\Gamma'(\alpha)$. Now, using a change of variable, we have $$\Gamma'(\alpha+1) = \int_0^\infty {\beta ^{\alpha+1} x^{\alpha} e^{ - \beta x} \ln (\beta x)\,{\rm d}x} = \ln \beta \int_0^\infty {\beta ^{\alpha+1} x^{\alpha} e^{ - \beta x} \,{\rm d}x} + \int_0^\infty { \beta ^{\alpha+1} x^{\alpha} e^{ - \beta x} \ln x\,{\rm d}x}.$$ The first integral on the right-hand side is equal to $\Gamma(\alpha+1)\ln \beta$, and the second integral to $\Gamma(\alpha)\beta {\rm E}[X\ln X]$. It thus follows that $$\Gamma (\alpha + 1)\psi _0 (\alpha + 1) = \Gamma (\alpha + 1)\ln \beta + \Gamma (\alpha )\beta {\rm E}[X\ln X].$$ Finally, by $\Gamma(\alpha+1)=\alpha \Gamma(\alpha)$, we get $${\rm E}[X\ln X] = \frac{\alpha }{\beta }[\psi_0 (\alpha + 1) - \ln \beta ].$$

-
Thank you very much! Can you give a hint, how you came to you solution? For me this is not clear... Do you have an idea about the other integral? –  Matthias Feb 9 '11 at 14:30