law of total variance derivation without using variance short-cut formula In the derivation of the law of total variance from the original variance definition (not using the variance short-cut formula), you add and subtract the term $E(y|x)$, group them to the two terms in the variance, FOIL-expand and the +2(..)(..) cross term goes to 0:
$var(y) = E[(y-E(y))^2] \\= E[(y-E(y|x)+E(y|x)+E(y))^2] \\= E[(y-E(y|x))^2] + E[(E(y|x) - E(y))^2] + 2E[(y-E(y|x))(E(y|x)-E(y)]$
However, I’m having a hard time seeing why the +2(..)(..) term goes to 0.
http://www.columbia.edu/~gjw10/lie.pdf  states that the this last term drops out because:
$E[u|x] = E[(y - E(y|x))|x] = E(y|x) - E(y|x) = 0$
However, the expectation of the cross term is the expectation of two factors:
$E[(y-E(y|x))(E(y|x)-E(y))]$
But how can we consider just one of the factors going to 0, if E(AB) != E(A)E(B) unless A,B are independent?
Thanks!
 A: By the law of iterated expectation, we can write
$$E[(y - E[y|x])(E[y|x] - E[y])] = E[E[(y - E[y|x])(E[y|x] - E[y]) | x]]$$
Thus, to show that the LHS is 0, it suffices to show that the conditional expectation on the RHS is 0 for each fixed value of $x$, because $E[0] = 0$. So we just need to show that
$$E[(y - E[y|x])(E[y|x] - E[y]) | x]$$
What is special about this expression is that the second factor $E[y|x] - E[y]$ is constant conditional on $x$, and that is why it can be factored out of the conditional expectation (even though you are absolutely right that it cannot be factored out of the expectation in general), i.e.
$$E[(y - E[y|x])(E[y|x] - E[y]) | x] = E[y-E[y|x]|x](E[y|x]-E[y]) = 0$$
Also, a minor quibble about your last point. There are situations where $E[AB] = E[A]E[B]$, even when $A,B$ are not independent. For example, it suffices if $A$ and $B$ are uncorrelated (in fact, you could even take the above equality to be the definition of what it means to be uncorrelated). A less trivial sufficient condition is that it would suffice if $E[A|B] = E[A]$.
