Explanation:
the other solution is right, but that works only for very low, simple numbers, where you have limited options to play through.
there is a general way to solve any quadratic equation :
0 = ax² + bx + c
x = (-b ± sqrt(b² - 4ac))/(2a)
so, we have
x² - x - 12 = 0
a = 1
b = -1
c = -12
x = (1 ± sqrt((-1)² - 4×1×-12))/(2×1) =
= (1 ± sqrt(1 + 48))/2 = (1 ± sqrt(49))/2 =
= (1 ± 7)/2
x1 = (1 + 7)/2 = 8/2 = 4
x2 = (1 - 7)/2 = -6/2 = -3
so, the 2 solutions for the equation are
x = -3 and x = 4