Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Till today, I always thought that if the derivative of a function is $0$ at every point in the domain, then the only functions possible for which this is true are constant functions. But, my teacher gave me the example $$f:(0,1)\cup (1,2)\to \Bbb R$$ with

$$f(x) = \begin{cases}0&\mathrm{\ if\ } 0<x<1 \\ 1 &\mathrm{\ if\ }1<x<2\end{cases}$$

This function is not constant but has derivative $0$ everywhere in domain.I know it is pretty much possible because of the domain he chose, but what is special there in this domain which makes this happen.

Can anybody give some other examples not of this form (which I gave above) having derivative $0$ without function being constant.

share|cite|improve this question
up vote 4 down vote accepted

A differentiable function with zero derivative is constant on the connected components of its domain.

The function $\displaystyle f : \mathbb{R}-\mathbb{Z} \to \mathbb{R}$ given by $f(x) = \lfloor x \rfloor$ has derivative $0$ everywhere and it takes, not just 'more than one value', but in fact it takes infinitely many values $-$ you can't even bound it! But it is constant on all of the connected components of its domain; explicitly, $f|_{(n,n+1)}(x) = n$ for all $x \in (n,n+1)$.

In fact, any step-function will do, provided you remove the points at which it is not continuous from its domain.

share|cite|improve this answer
so, if my domain is connected, then the only class of functions possible with given conditions is constant function, right?? – Aang Sep 11 '12 at 12:24
@Avatar: Yes $-$ if it's constant on the connected components of the domain, and the domain only has one connected component, then it must be constant on the whole domain! More generally, if the domain has $n$ connected components then $f$ can take $\le n$ distinct values. – Clive Newstead Sep 11 '12 at 12:24
thanks for the help; i got the idea now. – Aang Sep 11 '12 at 12:27

Have you considered the function $f: \mathbb R\setminus\{0\} \to \mathbb R$ defined by $f(x):=\arctan(x)+\arctan(1/x)$?

Anyway this is not a real answer to your question. Indeed, the following theorem holds true:

If $f\colon A\subset \mathbb R \to \mathbb R$ is differentiable at every point of $A$ with $f'(x) \equiv 0$ then $f$ is constant on every connected component of $A$.

So the "key" to understand the examples lays in the topological properties of the domain. If the set $A$ is connected then every differentiable function $f :A\to \mathbb R$ with zero derivative (everywhere) is constant.

Hope this helps.

share|cite|improve this answer
thanks for your help too!! – Aang Sep 11 '12 at 12:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.