Prove that if the random variables $X$ and $Y$ are such that $EX^2$ and $EY^2$ are finite, then $$DX=E(D(X\mid Y))+D(E(X\mid Y))$$ where $D$ denotes the variance and $E$ denotes the expectation.
This semestar, we have been doing conditional expectation, characteristic functions, convergences of sequences of random variables,law of large numbers, central limit theorems, to name a few. But I cannot seem to get an idea on how to do this. Would very much appreciate if someone has done this before.
$\mathrm{Var}X$ is equal to $\mathbf{E}X^2-(\mathbf{E}X)^2$. Therefore $$ \mathrm{Var}X=\mathbf{E}[\mathbf{E}[X^2|Y]]-(\mathbf{E}[\mathbf{E}[X|Y]])^2 $$ which is equal to $$ \mathrm{Var}X=(\mathbf{E}[\mathbf{E}[X^2|Y]]-\mathbf{E}[(\mathbf{E}[X|Y])^2])+(\mathbf{E}[(\mathbf{E}[X|Y])^2]-(\mathbf{E}[\mathbf{E}[X|Y]])^2). $$ Done!
Ps. The unique thing that you have to notice, apart from the definition of variance, is that the expected value of the conditional r.v. is equal to the expected value of the unconditional one. But this follows from the definition of conditional r.v., right?