You can put this solution on YOUR website! ==> y'=.
This function is not differentiable at -2, which is safely outside [-1,2], but will always have a positive derivative whenever it exists. The function is increasing over (,-2) and (-2,). Thus the maximum value of the function over [-1,2] exists at the endpoint x = 2, with function value .