Since f(x) has minimum value at x=-1. Therefore
And f(x) has maximum value at x=2, therefore
Thus from (i) and (ii)
Since x=-1 and x=2 are relative minima and relative maxima, therefore
Subtract (iii) from (iv),
Substitute a=-4 in (iii), we have b=24.
Thus we have a=-4 and b=24.