Let $(X_1,X_2,\ldots,X_n)$ be iid, such that each $X_i$ has the uniform distribution on the interval $(a,b)$. Calculate $Cov(\min(X_1,\ldots,X_n),\max(X_1,\ldots,X_n))$.
The task seems very hard to me. So far I calculated $E(\min(X_1,\ldots,X_n))=\frac{an+b}{n+1}$, $E(\max(X_1,\ldots,X_n))=\frac{bn+a}{n+1}$. I also found the joint density of $(\min(X_1,\ldots,X_n),\max(X_1,\ldots,X_n))$ - it is as follows: $$f(x,y)=\left\{ \begin{array}{ll} \frac{n!}{\left( n-2\right) !}\frac{\left(y-x\right)^{n-2}}{\left(b-a\right)^{n}} & \text{ if }a\leq x\leq y\leq b \\ 0 & \text{in other cases.}% \end{array}% \right. $$ So now the task is to calculate $E(\min(X_1,\ldots,X_n)\cdot\max(X_1,\ldots,X_n))$. How to do this effectively?