# Existence of antiderivative on a part $I$ of $\mathbb{R}$ [closed]

Let $f$ be a continuous function on a part $I$ of $\mathbb{R}$. Is they exist always a function $F$ differentiable on an interval $J$ containing I such that $F'=f$ on $I$?

If $I$ is an interval , it's ok

if $I$ is an open set , it's ok

But if $I$ is only a part of $\mathbb{R}$ ?

• No, it's not true if $I$ is open. See my answer below. – zhw. Jul 16 '18 at 15:39
• A more interesting question might be to ask if there is an open set $J$ containing $I$ for which the conclusion is true. – zhw. Jul 16 '18 at 15:52
• @Fimpellizieri Boundedness is not enough, there are things like $\sin(1/x)$ lurking about. Now if $f$ is uniformly continuous, your plan works. – zhw. Jul 16 '18 at 16:01
• @zhw there are some things I do not understand: every open set of R is a countable union of disjoint open intervals , so f admits antidérivative function in each interval – cerise Jul 16 '18 at 16:05
• @Tina True, but you told us $J$ was to be an interval. – zhw. Jul 16 '18 at 16:06

Counterexample: Let $I=(-1,0)\cup (0,1).$ Define $f(x) = 1/x$ for $x\in I.$ Then $f$ is continuous on $I.$ Let $J$ be an interval containing $I.$ Then $J$ contains $0.$ Suppose $F$ is differentiable on $J$ and $F'=f$ on $I.$ Then for small $x>0$ we have
$$F(1/2)-F(x) = \int_x^{1/2} \frac{dt}{t} = \ln (1/2)-\ln x.$$
As $x\to 0^+,$ the left side $\to F(1/2)-F(0),$ while the right side $\to \infty,$ contradiction.