Posterior mean of densities of a given sequence Suppose a DNA sequence y with the nucleotide probabilities 
$$p = \left\{ p_x\right\}$$
which follows a Dirichlet distribution
Show that the posterior mean of densities 
$$E\left\{ p_x\right\} = \frac{n_x + \beta_n}{\sum n_x + \sum \beta_n}$$
So I tried to do the integration to get the expected value of $p_x$
$$E\left\{ p_x\right\} = \int p_x f(p|y)dp_x$$
which leads me to 
$$E\left\{ p_x\right\} = \int p_x \frac{1}{Z}\prod_{x}p_x^\left(n_x+\beta_x-1\right)dp_x$$
$$E\left\{ p_x\right\} = \int \frac{1}{Z}\prod_{x}p_x^\left(n_x+\beta_x\right)dp_x$$
$$E\left\{ p_x\right\} = \frac{1}{Z}\int \prod_{x}p_x^\left(n_x+\beta_x\right)dp_x$$
And here is where I got trouble with.  I searched online on how to integrate products and most of them say it is not possible to do so. 
So I would like to ask how should I proceed from here?
 A: Your notation here is ambiguous - I've made some assumptions about what you're trying to say in my answer.
I assume that you mean there a finite number of possible nucleotides at each observation (let's call them $x_1, \ldots, x_K$), each nucleotide $x_i$ has an (unknown) probability $p_i$ of being observed at each site, and the prior on the vector of probabilities $(p_1,\ldots, p_K)$ is $\mathrm{Dirichlet}(\beta_1, \ldots, \beta_K)$.
If we then assume $N$ independent nucleotide observations, which each follow a multinomial distribution with parameter $(p_1, \ldots, p_K)$, we obtain an expression for the posterior distribution on the vector $(p_1, \ldots, p_K)$. The posterior distribution can be shown to be $\mathrm{Dirichlet}(\beta_1 + n_1, \ldots, \beta_K + n_K)$, where $n_i$ is the number of times nucleotide $x_i$ was observed.
To calculate the expected value of $p_i$ under the posterior distribution, we need to evaluate
$\frac{\Gamma(\sum_{k=1}^K(\beta_k + n_k))}{\prod_{k=1}^K \Gamma(\beta_k + n_k)}\int_{\Sigma^K} p_i \prod_{k=1}^K p_k^{\beta_k + n_k -1}  dp_k$
where $\Sigma_K$ is the probability simplex $\Sigma_K =\{ (p_1,\ldots, p_k) | p_k \geq 0 \forall k\, , \sum_{k=1}^K p_k = 1\}$.
Notice that the integrand is actually the unnormalised density of another Dirichlet distribution with parameter $(\beta_1 + n^\prime_1, \ldots, \beta_K + n^\prime_K)$, where $n^\prime_k = n_k$ for all $k \not= i$, and $n^\prime_i = n_i + 1$. Therefore we can recognise the value of this integral as the value of the corresponding normalising constant for this density, meaning that the overall expectation has value
$\frac{\Gamma(\sum_{k=1}^K(\beta_k + n_k))}{\prod_{k=1}^K \Gamma(\beta_k + n_k)} \times \frac{\prod_{k=1}^K \Gamma(\beta_k + n^\prime_k)}{\Gamma(\sum_{k=1}^K(\beta_k + n^\prime_k))}$
You can now use the relationship between the $n_k$ and the $n^\prime_k$ and the definition of the Gamma function to get to the answer.
