I've seen $\text{cov}(x,y)$ expressed as $$\dfrac{\sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})}{n} \tag{1}$$ and also as $E[xy] - E[x]E[y]$. The latter expands to $$\frac{\sum_{i=1}^nx_iy_i}{n} - \left(\frac{\sum_{i=1}^nx_i}{n}\right)\left(\frac{\sum_{i=1}^ny_i}{n}\right) \tag{2}$$
Despite lots of effort trying to manipulate $(1)$ to become $(2)$ I've failed and would like some help. I started by expanding $(1)$ into $$\dfrac{\sum_{i=1}^nx_iy_i}{n} + \bar{x}\bar{y} - \dfrac{\sum_{i=1}^nx_i\bar{y}}{n} - \dfrac{\sum_{i=1}^ny_i\bar{x}}{n}$$
then eyeballing that with $(2)$ to get $$\bar{x}\bar{y} - \dfrac{\sum_{i=1}^nx_i\bar{y}}{n} - \dfrac{\sum_{i=1}^ny_i\bar{x}}{n} = -\left(\frac{\sum_{i=1}^nx_i}{n}\right)\left(\frac{\sum_{i=1}^ny_i}{n}\right) \tag{3}$$
I would like to be shown how to manipulate the LHS of $(3)$ to be the RHS.