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.

For the theoretical covariance,
\begin{aligned}
\text{Cov}(X,Y) &= \mathbb{E}[(X-\mu_X)(Y-\mu_Y)] \\
&= \mathbb{E}[(X-\mu_X)\cdot Y - (X-\mu_X)\cdot\mu_Y] \\
&= \mathbb{E}[(X-\mu_X)\cdot Y] - \mathbb{E}[(X-\mu_X)\cdot\mu_Y)] \\
&= \mathbb{E}[(X-\mu_X)\cdot Y] - \mu_Y\cdot(\mathbb{E}[X]-\mu_X) \\
&= \mathbb{E}[(X-\mu_X)\cdot Y] - \mu_Y\cdot 0 \\
&= \mathbb{E}[(X-\mu_X)\cdot Y]. \\
\end{aligned}
For the sample covariance,
\begin{aligned}
\widehat{\text{Cov}}(X,Y) &= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})(Y_i-\bar{Y})] \\
&= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot Y_i - (X_i-\bar{X})\cdot\bar{Y}] \\
&= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot Y_i] - \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot\bar{Y})] \\
&= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot Y_i] - \bar{Y}\cdot\left(\frac{1}{n-1}\sum_{i=1}^n[X_i-\bar{X}]\right) \\
&= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot Y_i] - \bar{Y}\cdot 0 \\
&= \frac{1}{n-1}\sum_{i=1}^n[(X_i-\bar{X})\cdot Y_i]. \\
\end{aligned}
Not subtracting the mean of the second variable works in both cases.
