Standardizing a two-dimensional random vector Suppose that we have a two-dimensional random vector
$$
\left(\begin{array}{c}X \\Y\end{array}\right)
$$
with random variables $X$ and $Y$ such that $\operatorname EX=\operatorname EY=0$, $\operatorname EX^2<\infty$ and $\operatorname EY^2<\infty$. The covariance matrix of this random vector is given by
$$
\Sigma=\left(\begin{array}{cc}\operatorname EX^2 & \operatorname E[XY] \\\operatorname E[XY] & \operatorname EY^2\end{array}\right).
$$

How can we find a $2\times 2$ matrix $B$ such that the covariance matrix of
  $$
B\left(\begin{array}{c}X \\Y\end{array}\right)
$$
  would be an identity matrix, i.e. the random variables of the transformed random vector would be uncorrelated and would have unit variances?

It seems that the matrix $B$ should be somehow related to the inverse of the covariance matrix $\Sigma$, but I am not sure how.
Any help is much appreciated!
 A: Writing $(X,Y)=\mathbf{x}$, we have $\Sigma=E[\mathbf{xx}^T]$. This allows us to write the problem in the form
$$ I=E[(B\mathbf{x})(B\mathbf{x})^T] = BE[(\mathbf x\mathbf x^T)]B^T = B\Sigma B^T, $$
and now we have to solve the matrix equation $B\Sigma B^T = I$, where $\Sigma$ is a symmetric positive-definite matrix.
It is clear that this equation does not determine $B$ uniquely: $-B$ will also always be a solution.
$\Sigma$ is a symmetric matrix, and hence can be diagonalised using an orthogonal matrix $O$:
$$ \Sigma = O\Lambda O^T, $$
where $\Lambda$ is diagonal with positive elements. In particular, we can define the inverse square root of $\Sigma$ by
$$ \Sigma^{-1/2} = O\Lambda^{-1/2}O^T, $$
where $\Lambda^{-1/2}$ is just taking the positive inverse square roots of the diagonal elements in the obvious way. Then taking $B=\Sigma^{-1/2}$,
$$ B\Sigma B^T = \Sigma^{-1/2}\Sigma(\Sigma^{-1/2})^T = O\Lambda^{-1/2}O^T O\Lambda O^T (O\Lambda^{-1/2}O^T)^T = O\Lambda^{-1/2}\Lambda O^T O\Lambda^{-1/2}O^T = I, $$
so this is one solution to the equation.
(in the above I have assumed that $\Sigma$ does not have a zero eigenvalue: if it did, it would not be possible to solve the equation.)
