Solution (source code)

= Solution

Apart from terms independent of $\beta$, the Gaussian <log-likelihood> is
$$
\ell(\beta,\sigma^2)
=-\frac1{2\sigma^2}\sum_{i=1}^n(Y_i-\beta x_i)^2.
$$
Differentiating with respect to $\beta$ gives
$$
\frac{\partial\ell}{\partial\beta}
=\frac1{\sigma^2}\sum_{i=1}^n x_i(Y_i-\beta x_i).
$$
The unique zero, and hence the <maximum likelihood estimation>[maximum-likelihood estimate], is
$$
\boxed{\widehat\beta=\frac{\sum_i x_iY_i}{\sum_i x_i^2}}.
$$
The same value minimizes the <residual sum of squares> $\sum_i(Y_i-\beta x_i)^2$, since maximizing the Gaussian likelihood for fixed $\sigma^2$ is equivalent to minimizing this sum. It is therefore also the <linear regression through the origin>[least-squares estimator].