Solution (source code)

= Solution

For observations $x_1,\ldots,x_n$, the <log-likelihood> of the <normal distribution> model is
$$
\ell(\mu,\sigma^2)
=-\frac n2\log(2\pi\sigma^2)
-\frac1{2\sigma^2}\sum_{i=1}^n(x_i-\mu)^2.
$$
Differentiating first with respect to $\mu$ gives $\widehat\mu=\overline x$. Substituting this value and differentiating with respect to $\sigma^2$ gives the <normal mean and variance maximum-likelihood estimators>
$$
\boxed{\widehat\mu=\overline X=\frac1n\sum_{i=1}^nX_i,
\qquad
\widehat{\sigma}^2=\frac1n\sum_{i=1}^n(X_i-\overline X)^2}.
$$