# Prove that $\operatorname{Cov}[X,E(Y|X)]=\operatorname{Cov}[X,Y]$

How can I prove that $$\newcommand\cov{\operatorname{Cov}}\cov[X,E(Y|X)]=\cov[X,Y]$$?

I tried $$\cov[X,E(Y|X)] = E[XE(Y|X)]-E(X)E[E(Y|X)] = E[XE(Y|X)]-E(X)E(Y)$$ then I am stuck.

How can $$E[XE(Y|X)] = E(XY)$$?

Note that $X$ is $\sigma(X)$-measurable, hence $E[XY\mid X] = X\cdot E[Y\mid X]$, taking expectations, we have $$E\bigl[X \cdot E[Y\mid X]\bigr] = E\bigl[E[XY\mid X]\bigr] = E[XY]$$ as needed.