For a differentiable function on an open domain, an interior local extremum has zero gradient. This condition is necessary, not sufficient. For two variables at a critical point, let D=f_xx f_yy−(f_xy)². If D>0, f_xx>0 gives a strict local minimum and f_xx<0 gives a strict local maximum; D<0 gives a saddle. These tests require suitable second-derivative regularity near the point.
When D=0 the second-derivative test is inconclusive, not evidence of a saddle. The functions x⁴+y⁴ and x⁴−y⁴ have the same zero Hessian at the origin, but one has a strict minimum and the other changes sign. Evaluate along contrasting directions or use a direct inequality. For a quadratic form, positive definiteness gives a more general Hessian interpretation.
On a smooth equality constraint g(x,y)=c with nonzero gradient g, solve gradient f=lambda gradient g together with g=c. These equations generate candidates; they do not classify or guarantee a global extremum. If the constraint gradient vanishes, the regularity condition fails and the multiplier equations can miss a constrained extremum. Treat such points separately. For x²+y²=a and xy=b>0, (x−y)²=a−2b shows necessity a≥2b. It is also sufficient: take s=√(a+2b), d=√(a−2b), x=(s+d)/2 and y=(s−d)/2. These real values have xy=b and x²+y²=a. A minimum condition alone needs this attainment check to establish solvability.
A continuous function on a compact feasible set attains global extrema. To find them, compare all interior candidates and all boundary pieces, including corners and endpoints. For a rectangle, optimise the restrictions on each edge. For a disk, the circular boundary may use a parameter or multiplier. Solving only the unconstrained gradient ignores possible boundary winners.