To calculate covariance doesn't one need to subtract the mean of the second variable? The definition of covariance says that it is:
$cov(X,Y)=E [(X- \overline{X})(Y- \overline{Y})]$
However, it seems that we can also calculate it without subtracting the mean of the second variable:
$cov(X,Y)=E [(X- \overline{X})(Y)]$
Is this correct? My argument for discrete variables results from comparing respective sums:
I. Sum number 1:
$$\sum[(X-\overline{X})\times (Y-\overline{Y})]=\sum(XY-\overline{Y}X-\overline{X}Y+\overline{X}\overline{Y})=\sum(XY)-\overline{Y}n\overline{X}-\overline{X}n\overline{Y}+n\overline{X}\overline{Y}=\sum(XY)-2n\overline{X}\overline{Y}+ n\overline{X}\overline{Y}=\sum(XY)- n\overline{X}\overline{Y}$$
II. Sum number 2:
$$\sum[(X-\overline{X})\times Y]= \sum(XY)-\overline{X}n\overline{Y}$$
Conclusion: sum number 1 = sum number 2, so the covariance can be calculated either way.

Adding to Richard's answer, it is also possible to compute the covariance without ever computing the expectation (or the sum) of either variable, just based on the differences between pairs.
Because
$$\sum_i\sum_j\sum_k(X_i-X_j)(Y_i-Y_k)=\\
\sum_i\sum_j\sum_k(X_iY_i-X_jY_i - X_iY_k+X_jY_k)=\\
\sum_i\sum_j\sum_k(X_iY_i)-\sum_i\sum_j\sum_k(X_jY_i) - \sum_i\sum_j\sum_k(X_iY_k)+\sum_i\sum_j\sum_k(X_jY_k)
$$
Going term by term:
$$
\sum_i\sum_j\sum_k(X_iY_i) = \sum_k\sum_j\sum_i(X_iY_i) = n^3E[XY]\\
\sum_i\sum_j\sum_k(X_jY_i) = \sum_i\sum_j\sum_k(X_iY_k)=\sum_i\sum_j\sum_k(X_jY_k) = n\sum_k(Y_k\sum_jX_j) = n^2E[X]\sum_kY_k=n^3E[X]E[Y]
$$
So
$$
\frac{1}{n^3}\sum_i\sum_j\sum_k(X_i-X_j)(Y_i-Y_k) = E[XY] - E[X]E[Y] - E[X]E[Y] + E[X]E[Y]\\
\frac{1}{n^3}\sum_i\sum_j\sum_k(X_i-X_j)(Y_i-Y_k) = E[XY] - E[X]E[Y]
$$
