Hypothesis Testing of the normal distribution I have two following problems about the hypothesis testing about the normal distribution:

I. A random sample of size $n$ from a normal population with unknown mean and variance is to be used to test the null hypothesis $\mu=\mu_0$ against the alternative $\mu\ne\mu_0$. Using the simultaneous maximum likelihood estimates of $\mu$ and $\sigma^2$, show that the values of the likelihood ratio statistic can be written in the form:$$\lambda=\Big(1+{{t^2}\over{n-1}}\Big)^{-{n\over2}},$$where $t={{\bar x-\mu_0}\over{s/\sqrt n}}$.
II. Given a random sample of size $n$ from a normal population with unknown mean and variance, find an expression for the likelihood ratio statistic for testing the null hypothesis $\sigma=\sigma_0$ against the alternative hypothesis $\sigma\ne\sigma_0$

 A: The likelihood function is
$$
\begin{align}
L(\mu,\sigma) & = \text{constant} \cdot\prod_{i=1}^n \left(\sigma^{-1} \exp\left(\frac{-1}{2}\left(\frac{x_i-\mu}{\sigma}\right)^2\right)\right) \\[8pt]
& = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\sum_{i=1}^n(x_i-\mu)^2\right) \\[8pt]
& = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\left(n(\bar x - \mu)^2+\sum_{i=1}^n(x_i-\bar x)^2 \right)\right) \\[8pt]
& = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\left(n(\bar x - \mu)^2+ns^2 \right)\right).
\end{align}
$$
Evaluating this at the MLEs $\hat\mu=\bar x$ and $\hat\sigma = s$, we have
$$
L(\bar x, s) = cs^{-n}\exp\left(\frac{-1}{2s^2}ns^2\right) = cs^{-n}\exp\left(\frac{-n}{2}\right) .
$$
Evaluating it at the hypothesized value $\mu_0$, we have
\begin{align}
L(\mu_0,s) = {} & cs^{-n}\exp\left(\frac{-1}{2s^2} \left(n(\bar x - \mu_0)^2+ ns^2 \right)^2\right) \\[8pt]
= {} & cs^{-n}\exp\left(\frac{-n}{2s^2} \left((\bar x - \mu_0)^2+ s^2 \right)\right)
\end{align}
So we get a likelihood ratio:
$$
\frac{L(\bar x, s)}{L(\mu_0,s)} = \exp\left(n\left(\frac{\bar x - \mu_0}{s}\right)^2\right) = \exp(t^2).
$$
This is a monotone function of $|t|$, so one rejects the null hypothesis if $|t|$ is too big.
I'll let you work on further details.
