How to get $E[\frac{Y}{X+Y}]$? Suppose that $X \sim Gamma(\alpha_1, \beta)$ and $Y \sim Gamma(\alpha_2, \beta)$, $\alpha_1, \alpha_2>0$, $\alpha_1\neq \alpha_2$. Assume that $X$
and $Y$ are independent of each other. How to get $E[\frac{Y}{X+Y}]$?

I am not sure if there is simple way to get this expectation without using definition. I know that
$$
E[\frac{Y}{X+Y}]=\int\int \frac{y}{x+y}f(x, y)dxdy
$$
but this one is hard to compute...
Is it possible to compute the joint MGF and then get $E[X/(X+Y)]$?
 A: \begin{align}
\mathbb{E}\left[\frac{Y}{X+Y}\right]
&=\frac{\beta^{\alpha_1+\alpha_2}}{\Gamma(\alpha_1)\Gamma(\alpha_2)}\iint_{\mathbb{R}_+^2}\frac{x^{\alpha_1-1}y^{\alpha_2}}{x+y}e^{-\beta(x+y)}\,dx\,dy
\\&=\frac{\beta^{\alpha_1+\alpha_2}}{\Gamma(\alpha_1)\Gamma(\alpha_2)}\iint_{\mathbb{R}_+^2}x^{\alpha_1-1}y^{\alpha_2}\int_\beta^\infty e^{-z(x+y)}\,dz\,dx\,dy
\\&=\frac{\beta^{\alpha_1+\alpha_2}}{\Gamma(\alpha_1)\Gamma(\alpha_2)}\int_\beta^\infty\left(\int_0^\infty x^{\alpha_1-1}e^{-zx}\,dx\right)\left(\int_0^\infty y^{\alpha_2}e^{-zy}\,dy\right)\,dz
\\&=\alpha_2\beta^{\alpha_1+\alpha_2}\int_\beta^\infty z^{-\alpha_1-\alpha_2-1}\,dz=\frac{\alpha_2}{\alpha_1+\alpha_2}.
\end{align}
A: Besides the standard approach as in metamorphy's answer, here are some exotic methods:

Method 1. Noting the MGF of the gamma distribution and using the independence, we get
$$ \mathbf{E}[e^{-sX - tY}]
= \mathbf{E}[e^{-sX}]\mathbf{E}[e^{-tY}]
= \frac{1}{(1+s/\beta)^{\alpha_1}(1+t/\beta)^{\alpha_2}}. $$
Differentiating both sides with respect to $t$, we get
$$ \mathbf{E}[Y e^{-sX - tY}] = \frac{\alpha_2/\beta}{(1+s/\beta)^{\alpha_1}(1+t/\beta)^{\alpha_2+1}}. $$
Plugging $s = t$ and then integrating both sides with respect to $t$ over $(0, \infty)$, the left-hand side is
$$ \int_{0}^{\infty} \mathbf{E}[Y e^{-t(X+Y)}] \, \mathrm{d}t
= \mathbf{E}\left[Y \int_{0}^{\infty} e^{-t(X+Y)} \, \mathrm{d}t \right]
= \mathbf{E}\left[ \frac{Y}{X+Y} \right], $$
whereas the right-hand side becomes
$$ \int_{0}^{\infty} \frac{\alpha_2/\beta}{(1+t/\beta)^{\alpha_1+\alpha_2+1}} \, \mathrm{d}t
= \left[ -\frac{\alpha_2}{\alpha_1 + \alpha_2} \cdot \frac{1}{(1+t/\beta)^{\alpha_1+\alpha_2}} \right]_{0}^{\infty}
= \frac{\alpha_2}{\alpha_1+\alpha_2}. $$
Therefore we conclude that $\mathbf{E}\left[ \frac{Y}{X+Y} \right] = \frac{\alpha_2}{\alpha_1+\alpha_2}$.

Method 2. If $\alpha_1$ and $\alpha_2$ are positive integers, we may proceed as follows:
We realize the joint distribution of $(X, Y)$ using the Poisson point process $N = (N_t)_{t\geq 0}$ of rate $\beta$. Indeed, let

*

*$X$ be the $\alpha_1$th arrival time, and

*$Y$ be the $\alpha_2$th arrival measured from right after the $\alpha_1$th arrival has occurred.

In particular, $X+Y$ is the $(\alpha_1+\alpha_2)$th arrival time of $N$. Then $(X, Y)$ has the desired joint distribution, and moreover, we know that the first $\alpha_1+\alpha_2-1$ Poisson points, given that $X+Y = s$, is identically distributed as the order statistic of $\alpha_1+\alpha_2-1$ i.i.d. uniform points on the interval $[0, s]$. Consequently,
$$ \frac{X}{X+Y} \sim (\text{$\alpha_1$th order statistic of $\alpha_1+\alpha_2-1$ i.i.d. uniform r.v.s in $[0,1]$}) $$
and this allows to quickly conclude
$$ \mathbf{E}\left[\frac{X}{X+Y}\right] = \frac{\alpha_1}{\alpha_1 + \alpha_2}, \qquad \mathbf{E}\left[\frac{Y}{X+Y}\right] = \frac{\alpha_2}{\alpha_1 + \alpha_2}. $$
