Let $X_1,...,X_{n_1}$ be an i.i.d. sample from $N_p(\mu_1,\Sigma)$ and let $Y_1,...,Y_{n_2}$ be an independent sample from $N_p(\mu_2,\Sigma)$, for some $\mu_1,\mu_2 \in \mathbb{R}^p$ and some invertible, $p\times p$ positive definite matrix $\Sigma$.
I'd like to find the likelihood function $L(\mu_1,\mu_2,\Sigma)$ of the commbined sample:
In my book, the likelihood function of $X_1,...,X_n \sim N_p(\mu,\Sigma)$ is given by
$$\frac{1}{(2\pi)^{np/2}\text{det}(\Sigma)^{n/2}}\exp\biggl(-1/2\bigl(\sum^n_{i=1}(x_i-\mu)^T\Sigma^{-1}(x_i-\mu)\bigr)\biggr)$$
So, $$L(\mu_1,\mu_2,\Sigma)=$$ $$\frac{1}{(2\pi)^{p(n_1+n_2)/2}\text{det}(\Sigma)^{\frac{n_1+n_2}{2}}}\exp\biggl(-1/2\sum^{n_1}_{i=1}(x_i-\mu_1)^T\Sigma^{-1}(x_i-\mu_1)-1/2\sum^{n_2}_{i=1}(y_i-\mu_2)^T\Sigma^{-1}(y_i-\mu_2)\biggr)$$
And so now I would like to find the MLE for $\mu_1,\mu_2,\Sigma$:
Set $$ \bar{x}:=\frac{1}{n_1}\sum_{i=1}^{n_1}x_{i} \quad\text{and}\quad S_x:=\sum_{i=1}^{n_1}(x_{i}-\bar{x})(x_{i}-\bar{x})^{\top}, $$ and, similarly, $\bar{y}$ and $S_y$.
Now I take the log of $\mathcal{L}$:
\begin{align} \ln\mathcal{L}(\mu_1,\mu_2,\Sigma)&=-\frac{(n_1+n_2)p}{2}\ln(2\pi)+\frac{(n_1+n_2)}{2}\ln|\Sigma^{-1}| \\ &\quad-\frac{1}{2}\operatorname{tr}(\Sigma^{-1}(S_x+S_y)) \\ &\quad-\frac{n_1}{2}(\bar{x}-\mu_1)^{\top}\Sigma^{-1}(\bar{x}-\mu_1)-\frac{n_2}{2}(\bar{y}-\mu_2)^{\top}\Sigma^{-1}(\bar{y}-\mu_2) \end{align}
To find MLE for $\mu_1$, I take the derivate of $\ln\mathcal{L}(\mu_1,\mu_2,\Sigma)$ w.r.t $\mu_1$:
$$\frac{d}{d\mu_1}\ln\mathcal{L}(\mu_1,\mu_2,\Sigma)=0$$
$$\frac{n_1}{2}(\bar{x}-\mu_1)^T\bigl((\Sigma^{-1})^T+\Sigma^{-1}\bigr)\frac{d}{d\mu_1}(\bar{x}-\mu_1)=0$$
$$-\frac{n_1}{2}(\bar{x}-\mu_1)^T(2\Sigma^{-1})=0$$
$$\iff\bar{x}=\mu_1$$
So MLE for $\mu_1=\bar{x}$.
So, $$-\frac{n_1}{2}(\bar{x}-\mu_1)^T(2\Sigma^{-1})$$ is maximized when $\mu_1=\bar{x}$ since $\Sigma^{-1}$ is positive definite?
So, I'm not sure whether I'm doing this correct. Could someone please correct me if possible?