Fermat's Theorem and extreme values. Concavity of a function and sign of second derivative. Second derivative test for local extreme values.