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.

$$P(X\le x)=P(X\le x\mid Y=1)P(Y=1)+P(X\le x\mid Y=0)P(Y=0)\\
=P(X\le x, Y=1)+P(X\le x,Y=0)\\
f_X(x)=\frac{dP(X\le x)}{dx}=f_{XY}(x,1)+f_{XY}(x,0)$$
