Solution (source code)

= Solution

Apart from constants, the log-likelihood is
$$
\ell(\theta)=-\frac1{2\sigma^2}\sum_{i=1}^n(X_i-\theta)^2.
$$
Differentiating gives $\ell'(\theta)=n(\overline X-\theta)/\sigma^2$, so
$$
\boxed{\widehat\theta_{\mathrm{MLE}}=\overline X}.
$$