Proof of the Law of Total Expectation

I discuss a straightforward proof of the law of total expectation with three standard assumptions.

The law of total expectation (or the law of iterated expectations or the tower property) is

E[X]=E[E[XY]]. \mathbb{E}[X] = \mathbb{E}[\mathbb{E}[X \mid Y]].

There are proofs of the law of total expectation that require weaker assumptions. However, the following proof is straightforward for anyone with an elementary background in probability. Let XX and YY are two random variables. Assume their densities exist. Then,

E[X]=xxfX(x)dx=xxyfX,Y(x,y)dxdy=xxyfXY(x,y)fY(y)dy=y[xxfXY(x,y)]fY(y)dy=yE[XY]fY(y)dy=E[E[XY]]. \begin{aligned} \mathbb{E}[X] &= \int_{x} x f_X(x)\text{d}x \\ &= \int_{x} x \int_{y} f_{X,Y}(x, y) \text{d}x\text{d}y \\ &= \int_{x} x \int_{y} f_{X \mid Y}(x, y) f_Y(y)\text{d}y \\ &\stackrel{\star}{=} \int_{y} \Bigg[ \int_{x} x f_{X \mid Y}(x, y) \Bigg] f_Y(y)\text{d}y \\ &= \int_{y} \mathbb{E}[X \mid Y] f_Y(y)\text{d}y \\ &= \mathbb{E}[\mathbb{E}[X \mid Y]]. \end{aligned}

Step \star does not hold without a regularity condition because, in general, you cannot change the order of integration. Thus, we need Fubini’s theorem to hold, and we are done.