Find joint distribution of minimum and maximum of iid random variables
For a sequence of $n$ iid continuous samples, $(X_i)_{n=1}^n$, the minimum is less than $s$ and maximum less than $t$ iff all samples are less than $t$ and at least one is less than $s$.
$$\begin{split} \mathsf P(m\leqslant s, M\leqslant t) &=\mathsf P\Big(\big(\bigcup_{i=1}^n \{X_i\leqslant s\}\big)\cap\big(\bigcap_{i=1}^n\{X_i\leqslant t\}\big)\Big) \\&= \mathsf P\Big(\big(\bigcap_{i=1}^n\{X_i\leqslant t\}\big)\setminus\big(\bigcap_{i=1}^n\{s<X_i\}\big)\Big) \\ &= \mathsf P\big(\bigcap_{i=1}^n\{X_i\leqslant t\}\big)-\mathsf P\big(\bigcap_{i=1}^n\{s< X_i\leq t\}\big) \\ &= \prod_{i=1}^n\mathsf P\{X_i\leqslant t\}-\prod_{i=1}^n\mathsf P\{s<X_i\leqslant t\} \\ &= \big(\mathsf P\{X_i\leqslant t\}\big)^n-\big(\mathsf P\{s<X_i\leqslant t\}\big)^n \\ & =\begin{cases} 0 &:& s<0 ~\vee~ t<0 \\ t^n-(t-s)^n & :& 0\leqslant s\leqslant t< 1 \\ t^n &:& 0\leqslant t < \min (s,1) \\ 1-(1-s)^n &:& 0\leqslant s< 1\leqslant t \\ 1 &:& 1\leqslant s ~\wedge~ 1\leqslant t \end{cases} \\[2ex]f_{n,M}(s,t) &=\begin{cases} n(n-1)(t-s)^{n-2} & :& 0\leqslant s\leqslant t< 1 \\ 0 &:& \textsf{elsewhere} \end{cases} \end{split}$$