How do you factor $x^2-x-1$? I know you can't have all integers, but how do you factor this anyway?
Wolfram|Alpha gives me $-\frac{1}{4} (1+\sqrt{5}-2 x) (-1+\sqrt{5}+2 x)$.
Cymath gives me $(x-\frac{1+\sqrt{5}}{2})(x-\frac{1-\sqrt{5}}{2})$.
The closest I can get is $(x+1)(x-1)-x$.
So how do I get a nice answer like the ones listed above?
 A: Complete the square: Gather $x^2-x$ and whatever constant you need to create something of the form $(x-c)^2$, then repair the changes you've made:
$$
\textstyle x^2-x-1 = \left( x^2-x+\frac14 \right) - \frac14-1 = (x-\frac12)^2-\frac54
$$
Now the RHS has the form $a^2-b^2$ which you can factor as $(a+b)(a-b)$:
$$
\textstyle (x-\frac12)^2-\frac54 = (x-\frac12)^2-(\frac{\sqrt5}2)^2
=(x-\frac12+\frac{\sqrt5}2)(x-\frac12-\frac{\sqrt5}2)
$$
A: Solution 1: If $p$ is a root of $f(x)=x^2-x-1$ then $x-p$ is a factor of $f$ (see https://en.wikipedia.org/wiki/Polynomial_remainder_theorem). So $f(x)=(x-a)(x-b)$ where $a,b$ are the roots of $f$ (given by the quadratic formula). This gives Cymath's answer.
If you clear the denominators in Cymath's answer, you get Wolfram's answer.
Solution 2: Complete the square. $x^2-x-1\\=x^2-x+1/4-1-1/4 \\= (x-1/2)^2-5/4$, 
which is a difference of squares, so it factors as $(x-1/2-\sqrt {5}/2)(x-1/2+\sqrt5/2)$. This is Cymath's answer.
A: Apply quadratic formula for the roots of $x^2-x-1=0$ as follows 
$$x=\frac{-(-1)\pm\sqrt{(-1)^2-4(1)(-1)}}{2(1)}=\frac{1\pm \sqrt 5}{2}$$
hence, one should have the following factors  $$x^2-x-1=1\cdot \left(x-\frac{1+ \sqrt 5}{2}\right)\left(x-\frac{1- \sqrt 5}{2}\right)$$
or $$\frac{1}{4}(2x-1-\sqrt 5)(2x-1+\sqrt 5)$$
$$=-\frac{1}{4}(1+\sqrt 5-2x)(-1+\sqrt 5+2x)$$
So both the answers are correct
