= Solution
<Independence> means $\Pr(X\in A,Y\in B)=\Pr(X\in A)\Pr(Y\in B)$ for all <Borel sets> $A,B$. For variables with a <joint density> this is equivalent to factorization of that density into the two marginal densities <almost everywhere>.
The inverse transformation is $x=uv$, $y=(1-u)v$, on $0<u<1$, $v>0$. Its absolute <Jacobian determinant> is $v$. Multiplying the independent gamma densities by it gives
$$
f_{U,V}(u,v)=\frac{\lambda^{\alpha+\beta}}{\Gamma(\alpha)\Gamma(\beta)}
u^{\alpha-1}(1-u)^{\beta-1}v^{\alpha+\beta-1}e^{-\lambda v}.
$$
The density is zero outside that <support>. Integrating in $v$ with the <gamma integral> gives
$$
\boxed{f_U(u)=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}
u^{\alpha-1}(1-u)^{\beta-1},\quad0<u<1.}
$$
It is a beta density. Its normalization also proves the <beta integral> $\int_0^1u^{\alpha-1}(1-u)^{\beta-1}du=\Gamma(\alpha)\Gamma(\beta)/\Gamma(\alpha+\beta)$. The <joint density> consequently factors as this normalized beta density times
$$
\boxed{f_V(v)=\frac{\lambda^{\alpha+\beta}}{\Gamma(\alpha+\beta)}v^{\alpha+\beta-1}e^{-\lambda v},\quad v>0.}
$$
Thus $V$ is gamma with shape $\alpha+\beta$ and rate $\lambda$, and $U,V$ are independent.
Finally $X=UV$. All relevant first moments are finite, and <independence> gives $\mathbb E X=\mathbb E U\,\mathbb E V$, while $\mathbb E V=\mathbb E X+\mathbb E Y>0$. Hence
$$
\boxed{\mathbb E\frac X{X+Y}=\frac{\mathbb E X}{\mathbb E X+\mathbb E Y}=\frac\alpha{\alpha+\beta}.}
$$
This identity follows from the particular <beta-gamma independence> here; a general ratio of <random variables> would not permit moving <expectation> through division.
Back to article page