If $X_1,X_2,X_3$ iid $\sim Exp(\lambda)$, find joint density of $X_{(3)}-X_{(2)}$ and $X_{(2)}$
$X_{(k)}$ is the $k$-th smallest random variable in $\{X_1,X_2,X_3\}$
Here's what I did. Consider $S(x,y)=(x-y,y)$, then, by Jacobian theorem, $f_{X-Y,Y}(u,v) = 1.f_{X,Y}(u+v,v) = f_{X}(u+v)f_{Y}(v)$, then:
$f_{X-Y}(u) = \int_{0}^{\infty}f_{X}(u+v)f_{Y}(v)dv$
$X_{3}=\max\{X_1,X_2,X_3\}$, then
$f_{X_{(3)}}(u+v) = 3(1-e^{-\lambda(u+v)})^2 \lambda e^{-\lambda(u+v)}$
$f_{X_{(2)}}(v) = 6(1-e^{-\lambda v})e^{-\lambda v} \lambda e^{-\lambda v}$
(These two I already saw in class)
Then $f_{X_{(3)}-X_{(2)}} (u) = \int_{0}^{\infty} 3(1-e^{-\lambda (u+v)})^2 \lambda e^{-\lambda (u+v)} 6 (1-\lambda v) \lambda e^{-2\lambda v} dv = ... = 18 \lambda^2 e^{- \lambda u} \Big( \frac{1}{3 \lambda} - \frac{1}{4 \lambda} -2\frac{e^{-\lambda u}}{4 \lambda} + 2\frac{e^{-\lambda u}}{5 \lambda} + \frac{e^{-2 \lambda u}}{5 \lambda} - \frac{e^{-2 \lambda u}}{6 \lambda}\Big)$
Then, if my calculations are correct, I have $f_{X_{(3)} - X_{(2)}}$ and $f_{X_{(2)}}$, but how do I find then the joint density? I can't use that they're independent, because that's what I'm supposed to conclude.
Thanks.
Let $f(x)$ and $F(x)$ denote the population pdf and cdf respectively.
Start with the joint density of $X_{(2)}$ and $X_{(3)}$, given by
$$f_{2,3}(x,y)=6F(x)f(x)f(y)\mathbf1_{0<x<y}=6\lambda^2(1-e^{-\lambda x})e^{-\lambda(x+y)}\mathbf1_{0<x<y}$$
Transform $(X,Y)\to(U,V)$ such that $U=X_{(3)}-X_{(2)}$ and $V=X_{(2)}$.
You should end up with the joint density of $(U,V)$ given by
$$f_{U,V}(u,v)=6\lambda^2 e^{-\lambda u}e^{-2\lambda v}(1-e^{-\lambda v})\mathbf1_{u,v>0}$$
Nothing special about this routine work. Now you would be able to factor out the joint density as the product of two marginals to conclude independence of $U$ and $V$. Interestingly, this is a general result involving independence of consecutive spacings derived from the order statistics of a random sample from an exponential population. Here is a relevant post on CV.