Can $(\mu_1 - \mu)^2 + (\mu_2 - \mu)^2$ be simplified to remove $\mu?$ $\mu_1$ and $\mu_2$ are means of two groups, while $\mu$ is the overall mean.
I feel like this can be done with some basic algebra I've forgotten, but I'm not sure.
Here is some more context:
$$
f = \frac{\sqrt{\dfrac{\sum_{j}{(\mu_j - \mu)^{2}}}{J}}}{\sigma_{y}}
$$
which with two groups (J=2) reduces to:
$$
f = \frac{\sqrt{\dfrac{(\mu_{1} - \mu)^{2} + (\mu_{2} - \mu)^{2}}{2}}}{\sigma_{y}}
$$
 A: I don't think we can remove $\mu$.  If we could, then the expression would be unchanged if we plugged various values in for $\mu$.  for instance $$\begin{align}
    \mu &= 0 &&:  & (\mu_1 - 0)^2 + (\mu_2 - 0)^2 &= \mu_1^2 + \mu_2^2 \\
    \mu &= \mu_1 &&:  & (\mu_1 - \mu_1)^2 + (\mu_2 - \mu_1)^2 &= \mu_1^2 -2 \mu_1\mu_2 + \mu_2^2 \\
    \mu &= \mu_2 &&:  & (\mu_1 - \mu_2)^2 + (\mu_2 - \mu_2)^2 &= \mu_1^2 -2 \mu_1 \mu_2 + \mu_2^2 \\
\end{align}$$
Since these aren't all the same, and the only thing we did was change the value of $\mu$, we can't find an expression that doesn't contain $\mu$ that takes the same values.
A: Let $n_1$ and $n_2$ be the respective sizes of the two groups.  Then
$$
\mu = \frac{n_1\mu_1+n_2\mu_2}{n_1+n_2}.
$$
And then we have
\begin{align}
& (\mu_1 - \mu)^2 + (\mu_2 - \mu)^2 \\[10pt]
= {} & \left( \frac{(n_1+n_2)\mu_1-(n_1\mu_1+n_2\mu_2)}{n_1+n_2} \right)^2 + \left( \frac{(n_1+n_2)\mu_2-(n_1\mu_1+n_2\mu_2)}{n_1+n_2} \right)^2 \\[10pt]
= {} & \frac{\Big(n_2(\mu_1-\mu_2)\Big)^2}{n_1+n_2} + \frac{\Big(n_1(\mu_2-\mu_1)\Big)^2}{n_1+n_2} \\[10pt]
= {} & \frac{(n_1^2+n_2^2)(\mu_2-\mu_2)^2}{n_1+n_2}.
\end{align}
