Finding a matrix using diagonalization I am working on a problem and I am little bit stuck. Useful hints will be appreciated greatly. 

I want to find a matrix $A$ such that $$A^TA =X,$$ where $$ X=
  \left[ {\begin{array}{cc}
   0 & 1\ \\1 &0
     \end{array} } \right].$$ 

The professor gave us a hint that I should diagonalise the matrix X to obtain a diagonal matrix D where $X= P^{-1}XD$ and find a matrix B such that $$B^TB =D.$$He said that once I find matrix B, I can use the matrix $B$ and $P$ to obtain the matrix A.
Here is my approach. I diagonalized $X$ and obtained my matrix D to be $$D=\left[ {\begin{array}{cc}
   1 & 0\ \\0 &-1
     \end{array} } \right].
$$ I also got the matrix $P$ to be $$P=\left[ {\begin{array}{cc}
   1 & -1\ \\1 &1
     \end{array} } \right].
$$ Now I need to figure out matrix B such that $B^TB=D$. Suppose that $$B= \left[ {\begin{array}{cc}
   a & b\ \\c &d
     \end{array} } \right],$$ where $a,b,c,d \in \mathbb{C}$.
I obtained the following equations from $B^TB=D$ that $$a^2 + c^2 =1$$
$$b^2 + d^2 =1$$
$$ab+cd=0.$$ I am having troubles solving this system of equations. I am stuck here at the moment.

The equations can be solved as follows. For $c=0$ we have $a=\pm 1$ and $ab=0$, hence $b=0$. This gives $a^2=d^2=1$. Hence $B=\pm I$. Otherwise we can write $d=-ab/c$ and substitute this into the first two equations. We obtain
$$
a^2(1+a^2+c^2)=0.
$$
Now $1+a^2+c^2>0$ for real $a,c$ hence $a^2=0$, so that $a=d=0$. For complex $a,c$ this does not hold.
