I'm trying to do a singular value decomposition ($A = USV^T$) of the following matrix:
$A = \begin{bmatrix}1&1\\1&0\end{bmatrix}$
First of all I calculate $A^TA$ and $AA^T$ which in this case is the same: $\begin{bmatrix}2&1\\1&1\end{bmatrix}$
Now I get the eigenvalues/eigenvectors of the previous matrix, which are $\frac{3 + \sqrt{5}}{2}$ and $\frac{3 - \sqrt{5}}{2}$. The eigenvectors are [$\frac{1 + \sqrt{5}}{2}$, 1] and [$\frac{1 - \sqrt{5}}{2}$, 1].
Let's define $\phi = \frac{1 + \sqrt{5}}{2}$
I can now construct both U and V with the normalized eigenvectors, which are orthogonal matrices: $U = V = \begin{bmatrix}\frac{\phi}{\sqrt{\phi^2 + 1}}&\frac{1 - \phi}{\sqrt{(1 - \phi)^2 + 1}}\\\frac{1}{\sqrt{\phi^2 + 1}}&\frac{1/}{\sqrt{(1 - \phi)^2 + 1}}\end{bmatrix}$
Finally, I can calculate S which is the diagonal matrix with square roots of the eigenvalues of $AA^T$: $S = \begin{bmatrix}\phi&0\\0&1-\phi\end{bmatrix}$
If I now calculate $USV^T$ I'm not getting A! I however realized that if I multiply the second column of V by -1 I then get A when doing $USV^T$. What am I doing wrong?
There is no advantage in computing the SVD of a real symmetric matrix instead of the symmetric eigenvalue decomposition. The natural decomposition for a symmetric matrix is the symmetric eigenvalue decomposition (SED) and not the SVD. Everything which can be done using the SVD of a symmetric matrix can be done using the SED provided the eigenvalues are ordered such that the absolute values of the eigenvalues are in the non-increasing order.
The main aim of the SVD is NOT to compute products such as $A^tA$ and $AA^t$. The computation of such products is considered as the worst "sin" one can do by numerical analysts.
However, if you insists that you would like to compute the SVD of a symmetric matrix then you may follow the following steps. I will be using numbers not symbolic variables. In any case, symbolic variables are difficult to handle with large matrices.
(a) Compute the SEP of the matrix $A$. This is given by $$ A = U \Lambda U^t $$ where $$ U = \left[ \begin{array}{rr} 0.5257 &-0.8507 \\ -0.8507 & -0.5257 \end{array} \right] ,\;\;\; \Lambda = \left[ \begin{array}{rr} -0.6180 & 0 \\ 0 & 1.6180 \end{array} \right] . $$
(b) Order the eigenvalues such that the absolute values are non-decreasing. $$ \Lambda = \left[ \begin{array}{rr} 1.6180 & 0 \\ 0 & -0.6180 \end{array} \right] . $$ Because of the permutation, we have to apply the same to the eigenvector matrix. In that case, the new matrix $U$ is given by $$ U = \left[ \begin{array}{rr} -0.8507 & 0.5257 \\ -0.5257 & -0.8507 \end{array} \right] . $$ Note that, $A = U\Lambda U^t$ even after the reordering of the eigenvalues. That is, $$ A = \left[ \begin{array}{rr} -0.8507 & 0.5257 \\ -0.5257 & -0.8507 \end{array} \right] \left[ \begin{array}{rr} 1.6180 & 0 \\ 0 & -0.6180 \end{array} \right] \left[ \begin{array}{rr} -0.8507 & -0.5257 \\ 0.5257 & -0.8507 \end{array} \right]. $$
(c) Singular values are always non-negative. We negate the second eigenvalue and to compensate that negate the second row of $U^t$. Thus,
$$ A = \left[ \begin{array}{rr} -0.8507 & 0.5257 \\ -0.5257 & -0.8507 \end{array} \right] \left[ \begin{array}{rr} 1.6180 & 0 \\ 0 & 0.6180 \end{array} \right] \left[ \begin{array}{rr} -0.8507 & -0.5257 \\ -0.5257 & 0.8507 \end{array} \right] $$ Thus, the SVD is of the symmetric matrix is given by $$ A = U \Sigma V^t $$ where $$ U = \left[ \begin{array}{rr} -0.8507 & 0.5257 \\ -0.5257 & -0.8507 \end{array} \right] , \;\;\; \Sigma = \left[ \begin{array}{rr} 1.6180 & 0 \\ 0 & 0.6180 \end{array} \right] ,\;\;\; V = \left[ \begin{array}{rr} -0.8507 & -0.5257 \\ -0.5257 & 0.8507 \end{array} \right] $$
We have demonstrated how to get the SVD of a symmetric matrix from the SED. This can be done for any symmetric matrix, small or large. Note that the columns of $U$ and $V$ are identical except perhaps for a signature change.