I have a homework problem I've been working on for hours and can't seem to solve. Please help.

Let X and Y be two independent but similarly distributed variables with uniform distribution:

f(x) = 1 , when 0<x<1

= 0 , otherwise

Let U = min(X,Y) and V = max(X,Y).

Find the marginal densities for U and V, and then find the joint density for U and V.

I am having a lot of trouble doing this. I don't know what bounds to set for the integral. I am also used to finding marginal densities by integrating over the joint density. Here you do not have the joint density for U and V, so I don't know how I am supposed to get the marginals first.

Thanks for your help