Don't understand how this joint PDF works This question comes from MIT 6.041 OCW.
I don't understand part b of this question, specifically how $f_X(x)$ and $f_{Y|X}(y|0.5)$ are calculated.
As far as I understand, you get the marginal PDF by integrating the joint PDF, i.e. $f_X(x)=\int f_{X,Y}(x,y) dy$.
This already leads to a lot of confusions:

*

*There are, as per the diagram, two $f_{X,Y}(x,y)$: $1/2$ and $3/2$. So integrating these two we get $\frac{1}{2}y$ and $\frac{3}{2}y$ respectively - so which one is supposed to be $f_X(x)$? And is $f_X(x)$ in terms of $y$ even legit?


*The solution states $f_X(x)$ in terms of $x$, but if we integrate $f_{X,Y}(x,y)$ in terms of $y$, how could we get $x$?
Solution for $f_{Y|X}(y|0.5)$ is even weirder; doesn't individual point get zero PDF because a point has no area? So how is it possible talk about $X=0.5$ in the first place, let alone letting a zero probability event to be the denominator?


 A: The integrals in question are definite integrals, not antiderivatives.  For example,
$$
f_X(x) = \int_{y=-\infty}^\infty f_{X, Y}(x, y) \, dy
$$
Given that
$$
f_{X, Y}(x, y) = \begin{cases}
\frac12 & 0 < x < 1, 0 < y < x \\
\frac32 & 1 < x < 2, 0 < y < 2-x \\
0 & \text{otherwise}
\end{cases}
$$
we get, for $0 < x < 1$,
\begin{align}
f_X(x) & = \int_{y=-\infty}^\infty f_{X, Y}(x, y) \, dy \\
       & = \int_{y=0}^x \frac{dy}{2} \\
       & = \left. \frac{y}{2} \right]_{y=0}^x \\
       & = \frac{x}{2}
\end{align}
and for $1 < x < 2$,
\begin{align}
f_X(x) & = \int_{y=-\infty}^\infty f_{X, Y}(x, y) \, dy \\
       & = \int_{y=0}^{2-x} \frac{3 \, dy}{2} \\
       & = \left. \frac{3y}{2} \right]_{y=0}^{2-x} \\
       & = 3-\frac{3x}{2}
\end{align}
For the others, we have
$$
f_{Y \mid X}(y \mid 0.5)
    = \frac{f_{X, Y}(0.5, y)}
           {\int_{y=-\infty}^\infty f_{X, Y}(0.5, y) \, dy}
$$
and
$$
f_{X \mid Y}(x \mid 0.5)
    = \frac{f_{X, Y}(x, 0.5)}
           {\int_{x=-\infty}^\infty f_{X, Y}(x, 0.5) \, dx}
$$
Note that evaluation of the last requires integration of a piecewise constant function.
