This is an example taken from Keener's Theoretical Statistics:
Suppose $X$ and $Y$ are independent with common density: $f_{\theta}(x) = \theta e^{-\theta x} 1_{\{x \geq 0\}}$, $U$ is uniformly distributed on $(0,1)$ independent of $X$ and $Y$. Then one can consider $T = X + Y, \tilde X = UT, \tilde Y = (1-U)T$ and compute $\frac{p(x+y, \frac{x}{x+y})}{x+y} = \theta^2e^{-\theta(x+y)}1_{\{x \geq 0, y\geq 0\}}$. He then claims that $\tilde X$, $\tilde Y$ and $X$, $Y$ have the same joint density. I am not sure why. Shouldn' we be computing $p(x, y)$ instead?
Let me change the variable here: let $u = x + y, v = \frac{x}{x+y}$, then $x = uv$, $y = u - uv$, then $p(u, v) = u \theta^2 e^{-\theta u}1_{\{u \geq 0, 1 \geq v \geq 0\}}$ which is not quite $f_{\theta}(x, y) = \theta e^{-\theta (x + y)}1_{\{x \geq 0, y \geq 0\}}$
What your textbook is claiming is that the vector $(X,Y)$ has the same joint density as the vector $[UT;(1-U)T]$ where $T=X+Y$
Let's see why:
As per the property of exponential distribution $T=X+Y\sim Gamma(2;\theta)$ so
$$f_T(t)=\theta^2 t e^{-\theta t}\mathbb{1}_{t \geq0}$$
Thus
$$f_{UT}(u,t)=\theta^2 t e^{-\theta t}\mathbb{1}_{(0;1)}(u)\mathbb{1}_{[0;\infty)}(t)$$
$$\begin{cases} ut=z \\ (1-u)t=v \end{cases} $$
$$\begin{cases} u=\frac{z}{v+z} \\ t=v+z \end{cases} $$
Calulate the jaocobian that is
$$|J|= |det\begin{bmatrix} \frac{\partial u}{\partial v} & \frac{\partial u}{\partial z} \\ \frac{\partial t}{\partial v} & \frac{\partial t}{\partial z} \\ \end{bmatrix}|=|det \begin{bmatrix} \frac{-z}{(v+z)^2} & \frac{v}{(v+z)^2} \\ 1 & 1 \\ \end{bmatrix}|=\frac{1}{v+z}$$
and with fundamental transformation theorem you immediately get
$$f_{ZV}(z,v)=\theta^2(v+z)e^{-\theta(v+z)}\frac{1}{v+z}=\theta^2e^{-\theta(v+z)}\mathbb{1}_{z,v \geq 0}$$
$$f_{XY}(x,y)=\theta^2e^{-\theta(x+y)}\mathbb{1}_{x,y \geq 0}$$
...now the claim is proved.