The Conditional Covariance Formula. The conditional covariance of $X$ and $Y$, given $Z$, is defined by
$$
\operatorname{Cov}(X, Y \mid Z) \equiv E[(X-E[X \mid Z])(Y-E[Y \mid Z]) \mid Z]
$$
(a) Show that
$$
\operatorname{Cov}(X, Y \mid Z)=E[X Y \mid Z]-E[X \mid Z] E[Y \mid Z]
$$
(b) Prove the conditional covariance formula
$$
\operatorname{Cov}(X, Y)=E[\operatorname{Cov}(X, Y \mid Z)]+\operatorname{Cov}(E[X \mid Z], E[Y \mid Z])
$$
(c) Set $X=Y$ in part (b) and obtain the conditional variance formula.