= Derivative criterion for monotonicity
{title2=$f'\geq0\implies f\text{ nondecreasing}$}
Let $I$ be a <real interval>, and let $f:I\to\mathbb R$ be <differentiable> in its <interior> and <continuous> at any endpoints belonging to $I$. If the <derivative> satisfies $f'(x)\geq0$ throughout the <interior>, then $f$ is a <nondecreasing function> on $I$. For $x<y$ in $I$, the <mean value theorem> supplies $c\in(x,y)$ with
$$
f(y)-f(x)=f'(c)(y-x)\geq0.
$$
Changing $\geq0$ to $\leq0$, $>0$, or $<0$ gives a <nonincreasing function>, <strictly increasing function>, or <strictly decreasing function>, respectively. The endpoint <continuity> assumption lets the <mean value theorem> apply even when $x$ or $y$ is an endpoint. https://openstax.org/books/calculus-volume-1/pages/4-4-the-mean-value-theorem[OpenStax Calculus Volume 1, mean value theorem and its monotonicity corollary]{ref}.
Conversely, if a <nondecreasing function> on a <real interval> is <differentiable> at an interior point $x$, then $f'(x)\geq0$: the <difference quotient> $(f(x+h)-f(x))/h$ is nonnegative for either sign of $h$. A <differentiable> <nonincreasing function> has <derivative> $f'(x)\leq0$. Strict <monotonicity> still only forces these weak signs: the <strictly increasing function> $x^3$ has <derivative> zero at zero. The sign of the <derivative> helps locate <intervals> of <monotonicity> when sketching a graph. https://openstax.org/books/calculus-volume-1/pages/4-5-derivatives-and-the-shape-of-a-graph[OpenStax Calculus Volume 1, derivatives and the shape of a graph]{ref}.
The <real interval> hypothesis matters because a <connected subset of the real line> contains every point between its inputs. On a disconnected <domain of a function>, positive <derivatives> need not give a <nondecreasing function>. For example, take
$$
D=(-2,-1)\cup(1,2),\qquad
f(x)=\begin{cases}x,&-2<x<-1,\\x-10,&1<x<2.\end{cases}
$$
Here $f'(x)=1$ everywhere in $D$, but $-3/2<3/2$ while $f(-3/2)=-3/2>-17/2=f(3/2)$. Each component has a <strictly increasing function>, yet their outputs are ordered the wrong way across the gap. This <function> is neither a <nondecreasing function> nor a <nonincreasing function> on all of $D$; the <mean value theorem> cannot cross the missing <interval>.
\Image[/monotonicity-derivative-and-domain.png]
{title=A zero derivative can coexist with strict increase, while a domain gap defeats the derivative test}
{description=Left: the <strictly increasing function> $f(x)=x^3$ and its <derivative> $f'(x)=3x^2$, both zero at the origin. Right: two separate graph segments with <derivative> one on $(-2,-1)\cup(1,2)$, but a lower output on the right component. Open circles exclude the four component endpoints.}
Back to article page