Suppose that $X$ and $Y$ are jointly continuous random variables such that $X\sim U(0,1)$ and $f_{Y\mid X}(y\mid x) = 1$ where $ x < y < x+ 1$.
Find $\operatorname{Cov}(X,Y)$.
For this question, I started by finding $E[X]$.
$E[X] = [ \int_{0}^{1} x \,dx] =1$.
Now, I am stuck on how to find $E[Y]$.
$E[Y] = [ \int_{x}^{x+1} y \,dy]$
Obviously, this integral won't give me a constant value. Is there something else I should consider for the bounds of $E[Y]$?
I was also thinking of using the formula of $E[Y] = E[E[Y\mid X]]$. Which I think would also be:
$E[Y\mid X] = [ \int_{x}^{x+1} y \,dy]$
But I'm not entirely sure if this is correct either.
First of all it should be $$E[X] = \int_0^1 x \: dx = \frac{1}{2}.$$ You are correct that $E[Y]$ should not depend on $x$ so the formula $E[Y] = \int_x^{x+1} y \: dy$ is wrong. However the expression $\int_x^{x+1} y \: dy$ is useful, as it is the conditional expectation of $Y$ when the value $X=x$ is known. That is $$E[Y \: | \: X=x] = \int_x^{x+1}y \: dy = \frac{1}{2}((x+1)^2 - x^2)$$ This gives us that $$E[Y\:|\: X] = \frac{1}{2}((X+1)^2 - X^2) = \frac{1}{2} + X$$ Finally you can use the law total expectation to compute $$E[Y] = E[E[Y|X]] = E[\frac{1}{2} + X] = 1$$ To compute the covariance you would need to also compute $E[YX]$, which can be done using the same method (that is by first considering the conditional expectation $E[XY|X=x]$), but it can also be done directly using $$E[XY] = \int_0^1 \int_x^{x+1} xy \: dy \: dx.$$