Conditional Expected Value of a Joint Probability Density Function I was wondering if anyone could help me with the following question specifically:
The continuous random variables $X_1$ and $X_2$ have the following joint probability density function: $$f(x_1,x_2)=\frac2{27}$$ over $0< x_1< 3$ and $0< x_2< 9-3x_1.$
Find $$E(X_1\mid X_2=5).$$
I tried to use the method of integrating $xh(x_1\mid x_2)$ but I couldn't get it to work.  Thank you in advance!

From the definition of conditional expectation, 
\begin{equation}
\mathbb{E}(X_{1}|X_{2} = x_{2}) = \int_{-\infty}^{\infty}x_{1}f_{X_{1}|X_{2}}(x_{1}|x_{2})\, dx_{1}.
\end{equation}
Furthermore, 
\begin{equation}
f_{X_{1}|X_{2}}(x_{1}|x_{2}) = \dfrac{f_{X_{1}, X_{2}}(x_{1}, x_{2})}{f_{X_{2}}(x_{2})},
\end{equation}
and
\begin{equation}
f_{X_{2}}(x_{2}) = \int_{x_{1}} f_{X_{1}, X_{2}}(x_{1}, x_{2}) \, dx_{1} = \int_{0}^{\frac{9-x_{2}}{3}} \dfrac{2}{27} dx_{1} = \dfrac{2}{27} \times \dfrac{9-x_{2}}{3}.
\end{equation}
Therefore, 
\begin{align}
\mathbb{E}(X_{1}|X_{2} = 5) & = \int_{-\infty}^{\infty} x_{1}f_{X_{1}|X_{2}}(x_{1}|x_{2} = 5) \, dx_{1} \\
& = \int_{-\infty}^{\infty} x_{1} \dfrac{2/27}{\frac{2}{27} \times \frac{9-5}{3}} \, dx_{1} = \int_{0}^{\frac{9-5}{3}}\dfrac{3x_{1}}{4}\, dx_{1} \\
& = \dfrac{3}{4} \times \left.\dfrac{x_{1}^{2}}{2}\right\vert_{0}^{4/3} = \dfrac{3}{4} \times \dfrac{(4/3)^{2}}{2} = \dfrac{2}{3}
\end{align}
