Question about finding an UMVUE 
I am trying to find the UMVUE for those two problems. I have found the complete sufficient statistics which are $T=(\sum{x_i}, \sum{y_i},\sum{x_i^2}+1/2\sum{y_i^2})$. which lead to a chi-square...
I am stuck on part two how to find an UMVUE for $(\mu_1-\mu_2)^2$
 A: Indeed, a complete sufficient statistic for $\theta=(\mu_1,\mu_2,\sigma^2)$ is
$$T_1=\left(\sum_i X_i,\sum_j Y_j,\sum_i X_i^2+\frac12\sum Y_j^2\right)$$
Equivalently, a complete sufficient statistic is
$$T_2=\left(\overline X,\overline Y,S_X^2+\frac12S_Y^2\right)\,,$$
where $\overline X,\overline Y$ are the sample means, and $S_X^2,S_Y^2$ are the sample variances with divisors $n-1$ and $m-1$ respectively.
As the two samples are independent, so are $\frac{(n-1)S_X^2}{\sigma^2}\sim \chi^2_{n-1}$ and $\frac{(m-1)S_Y^2}{2\sigma^2}\sim \chi^2_{m-1}$.
Therefore, $$\frac1{\sigma^2}\left[(n-1)S_X^2+\frac{(m-1)S_Y^2}2\right]\sim \chi^2_{n+m-2}$$
This yields the following unbiased estimator of $\sigma^2$ based on $T_2$, which is then UMVUE by Lehmann-Scheffé theorem:
$$\color{blue}{\widehat{\sigma^2}=\frac{2(n-1)S_X^2+(m-1)S_Y^2}{2(n+m-2)}}$$
For the second part, again due to independent samples, one has
$$\overline X-\overline Y \sim N\left(\mu_1-\mu_2,\sigma^2\left(\frac 1n+\frac 2m\right)\right)$$
Then,
\begin{align}
E\left(\overline X-\overline Y\right)^2&=\operatorname{Var}\left(\overline X-\overline Y\right)+\left(E\left(\overline X-\overline Y\right)\right)^2
\\&=\sigma^2\left(\frac 1n+\frac 2m\right)+(\mu_1-\mu_2)^2
\end{align}
So the UMVUE of $g(\mu_1,\mu_2)=(\mu_1-\mu_2)^2$ must be
$$\color{blue}{\widehat{g(\mu_1,\mu_2)}=\left(\overline X-\overline Y\right)^2 - \widehat{\sigma^2}\left(\frac 1n+\frac 2m\right)}$$
