I would like to rewrite the following integral in terms of the (incomplete) Gamma function:
$$\int_r^\infty (x-r)^2f(x;k,\theta)\,dx$$
where $f(x;k,\theta)$ is the Gamma probability density function for $x>0$ and $k,\,\theta>0$.
I can rewrite this to
$$\int_r^\infty x^2 f(x;k,\theta) \, dx-2\int_r^\infty x f(x;k,\theta) \, dx+r^2\int_r^\infty f(x;k,\theta) \, dx$$
But this is as far as I currently get.
Can somebody help me out? Thanks!
Edit:
I found out that
$$r^2\int_r^\infty f(x;k,\theta) \, dx \, = \,r^2\big(1-F(x;k,\theta) \big)\,=\,r^2\bigg(1-\frac{\gamma(x;k,\theta)}{\Gamma(k)}\bigg)$$
But what about the other terms? Thanks!
You can express
$$\int_r^\infty (x-r)^2f(x;k,\theta)\,dx$$
as:
$$r^2\left[1-F(r, k, \theta)\right]-\frac{2rk}{\theta}\left[1-F(r, k+1, \theta)\right] + \frac{k(k+1)}{\theta^2 }\left[1-F(r, k+2, \theta)\right]$$
, where $F(.)$ is the cdf of the Gamma distribution which can be expressed with the Gamma function.