Factors of -2 that sum to I'm trying to simplify this equation: $x^2+x-2$. I put it on WolframAlpha and it gives me this:

The factors of -2 that sum to are $2$ and $-1$. So, $x^2+x-2 = (x+2)(x-1)$

Can someone please explain to me what does this mean? How is this technique called?
Thanks!

Alternative way to factor 

$$x^{ 2 }+x-2=x^{ 2 }+x+\frac { 1 }{ 4 } -\frac { 1 }{ 4 } -2={ \left( x+\frac { 1 }{ 2 }  \right)  }^{ 2 }-\frac { 9 }{ 4 } =\left( x+\frac { 1 }{ 2 } -\frac { 3 }{ 2 }  \right) \left( x+\frac { 1 }{ 2 } +\frac { 3 }{ 2 }  \right) \\ =\left( x-1 \right) \left( x+2 \right) $$

