I have an integral I want to compute:
$\qquad \int_{\mathbb R^4} e^{-(x_1+x_2+x_3+x_4)} \left( 1-x_1-x_3 \right) dx$
To me, this should be equivalent (modulo some scaling factor) to computing the expectation of $(1-x_1^2-x_3^2+ 0 x_2 + 0 x_4)$ when $x$ is a zero-mean Gaussian variable with variance $2I_4$. See How to deal with complicated Gaussian integrals in Mathematica?).
So I tried
Sqrt[(2 Pi)^4] Sqrt[2^4]
Expectation[
(1 - x1^2 - x3^2),
{x1, x2, x3, x4} \[Distributed] MultinormalDistribution[2 IdentityMatrix[4]]]
which gives $-48 \pi^2$. However, when I compute
Integrate[Exp[-x1^2 - x2^2 - x3^2 - x4^2] (1 - x1^2 - x3^2),
{x1, -Infinity, Infinity}, {x2,-Infinity,Infinity},
{x3, -Infinity,Infinity}, {x4, -Infinity, Infinity}]
The result is $0$.
I am not sure what is going on here. Which one is correct?.
1/2 IdentityMatrix[4]. – b.gates.you.know.what Dec 16 '19 at 13:45