Random vector with uniform distribution. Let $(X,Y)$ be a random vector with uniform distribution at $0 \leq x \leq 1$, $x \leq y \leq x+h$ with $0<h<1$.
Find $E(X)$ and $E(XY)$.
What i did:
(1) Find densities:  
$f_X(x) = \left\{
     \begin{array}{lr}
       1 & : 0 \leq x \leq 1 \\
       0 & : otherwise
     \end{array}
   \right.$
$f_Y(y) = \left\{
     \begin{array}{lr}
       1/h & : x \leq y \leq x+h \\
       0 & : otherwise
     \end{array}
   \right.$
(2) Find expected values
$E(X) = \displaystyle\int_0^1xf_X(x)dx = \displaystyle\int_0^1xdx =1/2$
$E(XY) = \displaystyle\int_{-\infty}^{+\infty}\displaystyle\int_{-\infty}^{+\infty}xf_{X,Y}(x,y)dxdy$, this mean i should find $f_{XY}$ or there's another way to do it?. Because here i don't know how can i get $f_{XY}$, my first attempt was consider $f_{XY}= f_{X}f_{Y}$ but it's only true if $X$ and $Y$ are independent.
 A: Outline of Solution: We give two approaches, with the second significantly simpler than the first. 
We have  a constant density over a certain parallelogram. The corners are $(0,0)$, $(1,1)$, $(1,2)$, and $(0,1)$.
The density function of $X$ is right, it is uniform. The density function of $Y$ is not right. Even the shape is not right. The density function of $Y$ can only involve the variable $y$, you have to "integrate $x$ out. A look at the picture shows that $Y$ lives on the interval $[0,2]$, and that the densities near $y=0$ and $y=2$ are close to $0$. You can get the density of $Y$ either by integration or more easily by geometry. (First find the cdf. It will be a different formula for $y\lt 1$ than for $y\gt 1$).
To find the expectation of $XY$, we luckily don't need the distribution of $XY$. Note that our parallelogram has area $1$, so we just need to integrate $xy$ over the parallelogram.
Another way: Let $Z=Y-X$. Then $(X,Z)$ is uniform over the unit square. So to find the density of $Y$, you need the density of a sum of two uniforms. This may be a problem you have seen before. 
To find the expectation of $XY$, we need the expectation of $X(X+Z)$. The expectation of $X^2$ is easy, you know the density of $X$. The expectation of $XZ$ is also easy. Add.
