Given a polynomial p(x) with leading coefficient [tex]a[/tex] and solutions [tex]x_1,x_2,\ldots,x_n[/tex], we have
[tex]p(x)=a(x-x_1)(x-x_2)\ldots(x-x_n)[/tex]
That's why we have to find the solutions first. We complete the square by adding 3 to both sides:
[tex]x^2-2x-2=0 \iff (x^2-2x-2)+3=3 \iff x^2-2x+1=3 \iff (x-1)^2=3[/tex]
From here, we continue by taking the square root of both sides:
[tex]x-1=\pm 3 \iff x=1\pm\sqrt{3}[/tex]
So, the two solutions are
[tex]x_1=1+\sqrt{3},\quad x_2=1-\sqrt{3}[/tex]
Which yields the factorization
[tex]x^2-2x-2=(x-1-\sqrt{3})(x-1+\sqrt{3})[/tex]