Solving optimization problems

The optimum of a function on its allowed interval is found among critical points and endpoints, and the answer is justified by the candidates test or a sign change.

From AP Calculus AB.