TITLE: Expected distance between two vectors that belong to two different Gaussian distributions
QUESTION [5 upvotes]: Let $X$, $Y$ be two random variables that follow the Gaussian distributions with mean vectors $\mu_x$, $\mu_y$, and covariance matrices $\Sigma_x$, $\Sigma_y$, respectively. The probability density functions of $X$, $Y$ are given, respectively, by
$$
f_{X}(\mathbf{x})=\frac{1}{(2\pi)^{\frac{n}{2}}\lvert \Sigma_x \rvert^{\frac{1}{2}}}
\exp\Big\{-\frac{1}{2}(\mathbf{x}-\mu_x)^\top\Sigma_x^{-1}(\mathbf{x}-\mu_x)\Big\},
$$
and
$$
f_{Y}(\mathbf{y})=\frac{1}{(2\pi)^{\frac{n}{2}}\lvert \Sigma_y \rvert^{\frac{1}{2}}}
\exp\Big\{-\frac{1}{2}(\mathbf{y}-\mu_y)^\top\Sigma_x^{-1}(\mathbf{y}-\mu_y)\Big\},
$$
where $\mathbf{x},\mathbf{y}\in\Bbb{R}^n$. We will be thinking of $\mathbf{x}$, $\mathbf{y}$ as "members" of the distributions $X$, $Y$, respectively.
If we have two fixed vectors, say $\mathbf{x}$, $\mathbf{y}$, then the squared Euclidean distance between them would be equal to
$$
\big\lVert \mathbf{x} - \mathbf{y} \big\rVert^2.
$$
If we think about $\mathbf{x}$, $\mathbf{y}$ as above, i.e., as members of $X$, $Y$, respectively, then what would be the expected value of this distance?
Thank you very much for your help!

REPLY [2 votes]: For the record, both the result found by @Did and the bias-variance decomposition mentioned by @Golden_Ratio are consequences of a basic identity.

Claim: If random vector $W$ has mean vector $\mu$ and covariance matrix $\Sigma$, then
$$E(W^TW)=\mu^T\mu + \operatorname{tr}(\Sigma).$$
Proof:
$$
E(W^TW)-\mu^T\mu\stackrel{(a)}=E[(W-\mu)^T(W-\mu)]
\stackrel{(b)}=\sum_{i} E[(W_i-\mu_i)^2]
\stackrel{(c)}=\sum_i \operatorname{Var}(W_i)
\stackrel{(d)}=\operatorname{tr}(\Sigma).$$
Step (a) is matrix algebra; (b) is the inner product of a vector with itself; (c) is the definition of variance for a random variable; (d) follows from inspection of the covariance matrix $\Sigma$. Alternatively, argue
$E(W-\mu)^T(W-\mu)=\operatorname{tr}(\Sigma)$ by using the trick $v^Tv=\operatorname{tr}(v^Tv)=\operatorname{tr}(vv^T)$, valid for column vectors $v$.

To obtain @Did's result, put $W:=X-Y$; to obtain the bias-variance decomposition, put $W:=\hat\theta-\theta$.