Evaluate the triple integral problem Evaluate $\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}(x^2-2xy)e^{-Q}dxdydz$
, where $Q=3x^2+2y^2+z^2+2xy$.
 A: \begin{align}
I:&=\int_{-\infty}^{\infty}dx\int_{-\infty}^{\infty}dy\int_{-\infty}^{\infty}dz\left(x^2-2xy\right)\exp\left(-3x^2 - 2y^2 - z^2 - 2xy\right)\\
&=\sqrt{\pi}\int_{-\infty}^{\infty}dx\int_{-\infty}^{\infty}dy\left(x^2-2xy\right)\exp\left(-3x^2-2y^2-2xy\right) \tag1\\
\end{align}
We split the integral in $(1)$ into two parts:
\begin{align}
I_1&=\sqrt{\pi}\int_{-\infty}^{\infty}dxx^2\exp\left(-3x^2\right)\int_{-\infty}^{\infty}dy\exp\left(-2y^2-2xy\right) \tag2
\end{align}
We complete the square:
\begin{align}
-2y^2-2xy&=-2\left(y^2+xy\right)\\
&=-2\left(\left(y+\frac{x}{2}\right)^2-\frac{x^2}{4}\right)\\
&=-2\left(y+\frac{x}{2}\right)^2+\frac{x^2}{2}
\end{align}
Thus, $(2)$ becomes
\begin{align}
I_1&=\sqrt{\pi}\int_{-\infty}^{\infty}dxx^2\exp\left(-\frac{5}{2}x^2\right)\int_{-\infty}^{\infty}dy\exp\left(-2\left(y+\frac{x}{2}\right)^2\right)\\
&=\frac{\pi}{\sqrt{2}}\int_{-\infty}^\infty dxx^2\exp\left(-\frac{5}{2}x^2\right)\\
&=\frac{\pi^{\frac{3}{2}}}{5\sqrt{5}} \tag3
\end{align}
Then, we look at the second integral:
\begin{align}
I_2&=2\sqrt{\pi}\int_{-\infty}^\infty dx x\exp\left(-3x^2\right)\int_{-\infty}^\infty dyy\exp\left(-2y^2-2xy\right)\\
&=2\sqrt{\pi}\int_{-\infty}^\infty dx x\exp\left(-2x^2\right)\int_{-\infty}^\infty dyy\exp\left(-2\left(y+\frac{x}{2}\right)^2\right)\\
&=2\sqrt{\pi}\int_{-\infty}^\infty dx x\exp\left(-2x^2\right)\int_{-\infty}^\infty du\left(u-\frac{x}{2}\right)\exp\left(-2u^2\right) \tag4
\end{align}
Splitting $(4)$ again, we have
\begin{align}
I_{2,1}&=2\sqrt{\pi}\int_{-\infty}^\infty dx x\exp\left(-2x^2\right)\int_{-\infty}^\infty duu\exp\left(-2u^2\right)\\
&= 0
\end{align}
\begin{align}
I_{2,2}&=\sqrt{\pi}\int_{-\infty}^\infty dx x^2\exp\left(-\frac{5}{2}x^2\right)\int_{-\infty}^\infty du\exp\left(-2u^2\right)\\
&=\frac{\pi}{\sqrt{2}}\int_{-\infty}^\infty dx x^2\exp\left(-\frac{5}{2}x^2\right)\\
&=\frac{\pi^{\frac{3}{2}}}{5\sqrt{5}} \tag5
\end{align}
Adding up $(3)$ and $(5)$, we have

\begin{align}
\int_{-\infty}^{\infty}dx\int_{-\infty}^{\infty}dy\int_{-\infty}^{\infty}dz\left(x^2-2xy\right)\exp\left(-3x^2 - 2y^2 - z^2 - 2xy\right)=\frac{2\pi^{\frac{3}{2}}}{5\sqrt{5}}
\end{align}

A: Let $\Sigma$ be the symmetric $3 \times 3$ matrix which is specified by $\frac{1}{2}\mathrm{x}^{\mathsf{T}}\Sigma^{-1} \mathrm{x} = Q(\mathrm{x})$ for $\mathrm{x}\in \Bbb{R}^3$. Then $\Sigma$ satisfies
$$ \Sigma^{-1} = \begin{pmatrix} 6 & 2 & 0 \\ 2 & 4 & 0 \\ 0 & 0 & 2 \end{pmatrix}, \qquad
\Sigma = \frac{1}{10} \begin{pmatrix} 2 & -1 & 0 \\ -1 & 3 & 0 \\ 0 & 0 & 6 \end{pmatrix}, \qquad
\det \Sigma = \frac{1}{40}. $$
Now introduce a random vector $X = (X_1, X_2, X_3)$ which has multivariate normal distribution $\mathcal{N}(0, \Sigma)$. Then its density is given by
$$ f_{X}(\mathrm{x}) = \frac{1}{\sqrt{(2\pi)^3\det \Sigma}} \exp\{ -\tfrac{1}{2}\mathrm{x}^{\mathsf{T}}\Sigma^{-1}\mathrm{x} \}. $$
From this, we can compute the integral as follows:
\begin{align*}
\int_{\Bbb{R}^3} (x^2 - 2xy)e^{-Q(\mathrm{x})} \, d\mathrm{x}
&= \sqrt{(2\pi)^3\det \Sigma} \int_{\Bbb{R}^3} (x^2 - 2xy) f_{X}(\mathrm{x}) \, d\mathrm{x} \\
&= \sqrt{(2\pi)^3\det \Sigma} \cdot \Bbb{E}[X_1^2 - 2X_1 X_2] \\
&= \sqrt{(2\pi)^3\det \Sigma} \cdot (\Sigma_{11} - 2\Sigma_{12}),
\end{align*}
where $\Sigma_{ij} = \operatorname{Cov}(X_i, X_j)$ is the $(i,j)$-entry of the covariance matrix $\Sigma$. Computing everything, we obtain
$$ \int_{\Bbb{R}^3} (x^2 - 2xy)e^{-Q(\mathrm{x})} \, d\mathrm{x} = \frac{2\pi^{3/2}}{5\sqrt{5}}. $$
