Letting $I:=\mathbf I$, $a:=\mathbf xi$, $b:=\mathbf xj$, $N:=(4M+I)^{1/2}$, $c_1:=a^\top Ma+b^\top Mb$, $m:=2N^{-1}M(a+b)$, $c_2:=m^\top m/2=2(a+b)^\top M(4M+I)^{-1}M(a+b)$, completing the squares, using the substitutions $z=Ny$ and $y-m=v$, using the formula $$\int_{\mathbb R^n}e^{-v^\top v/2}\,dv=(2\pi)^{n/2},$$ and doing a bit of algebra, we see that the expectation in question is $$(2\pi)^{n/2}\frac{e^{c_2-c_1}}{\det(4M+I)^{1/2}}(N^{-1}mm^\top N^{-1}+ab^\top-am^\top N^{-1}-N^{-1}mb^\top).$$
Iosif Pinelis
- 127.7k
- 8
- 107
- 229