Solution (source code)

= Solution

The <score function> and the <observed Fisher information> are
$$
\ell'(\theta)=\frac{2N}{\theta}-S,\qquad
j(\theta)=-\ell''(\theta)=\frac{2N}{\theta^2}>0.
$$
Solving the <score equation> gives the <maximum-likelihood estimate>
$$
\boxed{\widehat\theta=\frac{2N}{S}=\frac2{\bar x}}.
$$
The positive <observed Fisher information> means that the <log-likelihood> is strictly <concave> on $\theta>0$. Its unique <stationary point> is therefore the global maximum. Equivalently, the <score function> changes from positive to negative at this point. At the estimate, $j(\widehat\theta)=S^2/(2N)$.