.
The solution in the post by @parmen is INCORRECT.
It is incorrect, because it uses in the analysis the value = -2,
while the argument is OUT of the domain of the function, which (the domain) is [-1,2].
The correct answers are
The extrema of the function are:
* Maximum value: 2 at x =
* Minimum value: at x = -1