Çinlar's Probability and Stochastic, Examples 2.11 and 2.12
- The blue highlight is just using the fact that if $X$ and $Y$ are independent with respective densities $f_X(x),f_Y(y),$ then by LOTUS,
$$E[g(X,Y)]=\int_\mathbb{R_+}\int_\mathbb{R_+}g(x,y)f_X(x)f_Y(y)dydx\\ =\int_\mathbb{R_+}f_X(x)\int_\mathbb{R_+}g(x,y)f_Y(y)dydx.$$
Yours is the case where $g(X,Y)=f(X+Y,\frac{X}{X+Y})$ for a positive Borel function $f$ on $\mathbb{R_+}\times [0,1],$ and $f_X,f_Y$ are standard gamma densities.
- As for the green highlight, not sure exactly how the author meant to tie it into Example 2.11 (is there an equation also labelled 2.11?). I guess one way to tie it in is by using $f(u,v)=e^{-ruv}$ since the integral in Example 2.11 would then be computing $E[e^{-rX}]$ as desired (at least for standard gamma $X$). But you can also get their result by using the MGF of a gamma random variable.