The quadratic x^2 + px + -2 = 0 has roots -2 and 1. Find p.
Note
Use Vieta's formula for x² + px + q = 0. For this form, the sum of the roots is -p and the product of the roots is q. The given roots are -2 and 1, so their sum is -2 + 1 = -1. Since sum = -p, we have -p = -1, which gives p = 1. The product -2×1 = -2 also matches the constant term, so the roots are consistent. Therefore the correct answer is 1.
