Find the joint density of $\min(X,Y)$ and $X-Y$ using bivariate transform Assume $X$ and $Y$ are independent exponential random variable, where $X\sim \lambda_1 e^{-\lambda_1 x}$ and $Y\sim \lambda_2 e^{-\lambda_2 y}$. How would one use bivariate transform to find the joint density of $S: =\min\left(X,Y\right)$ and $T:= X-Y$?
If we consider the mapping $g:\left(X,Y\right) \to \left(S ,T\right)$, then on $A_1 = \{(x,y): x > y\}$ and $A_2 = \{(x,y): y > x\}$, we can find inverse of $g$. However, $g$ maps $A_1$ to the first quadrant of $(s,t)$ plane, and maps $A_2$ to the fourth quadrant of $(s,t)$. How should I proceed? My textbook only discusses when $g$ maps $A_1,\cdots,A_n$ onto the same $B$. For your reference, here is the excerpt

 A: One can follow the usual routine procedure of change of variables.
Due to independence, joint density of $(X,Y)$ is given by $$f_{X,Y}(x,y)=\lambda_1\lambda_2 e^{-(\lambda_1x+\lambda_2y)}\mathbf1_{x>0,y>0}\qquad,\,\lambda_1,\lambda_2>0$$
We transform $(X,Y)\to(S,T)$ where $S=\min(X,Y)$ and $T=X-Y$.
Consider the two cases $x>y$ and $x\leqslant y$ separately. Being a linear transformation, for each of the cases, absolute value of the Jacobian ($J_i$) of transformation turns out to be unity.
Thus we obtain the joint density of $(S,T)$, given by
\begin{align}
f_{S,T}(s,t)&=f_{X,Y}(s,s-t)\left|J_1\right|\mathbf1_{t<0,s>0}+f_{X,Y}(s+t,s)\left|J_2\right|\mathbf1_{t>0,s>0}
\\\\&=\lambda_1\lambda_2e^{-(\lambda_1+\lambda_2)s}e^{\lambda_2t}\mathbf1_{t<0,s>0}+\lambda_1\lambda_2e^{-(\lambda_1+\lambda_2)s}e^{-\lambda_1t}\mathbf1_{t>0,s>0}
\\\\&=\lambda_1\lambda_2e^{-(\lambda_1+\lambda_2)s}\mathbf1_{s>0}\left(e^{\lambda_2t}\mathbf1_{t<0}+e^{-\lambda_1t}\mathbf1_{t>0}\right)
\\\\&=(\lambda_1+\lambda_2)e^{-(\lambda_1+\lambda_2)s}\mathbf1_{s>0}\,\frac{\lambda_1\lambda_2}{\lambda_1+\lambda_2}\left(e^{\lambda_2t}\mathbf1_{t<0}+e^{-\lambda_1t}\mathbf1_{t>0}\right)
\\\\&=f_{S}(s)f_{T}(t)
\end{align}
This shows the independence of $S$ and $T$, where $S$ in particular has an Exponential distribution with rate $\lambda_1+\lambda_2$. Had $\lambda_1$ been equal to $\lambda_2$ (i.e. if $X$ and $Y$ were i.i.d), then $T$ would have had a Laplace distribution.
It is interesting to note that this problem is related to a certain characterization of the Exponential distribution, namely the independence of $\min(X,Y)$ and $X-Y$ for two absolutely continuous random variables $X$ and $Y$ iff $X$ and $Y$ are independent Exponential random variables with the same location parameter. 
