By Fermat's theorem, all local maxima and minima of a continuous function occur at critical points. Therefore, to find the local maxima and minima of a differentiable function, it suffices, theoretically, to compute the zeros of the gradient and the eigenvalues of the Hessian matrix at these zeros. This does not work well in practice because it requires the solution of a nonlinear system of simultaneous equations, which is a difficult task. The usual numerical algorithms are much more efficient for finding local extrema, but cannot certify that all extrema have been found.