How is the generalised Beta function defined I've been reading about the Dirichlet distribution and have become somewhat confused as to how to evaluate its normalisation term.
Specifically, I'm quite happy with the relationship between the beta and gamma functions: 
$\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}=B(x,y)$, but wikipedia then claims that more generally: 
$\frac{\prod_{i}\Gamma(x_{i})}{\Gamma(\sum_{i}x_{i})}=B(x_{1},x_{2},\ldots, x_{n})$
Sticking with three variables for simplicity, how is $B(x_{1},x_{2},x_{3})$ defined? 
Using the above relation for 2 parameters:
$\Gamma(x)\Gamma(y)=\Gamma(x+y)B(x,y)$, hence
$\Gamma(x)\Gamma(y)\Gamma(z)=\Gamma(x+y)B(x,y)\Gamma(z)$, which, with repeated application of the above becomes:
$\Gamma(x)\Gamma(y)\Gamma(z)=B(x,y)B(x+y,z)\Gamma(x+y+z)$
This suggests, using formula on wikipedia for three variables, that:
$B(x,y,z)=B(x,y)B(x+y,z)$
I wrote the RHS of this out and played about with some substitutions, but couldn't show it to equal what I would expect, which is something of the form:
$\int_{0}^{1}dq \cdot q^{x-1}\int_{0}^{1-q}dp \cdot p^{y-1}(1-p-q)^{z-1}$
I expected something of the above form, because it seems like that would normalise the Dirichlet distribution.
More generally, is there a nice trick for evaluating nested normalisation terms of the form: 
$\int_{0}^{1}p_{1}^{\alpha _{1}}dp_{1}\int_{0}^{1-p_{1}}p_{2}^{\alpha _{2}}dp _{2}\int_{0}^{1-p_{1}-p_{2}}p_{3}^{\alpha_{3}}dp_{3}\ldots \int_{0}^{1-\sum _{i=1}^{n-2}p_{i}}p_{n-1}^{\alpha _{n-1}}dp_{n-1}(1-\sum _{i=1}^{n-1}p_{i})^{\alpha _{n}}$
I'm hoping that the way to solve this for n=3 generalises in some fairly simple way? 
Or, alternatively, is the above integral not the correct normalisation term for an N variable Dirichlet Distribution?
 A: The Definition of the Dirichlet distribution is $f(x_1,...,x_K;\alpha_1,...,\alpha_K)=\frac{1}{C_K(\alpha)}\prod_{i=1}^Kx_i^{\alpha_i-1}$, where $x_i$ live on a  $K-1$ simplex. So, by definition
$$C_K(\alpha)=\int_{simplex}\prod_{i=1}^Kx_i^{\alpha_i-1}dx_1\cdots dx_k.$$
What follows is a proof-sketch. One way of evaluating this integral is to evaluate a more general integral on $x_1+\cdots+x_{K}=t$ with $x_i\geq 0$. By dividing through by $t$, we get a re-parametrization $u_i=x_i/t$ which places us back on the simplex. In other words define:
$$C_k(\alpha,t):=t^{\alpha_1+\cdots+\alpha_k}\int_{simplex}\prod_{i=1}^{k}u_i^{\alpha_i-1}du_1\cdots du_k$$
Then:
\begin{align*}
C_K(\alpha)&=\int_0^1C_{K-1}(\alpha,x)(1-x)^{\alpha_K-1}dx=C_{K-1}(\alpha)B(\alpha_1+\cdots+\alpha_{K-1},\alpha_K)\\
&=C_{K-1}(\alpha)\frac{\Gamma(\alpha_1+\cdots+\alpha_{K-1})\Gamma(\alpha_K)}{\Gamma(\alpha_1+\cdots+\alpha_K)}.
\end{align*}
All we've done is "shell" the simplex of $x_1+\cdots+x_K=1$ by supposing that $x_1+\cdots+x_{K-1}=t$ and $x_K=1-t$.
So,
$$C_K(\alpha)=\frac{C_{K}(\alpha)}{C_{K-1}(\alpha)}\frac{C_{K-1}(\alpha)}{C_{K-2}(\alpha)}\cdots \frac{C_3(\alpha)}{C_2(\alpha)}C_2(\alpha).$$
Note that you'll have to evaluate $C_2(\alpha)$ by hand to get the base case usual beta function. This cancels the long gamma factors in the numerators and gives:
$$C_K(\alpha)=\frac{\prod_{i=1}^K\Gamma(\alpha_i)}{\Gamma(\sum_{i=1}^n\alpha_i)}$$
A: A colleague of mine has suggested the following solution:
The Dirichlet Distribution with N variables should be normalised by the following:
$\int_{0}^{\infty}d p_{1} (p_{1}^{x_{1}-1})\int_{0}^{\infty}d p_{2} (p_{2}^{x_{2}-1})\ldots \int_{0}^{\infty}d p_{N} (p_{N}^{x_{N}-1})\delta(1-\sum_{i} p_{i})$
In which $\delta(x)$ is the Dirac delta function. Note that as long as we restrict these integrals over a positive interval, we can extend them to $+\infty$ due to the $\delta$ function.
If we define the multi-variate beta-function to be the normalisation term of the Dirichlet distribution, then to prove the recursion relationship which is stated as its definition on wikipedia (and in effect, derive a more easy to evaluate form of the normalisation term), then we want to prove:
$\Gamma(\sum_{i} x_{i})\int_{0}^{\infty}d p_{1} (p_{1}^{x_{1}-1})\int_{0}^{\infty}d p_{2} (p_{2}^{x_{2}-1})\ldots \int_{0}^{\infty}d p_{N} (p_{N}^{x_{N}-1})\delta(1-\sum_{i} p_{i})= \prod _{i} \Gamma (x_{i})$
If we expand the gamma function on the LHS, and write the product as a "double" (in reality N+1) integral, the LHS = 
$\int _{0}^{\infty}dzdp_{1}dp_{2}\ldots dp_{N}\hspace{3mm} e^{-z}\cdot z^{\sum_{i} x_{i} -1} \cdot p_{1}^{x_{1}-1}\ldots p_{N}^{X_{N}-1}\delta (1-\sum_{i}p_{1})$
Very similarly to Alex R's response above, we now perform the change of variables $(p_{1}, p_{2},\ldots, p_{n}, z) \to (u_{1}, u_{2},\ldots, u_{n}, y) $ using the transformation $p_{i}=\frac{u_{i}}{y}, z=y$
This results in a transformation Jacobian of $\frac{1}{y^{N}}$, and the limits of integration all remain $0 \to \infty$. Consequently, our multiple integral can be written as:
$\int _{0}^{\infty}du_{1}\ldots du_{N}dy \hspace{2mm}(\frac{1}{y^{N}})(\frac{u_{1}}{y})^{x_{1}-1}(\frac{u_{2}}{y})^{x_{2}-1}  \ldots (\frac{u_{N}}{y})^{x_{N}-1}\delta(1-\sum_{i}\frac{u_{i}}{y})y^{\sum_{i}x_{i} -1}e^{-y}  $
By writing the delta function as $y\cdot \delta (y- \sum_{i}u_{i})$, we can make all of the factors of y cancel, meaning we only need to evaluate the integral
$\int _{0}^{\infty}du_{1}\ldots du_{N}dy\hspace{2mm}u_{1}^{x_{1}-1}u_{2}^{x_{2}-1}\ldots u_{N}^{X_{N}-1}e^{-y}\delta(y-\sum_{i}u_{i})$
which after integrating against the delta function, does indeed give us
$\int_{0}^{\infty} du_{1}du_{2}\ldots du_{N}\hspace{2mm} u_{1}^{x_{1}-1}u_{2}^{x_{2}-1}\ldots u_{N}^{x_{N}-1}e^{-\sum_{i}u_{i}}=\prod_{i} \Gamma(x_{i})$
and hence the term which normalises the Dirichlet distribution is indeed equal to 
$\frac{\prod _{i}\Gamma(x_{i})}{\Gamma(\sum_{i}x_{i})}$
