A special case of a normal family is one in which the mean and variance are related, the $N(\theta,a\theta)$ family. If we are interested in testing this relationship, regardless of the value of $\theta$, we are again faced with a nuisance parameter problem.
Find the LRT of $H_0: a =1$ versus $H_1: a \neq 1$ based on a sample $X_1,...,X_n$ from a $N(\theta, a\theta)$ family, where $\theta$ is unknown.
I'm ok in terms of finding the Likelihood Ratio Test, but I'm having trouble with the restricted MLE.
So far I have
$$\frac{\partial log L}{\partial \theta} = \frac{-n}{2\theta}+\frac{1}{2a\theta^2}\sum_{i=1}^n (x_i-\theta)^2+\frac{n\bar{x}-n\theta}{a\theta}=0$$
Setting $a=1$ and solving for $\theta$ I have
$$\bar{x}^2- \theta - \theta^2 = 0$$
However, the solution is
$$\hat{\theta}_R = \frac{-1+\sqrt{1+4(\hat{\theta}^2+\hat{x}^2)}}{2}$$
"Setting $a=1$ and solving for $\theta$" actually yields $$\frac1n\sum_{i=1}^nx_i^2=\theta+\theta^2.$$