I am reviewing the method of maximum likelihood and I was looking at the Gaussian-noise simple linear regression model at this link. I understand up to equation (3) on page 2. I assumed it followed by finding MLE parameters using derivative with respect to $\hat{\beta_0}$ and $\hat{\beta_1}$ and $\hat{\sigma^2}$. When I tried to solve this myslef I obtained the $\hat{\beta_1}$ and $\hat{\beta_2}$ as follows:
$\hat{\beta}_0 = \frac{\sum_{i=1}^{n} y_i - \hat{\beta}_{1}x_i}{n}=\bar{y}-{\hat{\beta}_1}\bar{x}$
$\hat{\beta}_1 = \frac{\sum_{i=1}^{n} x_iy_i - \hat{\beta}_{0}x_i}{\sum_{i=1}^{n}x_i^2}$ or
$\bar{xy} - \hat{\beta_0}\bar{x} - \hat{\beta_1}\bar{x^2} =0$
I don't understand how the closed form solution shown below is obtained:
$\hat{\beta}_1 = \frac{c_{xy}}{{s_x^2}} = \frac{\sum_{i=1}^n(x_i-\bar{x})(y_i-\bar{y})}{\sum_{i=1}^{n}(x_i-\bar{x})^2} $ (written in equation 4)
Can anyone help to clarify this please?