## Analysis – Increasing functions

Some of the topics discussed today in lecture came up on a question at Math.Stackexchange. I am reposting my answer here, slightly edited.

The question, by Mah Moud, was whether there can be a function whose derivative at a point is positive but the function is not increasing.

This is actually a somewhat subtle issue.

Suppose first that $I$ is an interval on $\mathbb R$, that $f:I\to\mathbb R$, that $f'(a)>0$, and that $a$ is an interior point of $I$. We could just consider one-sided derivatives if $a$ is an end-point of $I$, but that seems an unnecessary distraction.

That $f'(a)>0$ means that

$\displaystyle \lim_{h\to 0}\frac{f(a+h)-f(a)}{h}>0,$

so if $h\ne0$ is sufficiently small, we can assume both that $a+h\in I$, and that

$\displaystyle \frac{f(a+h)-f(a)}{h}>0.$

Considering $h>0$, this means that if $b>a$ is sufficiently close to $a$, then $f(b)>f(a)$. Considering $h<0$, this means that if $b is sufficiently close to $a$, then $f(b). If this is all we mean by “$f$ is increasing at $a$” then indeed $f'(a)>0$ implies that. Similarly, $f'(a)<0$ would imply that $f$ is decreasing at $a$.

The definition here would be that $k$ is increasing at $a$ iff there is an interval $I$ about $a$ such that $k(b) if $b and $b\in I$, and $k(a) if $b>a$ and $b\in I$. But, really, this is a silly notion: The function below given by

$\displaystyle k(x)=\left\{\begin{array}{cl}0&\mbox{ if }x=0,\\-x-3&\mbox{ if }-2\le x<0,\mbox{ and }\\-x+1&\mbox{ if }0

is increasing at $0$.

However, what is not true is that if $f'(a)>0$, then $f$ is increasing on an interval around $a$ (even if we assume that $f$ is differentiable everywhere). It is common to define the notions of increasing and decreasing so that they apply to functions defined on intervals, rather than to individual points of the domain: We say that $f$ is increasing on a set $A$ iff whenever $x are in $A$ then $f(x)\le f(y)$ (with $\le$ replaced by $<$ if we insist that “increasing” be interpreted in the strict sense.)

To see that indeed $f$ needs not be increasing on any interval containing $a$, no matter how small, consider the example suggested in these slides by Louis A. Talman, on The Mother of All Calculus Quizzes: Let $g(x)$ be the function given by $g(0)=0$ and, if $x\ne0$, then

$\displaystyle g(x)=\frac x2+x^2\sin\left(\frac1x\right).$

This function is differentiable everywhere, with $\displaystyle g'(0)=\frac 12+\lim_{h\to 0}\frac{h^2\sin(1/h)}h=\frac12$, and

$\displaystyle g'(x)=\frac12+2x\sin\left(\frac1x\right)-\cos\left(\frac1x\right)$

for $x\ne0$. Note that there are (both positive and negative) values of $x$ arbitrarily close to $0$ where $g'(x)<0$, so “$g$ is decreasing at $x$“. This is because we can find arbitrarily small $x$ with $\cos(1/x)=-1$, so $\sin(1/x)=0$ and $g'(x)=-1/2<0$. (Note that the $x/2$ in the definition of $g$ could be replaced with any function with small enough derivative to ensure the same behavior.)

Finally, note that $g'$ is not continuous at $0$. This is an essential feature of the example. For suppose that $f'$ exists on a neighborhood of $a$ and is continuous at $a$. If $f'(a)>0$, then for $b$ sufficiently close to $a$ we have $f'(b)>0$ as well. This means that $f$ is indeed increasing on a neighborhood of $a$. For example, if $x and they are close enough to $a$ to ensure that $f'(t)>0$ at all $t\in[x,y]$, then use the mean value theorem to see that there is a $z\in(x,y)$ with

$\displaystyle f(y)-f(x)=f'(z)(y-x)>0,$

that is, $f(x).