Let f(x) = ax^2 + bx + c

We have x1= 2 and x2=-1 are roots for f(X)

f(x) is a 2nd degree function, then it has 2 roots (x1, and x2)

==> (x-x1) and (x-x2) are factors for f(x) .

==> f(x) = (x-x1)*(x-x2)

=> f(x) = (x-2)*(x+1)

= x^2 - x - 2

==> f(x) = x^2 - x -2

**==> a= 1 b = -1 c= -2**

ax^2+ bx + c has the roots 2 and -1.

We can write ax^2 + bx + c as (x - 2)( x +1)

=> ax^2 + bx + c = (x - 2)( x +1)

=> ax^2 + bx + c = x^2 -2x +x - 2

=> ax^2 + bx + c = x^2 - x - 2

Now equating the coefficients of x^2 , x and the numeric term,

we get a = 1 , b = -1 and c = -2.

**Therefore a = 1, b= -1 and c =-2.**

We know that if a quadratic equation has the the roots x1 and x2, then we can write the the equation as:

(x-x1)((x-x2) = 0

We expand the left :

x^2-(x1+x2)x+x1x2 = 0

Now if x^2-(x1+x2)x+x1x2 = 0 and ax^2+bx+c = 0 are equivalent, then the coefficients of x^2 ,x and constant terms on both sides shoul bear the same ratio. Or

a/1 = b/-(x1+x2) = c/x1x2 Or

Or x1+x2 = -b/a

x1x2 = c/a.

In the given case, x1= 2 and x2 = -1.

So x1+x2 = (2-1) = -b/a. Or b =- a.

x1x2 = 2*(-1) = -2 = c /a . Or c = -2a.

Therefore ax^2+bx+c = 0 becomes ax^2-ax-2a = 0. Or

a(x^2+x-2)= 0 which is the expansion of a(x-2)(x+1) = 0.