Conditional Expectation I am learning conditional expectation for fun. I cannot solve the following problem, I think it is just my vocabulary is limited. This problem came from a book on Stochastic Processes:
Let $\Omega = [0,1]\times [0,1]$ with the usual Lebesgue measure and $\sigma$-algebra of Borel sets. Let $X$ and $Y$ be random variables on $\Omega$ with joint density
$$ f_{X,Y}(x,y) = \left\{ \begin{array}{ccc} x+y & \text{ if }& x,y\in [0,1] \\ 0 & \text{ if }& \text{ otherwise} \end{array} \right. $$
Show that $\displaystyle E(X|Y) = \frac{2 + 3Y}{3 + 6Y}$. 
The part that I do not understand is in the solutions, the author begins by writing, 
$$ Y^{-1} (B) = [0,1] \times B $$
where $B$ is a Borel set in $[0,1]$. 
How can be possibly say that? There is no reason at all why $X$ and $Y$ are defined by different coordinates. Unless I completely misunderstand what it means to be of "joint density". 
 A: This is to establish the following for Borel set $B\subseteq [0,1]$,
$$\begin{align}
\mathsf P(Y\in B)
 & = \iint_{Y^{-1}(B)} f_{X,Y}(x,y) \mathrm dx\mathrm dy
\\
 & = \iint_{[0;1]\times B} f_{X,Y}(x,y) \mathrm dx\mathrm dy
\\
& = \int_B \int_0^1 (x+y) \mathrm dx\mathrm dy
\\
&  =\int_B (y + \frac 1 2 ) \mathrm dy.
\end{align}$$
Thus, the marginal PDF $f_Y(y)$ is $y+\frac 1 2$ for $y\in [0;1]$, and $0$ otherwise. 
In fact, the joint density of $X$ and $Y$ tells us how $X: \Omega\rightarrow \mathbb{R}$ and $Y:\Omega\rightarrow \mathbb{R}$ are distributed with $X(x,y)=x$ and $Y(x,y)=y$. We have for any Borel set $A\subseteq [0,1]\times [0,1]$, 
$$P((X,Y)\in A) = \iint_A f_{X,Y}(x,y)  \mathrm dx\mathrm dy.$$
Thus, 
$$\begin{align}
(x,y)\in Y^{-1}(B) 
& \iff Y(x,y) \in B
\\ & \iff x\in [0,1] \wedge y\in B
\\ & \iff (x,y)\in [0;1]\times B
\end{align}$$  
A: we can write 
$ E(X|Y)=\int_X xf(x|y)dx$
but $f(x|y)=\frac{f(x,y)}{f(y)}$
and
$ f(y)=\int_X f(x,y)dx=\int_{0}^{1} (x+y)dx=(x^2/2+xy |_0^1)=1/2+y$
Also
$$ E(X|Y)=\int_X xf(x|y)dx=\int_{0}^{1}x \frac{x+y}{1/2+y} dx$$
$$ =\int_{0}^{1} \frac{x^2+xy}{1/2+y} dx=\frac{1}{1/2+y} (x^3/3+x^2y/2|_0^1)$$
$$ = \frac{(1/3-y/2)}{(1/2+y)}=\frac{2+3y}{3+6y}$$
