TITLE: Confused by the SVD of a real symmetric matrix
QUESTION [5 upvotes]: For a real symmetric matrix A, it's true that:
$$A A^T = A^T A = A^2$$
And since the right and left singular vectors of $A$ are the eigenvectors of $A^T A$ and $A A^T$ respectively, the right and left singular vectors ought to be identical. 
Here's the particular situation that is causing my confusion. Let 
$$A = \begin{bmatrix} 4 & 1 & -2 & 2 \\ 1 & 2 & 0 & 1 \\ -2 & 0 & 3 & -2 \\ 2 & 1 & -2 & -1\end{bmatrix}$$
Now when I try to take the SVD of this matrix, the matrices $U$ and $V$, of the left and right singular vectors respectively, are identical. Just as I thought they would be. In particular, for $U$, $\Sigma$, and $V$ I get:
$$U = V = \begin{bmatrix} -0.718 & 0.202 & 0.177 & -0.642 \\ -0.221 & 0.789 & 0.178 & 0.544 \\ 0.557 & 0.580 & -0.288 & -0.520 \\ -0.353 & 0.010 & -0.924 & 0.144 \end{bmatrix}$$ 
and
$$\Sigma = \begin{bmatrix} 6.845 & 0 & 0 & 0 \\ 0 & 2.269 & 0 & 0 \\ 0 & 0 & 2.198 & 0 \\ 0 & 0 & 0 & 1.084 \end{bmatrix}$$
But if I use this to calculate $U \Sigma V^T$ I don't get $A$. This already confuses me, but to make matters worse, if I take $V$ to be $U$ except with the signs changed on the third column, then it comes out correctly! I feel like I must be misunderstanding something about the SVD or Eigenvectors in general, as I thought that as long as each eigenvector had norm 1, it didn't matter what the sign of it was (i.e. I think about it as more of an eigendirection). Can anyone point out why I'm getting these results?

REPLY [3 votes]: If $A$ is symmetric then $A^TA = A^2$ and the eigenvalues of $A^2$ are the squares of the eigenvalues of $A$, and therefore the singular values are $\sigma=|\lambda|$.  The eigenvectors of $A^TA=A^2$ are just the same as those of $A$; call these $v_1,v_2,\ldots,v_n$ and let $V=[v_1\,v_2\,\cdots\,v_n]$.  Assume for simplicity that $A$ is non-singular.  Then $u = \frac{1}{\sigma} Av$ for each $v$ and corresponding singular value and therefore $u=\frac{\lambda}{|\lambda|} v = sign(\lambda) v$.  Let Q be the diagonal matrix containing the numbers $sign(\lambda)$ for each $\lambda$.  Then $U=VQ$, and the singular value decomposition is $A=U\Sigma V^T = V (Q \Sigma) V^T$.  So, the part $Q\Sigma$ takes care of getting the correct sign for the eigenvalues and it is what you were missing, in other words, $Q\Sigma = diag(\lambda's)$