I'm trying to find the SVD of the following matrix: $$A= \begin{pmatrix} 1 & 1 \\ 2 & -2 \\ 2 & 2 \\ \end{pmatrix} $$
I found the eigenvalues and vectors for $A'A$: $$ \begin{array}{cc} \lambda_1=10 & \lambda_2=8 \\ e_1'=(1,1) & e_2'=(-1,1). \\ \end{array} $$
I find the eigenvalues and vectors for $AA'$: $$ \begin{array}{ccc} \lambda_1=10 & \lambda_2=8 & \lambda_3=0 \\ e_1=(1,0,2) & e_2=(0,1,0) & e_3=(-2,0,1), \\ \end{array}$$
and so my SVD should be: $$\left( \begin{array}{ccc} \frac{1}{\sqrt{5}} & 0 & -\frac{2}{\sqrt{5}} \\ 0 & 1 & 0 \\ \frac{2}{\sqrt{5}} & 0 & \frac{1}{\sqrt{5}} \\ \end{array} \right).\left( \begin{array}{cc} \sqrt{10} & 0 \\ 0 & \sqrt{8} \\ 0 & 0 \\ \end{array} \right).\left( \begin{array}{cc} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \end{array} \right)$$
However, this gives $$\left( \begin{array}{cc} 1 & 1 \\ -2 & 2 \\ 2 & 2 \\ \end{array} \right)$$ instead of $A$.
To get $A$ I need to decompose in the following way $$\left( \begin{array}{ccc} \frac{1}{\sqrt{5}} & 0 & -\frac{2}{\sqrt{5}} \\ 0 & 1 & 0 \\ \frac{2}{\sqrt{5}} & 0 & \frac{1}{\sqrt{5}} \\ \end{array} \right).\left( \begin{array}{cc} \sqrt{10} & 0 \\ 0 & \sqrt{8} \\ 0 & 0 \\ \end{array} \right).\left( \begin{array}{cc} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ \end{array} \right)$$
This last decomposition is as if I had multiplied the first $e_2$ by $-1$.
These eigenvalues and vectors were derived from Mathematica, just to be sure I was using the correct elements.
Any help in explaining why my first decomposition doesn't work would be appreciated.
Edit: The book I'm using doesn't tell which of the orthonormal eigenvectors I have to use. For each eigenvalue, I have two orthonormal eigenvectors, $e_i$ and $-e_i$.