If we knew (x2 + 6x) to be the first two terms of a perfect square expression, but not the constant term that would follow, we can work it out. We would use the fact that the expression can be factored as some perfect square (x + a)2. We know this can be extended to (x2 + 2ax + a2).We can see from the equation in the question that the coefficient of the x term is 6.Therefore, we can set 6 = 2a, and solve for a = 3.Then it is clear that the constant term that would follow, the a2 term for the perfect square in question, would be equal to 9.
If we return to our original quadratic equation with this knowledge,
x2 + 6x = -2
and add that 9 to both sides to see our perfect square on the left hand side,
x2 + 6x + 9 = 7
then factor the expression on the left hand side,
(x+3)2 = 7
then take the square root of both sides,
x+3 = (+-)sqrt(7)
and, finally, subtract 3 from both sides, we have our solutions.
x = sqrt(7) - 3 OR x = -sqrt(7) - 3