Does $\dfrac{d}{dx} f(x) = 0 \Rightarrow f(x)$ is a constant function?

376 Views Asked by At

I've heard this claim many times, that when the derivative of a function is $0$ everywhere in its domain, then that function is a constant function.

But what about functions like the following two:

$$f : (4,6)\cup (6,7) \to \mathbb{R}$$

$$f(x) = \begin{cases} 2, \, x \in (4,6) \\ \\ 7, \, x \in (6,7) \end{cases} $$

Here, $ f'(x) = 0, \, \forall x \in D_f$, where $D_f$ stands for domain of $f$.

I'm writing this after I read the proof of something similar to it in this question here:

If the derivative of a function is zero, is the function a constant function?

3

There are 3 best solutions below

2
On

When the derivative is zero everywhere in an open set $S$, the function is locally constant in $S$. If the set $S$ is connected, that implies the function is constant. If the set is not connected, then there are examples of locally constant functions that are not constant.

What is additionally confusing is that the "domain of a function", i.e. the set where it is defined, may not be a "domain", which means an open and connected set. On "domains", derivative zero means the function is constant.

0
On

No. If $f'(x)=0$ on an interval I, then $f$ is constant on the interval I.

If $f'(x)=0$ on another interval J, then $f$ is constant on the interval J, but $f$'s value on $J$ might not be the same as f's value on $I$.

0
On

The claim you cited is only true if the domain $D_f$ is connected. The set $(4,6)\cup (6,7)$ is not connected.