You check the values of the function at the endpoints, that is at the points & .
Now, since your function is not differentiable at , you cannot use the derivative at .
So if you limit yourself to and when performing you differentiate and look for max/min, and check the function value at .
Now you compare all the values you have. That is, you have your endpoint values, your value at , and possibly some values at local max/min which you may have found during the differentiation.