A **local minimum** is a point *x* for which *f(x) ≤ f(y)* for all *y* with *|x - y| < ε*. On a graph of a function, its local minima will look like the bottoms of valleys.

A **global maximum** is a point *x* for which *f(x) ≥ f(y)* for all *y*. Similarly, a **global minimum** is a point *x* for which *f(x) ≤ f(y)* for all *y*. Any global maximum or (minimum) is also a local maximum (minimum); however, a local maximum or minimum need not also be a global maximum or minimum.

Finding global maxima and minima is the goal of optimization. For twice-differentiable functions in one variable, a simple technique for finding local maxima and minima is to look for stationary points, which are points where the first derivative is zero. If the second derivative at a stationary point is positive, the point is a local minimum; if it is negative, the point is a local maximum; if it is zero, further investigation is required.

- The function
*x²*has a unique global minimum at*x = 0*. - The function
*x³/3 - x*has first derivative*x² − 1*and second derivative*2x*. Setting the first derivative to 0 and solving for*x*gives stationary points at*−1*and*+1*. From the sign of the second derivative we can see that*−1*is a local maximum and*+1*is a local minimum. Note that this function has no global maxima or minima. - The function
*|x|*has a global minimum at*x=0*that cannot be found by taking derivatives, because the derivative does not exist at*x=0*. - The function
*cos(x)*has infinitely many global maxima at 0, ±2π, ±π, ..., and infinitely many global minima at ±π, ±3π, ... . - The function
*cos(x) - x*has infinitely many local maxima and minima, but no global maxima or minima.