MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).

## Calculate conditional expectation of log(x) with gamma density

How to calculate the following expression:

$$\int_0^u{\ln(x)x^{k-1}e^{-x}}\;dx$$

As I know,

$$\int_0^\infty{\ln(x)x^{k-1}e^{-x}}dx = \Gamma(k)\Psi(k)$$

Are there any way to transfer the integral as expression by digamma, gammaln functions?

Or, are there any fast but also precise enough way to evaluate the integral? Thanks. Matlab's numerical integration directly is not so fast, but if there is a relation with the built in functions such as psi, gammaln, then that'll meet the need.

-
 Do you want the integral over $x \in [0,u]$ or $x \in [0,\infty)$? L.Silberman's answer addresses the latter. – Noam D. Elkies Nov 28 2011 at 15:47 Yes, and probably "Psi" is matlab's name for the logarithmic derivative. I withdraw my answer. The expectation in question is instead the logarithmic derivative of the incomplete gamma function. I think most programs have a built-in for that, so perhaps one thing to try is numerical differentiation of the incomplete gamma function? – Lior Silberman Nov 28 2011 at 17:28 Thanks for your comments, that's still a numerical way, no better than direct solving numerical integral. Ideally, I am looking for an explicit relation with the so called incomplete gamma function(in matlab: gammainc), or other matlab built-in functions such as (psi,gamma,gammaln,etc). Numerical methods whether differentiation w.r.t k of the incomplete gamma or just integration directly are considered just as an alternative then if there are no explicit relations. – unknown (google) Nov 29 2011 at 10:49