# Law of total covariance with two conditioning variables

How to decompose the covariance with two conditioning random variables?

For example, there is a law of total variance with two conditioning variables in the Wikipedia $$\text{Var}(Y)=\text{E}[\text{Var}(Y|X_{1},X_{2})]+\text{E}[\text{Var}(\text{E}[Y|X_{1},X_{2}]|X_{1})]+\text{Var}(\text{E}[Y|X_{1}])$$

What is it's counter part for the covariance? Is the following expression (especially the middle RHS term) correct? $$\text{Cov}(Y,W)=\text{E}[\text{Cov}(Y,W|X_{1},X_{2})]+\text{E}\{\text{Cov}(\text{E}[Y|X_{1},X_{2}]|X_{1},\text{E}[W|X_{1},X_{2}]|X_{1})\}+\text{Cov}(\text{E}[Y|X_{1}],\text{E}[W|X_{1}])$$

• Covariance is variance. Therefore there's nothing new to be learned. – whuber Oct 8 '17 at 15:17
• Clarified the question, Not sure about the middle RHS term – den2042 Oct 9 '17 at 13:00