how to get posterior distribution of beta with gamma prior I have 
$X_1, ..., X_n \sim beta(\theta,1)$ and $\theta \sim gamma(r, \lambda)$ and wish to compute the posterior distribution. 
Since $f(\textbf{X} | \theta) = \theta^nx^{n(\theta-1)}$ and $\pi(\theta) = \frac{1}{\Gamma(r)\lambda^r}\theta^{r-1}e^{-\theta/\lambda}$, we get 
$f(\textbf{X} | \theta) \pi(\theta) = \theta^nx^{n(\theta-1)}\frac{1}{\Gamma(r)\lambda^r}\theta^{r-1}e^{-\theta/\lambda} = \frac{1}{\Gamma(r)\lambda^r}x^{n(\theta-1)}\theta^{n+r-1}e^{-\theta/\lambda} $
But I'm having trouble computing the marginal which is 
$$\int_0^\infty f(\textbf{X}|\theta)\pi(\theta)d\theta =\frac{1}{\Gamma(r)\lambda^r}\int_0^\infty x^{n(\theta-1)}\theta^{n+r-1}e^{-\theta/\lambda} d\theta$$
How do I do this integration? Is there a way I can conclude that posterior is gamma without doing the integration?
 A: You don't really have to do the integration!
Here's a detailed derivation.
Denote the pdf of the posterior distribution as $\pi(\theta|\textbf{X})$ and the marginal pdf of $\textbf{X}$ as $m(\textbf{X})$.
$$\pi(\theta|\textbf{X}) = \frac{f(\textbf{X}|\theta)\pi(\theta)}{m(\textbf{X})}$$
$$
\begin{aligned} 
m(\textbf{X}) 
&= \int_0^\infty f(\textbf{X}|\theta)\pi(\theta) d\theta  \\ 
&= \int_0^\infty \left[\theta^n\prod_i^nx_i^{\theta-1}\right] \frac{1}{\Gamma(r) \lambda^r} \theta^{r-1}e^{-\frac{\theta}{\lambda}} d\theta \\
&= \int_0^\infty \theta^n e^{{(\theta-1)}\sum_i^n \log x_i} \frac{1}{\Gamma(r) \lambda^r} \theta^{r-1}e^{-\frac{\theta}{\lambda}} d\theta \\
&= \frac{1}{\Gamma(r) \lambda^r} e^{-\sum_i^n \log x_i} \int_0^\infty \theta^{r + n - 1} e^{{-\theta}\left( \frac{1}{\lambda} -\sum_i^n \log x_i\right)} d\theta \\
&=\frac{1}{\Gamma(r) \lambda^r} e^{-\sum_i^n \log x_i} \int_0^\infty \theta^{r + n - 1} e^{\frac{-\theta}{\lambda_*}} d\theta \hspace{0.5cm}, \hspace{1cm} where \hspace{0.5cm}
 \lambda_* = \frac{1}{\left( \frac{1}{\lambda} -\sum_i^n \log x_i\right)} > 0\\
&= \frac{1}{\Gamma(r) \lambda^r} e^{-\sum_i^n \log x_i} \left[\Gamma(r+n)\right] \lambda_*^{r+n} \int_0^\infty \frac{1}{\left[\Gamma(r+n)\right] \lambda_*^{r+n}} \theta^{r + n - 1} e^{\frac{-\theta}{\lambda_*}} d\theta \\
&=\frac{1}{\Gamma(r) \lambda^r} e^{-\sum_i^n \log x_i} \left[\Gamma(r+n)\right] \lambda_*^{r+n}
\end{aligned}$$
You also have that:
$$f(\textbf{X}|\theta)\pi(\theta) = \frac{1}{\Gamma(r) \lambda^r} e^{-\sum_i^n \log x_i} \theta^{r + n - 1} e^{\frac{-\theta}{\lambda_*}}$$
Now take the ratio and you will get:
$$\pi(\theta|\textbf{X}) = \frac{1}{\left[\Gamma(r+n)\right] \lambda_*^{r+n}}\theta^{r + n - 1} e^{\frac{-\theta}{\lambda_*}} 1_{(0, \infty)}(\theta) \thicksim Gamma(r+n, \lambda_*)$$
