The question is as follows, apologies in advance, I don't know how to do the LaTex thing in posts.
Let $X_1,\ldots,X_n, Y_1,\ldots,Y_n$ be independent random variables such that $X_i \sim N(\mu_1,\sigma^2)$ and $Y_j \sim N(\mu_2,\sigma^2)$. Both $\mu_1$ and $\mu_2$ are known but $\sigma^2$ is not.
Find the maximum likelihood estimator for $\sigma^2$ based on all $n+m$ observations. Show all working.
I am trying to work through with this but I am getting some horrible results when I get to the log-likelihood function. Any help in deriving the log-likelihood function would be appreciated.