# Thread: functions differing by a constant

1. ## functions differing by a constant

Let D be a set of nonzero real numbers. Suppose that the functions $g : D \rightarrow R$ and $h : D \rightarrow R$ are differentiable and that $g'(x) = h'(x)$ for all x in D. Do the functions differ by a constant???

so we can say that:

If D is an open interval then, we can define $f = g-h : D\rightarrow R$. then we have

$f'(x) = g'(x) -h'(x) = 0$ for all x in D

So, $f : D \rightarrow R$ is constant iff g and h differ by a constant.

however, what i wanted to know is how can we assure that D is an (open) interval?

2. The answer is no, as you have apprehended. Take $D:=(-2,-1)\cup(1,2)$ and set g to be the indicator on (-2,-1) and h to be zero. Then they're derivatives are equal but they do not differ by a constant. You will need to insist that D be connected if you want this to hold.

3. Originally Posted by maddas
The answer is no, as you have apprehended. Take $D:=(-2,-1)\cup(1,2)$ and set g to be the indicator on (-2,-1) and h to be zero. Then they're derivatives are equal but they do not differ by a constant. You will need to insist that D be connected if you want this to hold.
Hi Maddas, thank you for your continual help.

I could not completely understand this reasoning. Could you please elaborate a little?

thank you

4. Maybe I misunderstood you. Let $D:=(-2,-1)\cup(1,2)$. Define

$g(x) = \begin{cases} 1, & \mbox{if } x \in (-2,-1) \\ 0, & \mbox{otherwise}. \end{cases}$

and h(x)=0. Then you can easily see that g'=h'=0 on D, but g-h=g, which is not a constant.

In general, if D is the disjoint union of several connected components, then you can treat each one "independantly", bumping a function up by a different constant on each piece without changing the derivative.