Joint density with continuous and binary random variable Assume $X\in\mathbb{R}$, $Y\in\{0,1\}$ are two random variables. What allows us to claim that $$f_{X}(x) = f_{XY}(x,1) + f_{XY}(x,0)$$
where $f_X(x)$ and $f_{XY}(x,y)$ are densities.

\begin{align}
\int_A f_{X,Y}(x,1)+f_{X,Y}(x,0)\,dx & = \int_A f_{X,Y}(x,1)\,dx+\int_A f_{X,Y}(x,0)\,dx \\[8pt]
& = \Pr(X\in A\ \&\ Y=1) + \Pr(X\in A\ \&\ Y=0) \\[8pt]
& = \Pr((X\in A\ \&\ Y=1)\text{ or }(X\in A\ \&\ Y=0)) \\[8pt]
& = \Pr(X\in A) \\[8pt]
& = \int_A f_X(x) \, dx.
\end{align}
