# Why does a local minimum or maximum need to be between an open interval?

Why does it need to be an open interval if we want to define a local maximum or minimum? Does it have to do with limits and that you cannot find the derivative of one point (let's say x) without knowing some values close to x?

• It depends on you definition of a local extremum. Commonly, the definition requires that the point be the maximum point in some neighborhood contained in the domain, which means the point must be an interior point. For an open set, every point is an interior point. But this is just convenience. You can easily modify the definition. – Emily Jul 11 '13 at 19:50

It doesn’t: if $D$ is the domain of $f$, $f$ has a local maximum at $x=a$ if $a\in D$ and there is an open interval $I=(a-\epsilon,a+\epsilon)$ such that $f(a)\ge f(x)$ for all $x\in I\cap D$. If $D=[1,2]$, it’s entirely possible for a function $f$ with domain $D$ to have a local maximum at $x=2$; the function $f(x)=x$, considered only as a function on $D$, is an example of such a function. If $D=[1,2]\cup\{3\}$, it’s possible for a function with domain $D$ to have a local maximum at $x=3$. In fact it must. To see why, consider the example of the function $f$ defined by
$$f(x)=\begin{cases}0,&\text{if }1\le x\le 2\\-1,&\text{if }x=3\;.\end{cases}$$
It has a local maximum at $x=3$, because if $I$ is the open interval $\left(\frac52,\frac72\right)$, $I\cap D=\{3\}$, and sure enough, $f(3)\ge f(x)$ for every $x\in I\cap D$!
In first-year calculus you’re generally looking at differentiable functions, and you’re often using the first derivative to find maxima. In order for that to work, the maximum does have to be in the interior of the domain $D$: that is, $D$ must contain an open interval about the point at which the maximum occurs. That’s why, when $D$ is a closed interval $[a,b]$, you’re taught to check $f(a)$ and $f(b)$ to see whether either of them is a local maximum as well: that can be the case even if the (one-sided) derivative is not $0$.
• Actually, if $D=[1,2]\cup \{3\}$, there is always a local maximum (and minimum) at $x=3$. – Hagen von Eitzen Jul 11 '13 at 19:54
The adjective local implies that we are looking only at points nearby, i.e. it is possible that at some far away point a greater value is assumed. Local maximum has nothing to do with existence of limits or derivatives. The function $f\colon[0,1]\to\mathbb R$, $x\mapsto x$ has a local (and global) maximum at $x=1$ even though the derivative there is nonzero. The function $f\colon \mathbb Q\to \mathbb R$, $\frac ab\mapsto \frac1b$ if $\frac ab$ is in shortest terms (i.e. $\gcd(a,b)=1$) has a local maximum at every(!) point $x\in\mathbb Q$, even though $f$ is nowhere continuous, let alone differentiable and the domain does not even contain an open interval!