#math/calculus
Suppose $f$ is continuous on $[a,b]$ and differentiable except possibly at finitely many interior points.
1. List the endpoints $a,b$ and every critical point $x_{i}\in(a,b)$ where $f'(x_{i})=0$ or $f'(x_{i})$ does not exist.
2. Evaluate $f$ at every listed point.
3. The largest value is the absolute maximum; the smallest is the absolute minimum. Every input producing that value is a corresponding maximum or minimum point.
For $f(x)=x^{3}-3x$ on $[-2,2]$, the candidates are $-2,-1,1,2$:
| $x$ | $-2$ | $-1$ | $1$ | $2$ |
|---:|---:|---:|---:|---:|
| $f(x)$ | $-2$ | $2$ | $-2$ | $2$ |
Hence the maximum value is $2$, attained at $x=-1$ and $x=2$; the minimum value is $-2$, attained at $x=-2$ and $x=1$.
> [!Warning]
> Endpoints need not satisfy $f'(x)=0$, but they must always be checked on a closed interval.