Given $\{X_1 , X_2, ... X_n\}$ are random samples from $\text{Uniform}(0,1)$. what is CDF of $R=Y_n - Y_1$ where $Y_1$ and $Y_n$ are the smallest and largest order statistic of the sample respectively.
Define $k\geq 0$.
The joint p.d.f of ($Y_{1}, Y_{n} $) is given as :
$$g(y_1, y_n) = n(n-1)f(y_{1})f(y_n)\left(F(y_n)-F(y_1)\right)^{n-2} $$
\begin{align*} P(R \leq k) &= P(Y_n-Y_1 \leq k) \\ &= \iint\limits_{y_n-y_1 \leq k} g(y_1,y_n) \, dy_1 dy_n\\ &= \int_{-\infty}^{\infty} \int_{y_1}^{y_1 +k} g(y_1,y_n) \, dy_n dy_1\\ &= \int_{-\infty}^{\infty} \int_{y_1}^{y_1 +k} n(n-1)f(y_{1})f(y_n)\left(F(y_n)-F(y_1)\right)^{n-2} \, dy_n dy_1\\ &= n(n-1) \int_{-\infty}^{\infty} f(y_{1}) \int_{0}^{F(y_1+k)-F(y_1)} \phi^{n-2} \, d\phi \,dy_1\\ &= n(n-1) \int_{-\infty}^{\infty} f(y_{1}) \, \frac{\phi^{n-1}}{n-1} \bigg\vert_0^{F(y_1+k)-F(y_1)} \,dy_1\\ &=n\int_{-\infty}^{\infty} f(y_{1}) \, \phi^{n-1} \bigg\vert_0^{F(y_1+k)-F(y_1)} \,dy_1\\ &= n\int_{-\infty}^{\infty} f(y_{1}) \, [F(y_1+k)-F(y_1)]^{n-1} dy_1\\ &=n \int_{0}^{1} f(y_{1}) \, [F(y_1+k)-F(y_1)]^{n-1} dy_1 \end{align*}
I am not sure how to proceed further. In particular, the precise way to decide what the limits should be given $0<k<1$. I saw on other post that the next step is: $$n \int_0^{1-k} k^{} dy_1 + n \int_{1-k}^{1} (1-y_1)^{n-1} dy_1 $$
But I am not seeing the intuition for this. I tried doing $0<y_1 +k< 1$ then to compute the $F(y_1 +k)$ using the definition of uniform distribution. This works for the first part but the second part seems not obvious. It seems I am missing something. Any intuitive explanation or guide will be appreciated.