Consider iid random varibales $(X_i)_{1\le i\le n}$ with $X_i\sim Exp(\theta)$ for $1\le i\le n$ and $\theta\in(0,\infty)$. Then we have $$\sum_{i=1}^nX_i\sim \Gamma(n,\theta)$$ with density function
$$f(x)=\frac{\theta^n}{(n-1)!}x^{n-1}e^{-\theta x}\mathbb{1}_{[0,\infty)}(x).$$
Now I want to calculate
\begin{align}E\Bigg[\frac{1}{\frac{1}{n}\sum_{i=1}^nX_i}\Bigg]=n\cdot E\Bigg[\frac{1}{\sum_{i=1}^nX_i}\Bigg]&=n\cdot\int_{0}^\infty \frac{1}{x}\frac{\theta^n}{(n-1)!}x^{n-1}e^{-\theta x} dx\\ &=\frac{n\theta^n}{(n-1)!}\cdot\int_{0}^\infty x^{n-2}e^{-\theta x} dx,\end{align}
but I do not know where I have to go from here.
I know the antiderivate of $x^{n-2}e^{-x}$, but I do not know how to deal with $x^{n-2}e^{-\theta x}$. Can someone give me a hint?
Thanks in advance!
Use the fact that $$\int_0^\infty x^m e^{-ax}\,dx=\frac{\Gamma(m+1)}{a^{m+1}}$$ In your case, you would get \begin{align}\frac{n\theta^n}{(n-1)!}\int_0^\infty x^{n-2} e^{-\theta x}\,dx& =\frac{n\theta^n}{(n-1)!}\frac{\Gamma(n-1)}{\theta^{n-1}} \\ &= \frac{n\theta}{(n-1)!}(n-2)! \\ &= \frac{n\theta}{n-1} \end{align}