# A function is continuously differentiable in an open neighborhood of $x_o$ and differentiable at $x_o$, is it continuously differentiable at $x_o$?

Let $$f:\mathbb{R\to\mathbb{R}}$$ be differentiable at $$x_{0},$$ and continuously differentiable on some open neighborhood $$\mathcal{N}$$ of $$x_{o}$$. It follows that $$f$$ is continuous at $$x_{o}.$$ But, since $$\mathcal{N}$$ is open, $$x_{o}$$ is not necessarily in $$\mathcal{N}$$. So is it possible that

$$\lim_{\delta \to 0} f^{\prime}\left(x_{o}+\delta\right)\ne f^{\prime}\left(x_{o}\right)?$$

For $$\Delta x\ne0$$ and $$x_{o}+\delta+\Delta x\in\mathcal{N},$$ the continuity of $$f$$ gives us,

$$\underset{\delta\to\mathfrak{0}}{\text{Lim}}\frac{\mathit{f}\left(x_{o}+\delta+\Delta x\right)-f\left(x_{o}+\delta\right)}{\Delta x}=\frac{\mathit{f}\left(x_{o}+\Delta x\right)-f\left(x_{o}\right)}{\Delta x},$$

and therefore

$$\underset{\Delta x\to\mathfrak{0}}{\text{Lim}}\left[\underset{\delta\to\mathfrak{0}}{\text{Lim}}\frac{\mathit{f}\left(x_{o}+\delta+\Delta x\right)-f\left(x_{o}+\delta\right)}{\Delta x}\right]=f^{\prime}\left(x_{o}\right).$$

We also have

$$\underset{\Delta x\to\mathfrak{0}}{\text{Lim}}\frac{f\left(x_{o}+\delta+\Delta x\right)-f\left(x_{o}+\delta\right)}{\Delta x}=f^{\prime}\left(x_{o}+\delta\right).$$

But can we conclude $$\underset{\delta \to\mathfrak{0}}{\text{Lim}}\mathit{f}^{\prime}\left(x_{o}+\delta\right)=\mathit{f}^{\prime}\left(x_{o}\right)?$$ That is, for all $$\epsilon>0$$ can we find $$\delta$$ and $$\Delta x$$ such that $$x_{o}+\delta+\Delta x\in\mathcal{N}$$ and

$$\epsilon>\left|\frac{f\left(x_{o}+\delta+\Delta x\right)-f\left(x_{o}+\delta\right)}{\Delta x}-\mathit{f}^{\prime}\left(x_{o}\right)\right|?$$

Another way of stating the question is; can we reverse the order of the limit operation so that

$$\underset{\Delta x\to\mathfrak{0}}{\text{Lim}}\left[\underset{\delta\to\mathfrak{0}}{\text{Lim}}\frac{\Delta\mathit{f}_{x_{o}}\left(\delta+\Delta x\right)}{\Delta x}\right]=\underset{\delta\to\mathfrak{0}}{\text{Lim}}\left[\underset{\Delta x\to\mathfrak{0}}{\text{Lim}}\frac{\Delta\mathit{f}_{x_{o}}\left(\delta+\Delta x\right)}{\Delta x}\right]?$$

• I don't understand the question at all. An open neighboghood of $x_0$ surely contains $x_0$. You probably mean a deleted neighborhood of $x_0$. Mar 4, 2021 at 5:48
• Based on the title, isn't the "usual" example $f(x)=x^2\sin(1/x)$ exactly giving that? math.stackexchange.com/questions/1391544/… (I am assuming by neighborhood you mean deleted neighborhood, otherwise the question is vacuous) [Edit: "deleted neighborhood", "pointed neighborhood" was a bad French translation) Mar 4, 2021 at 5:53
• @ClementC. That's really the issue. What is meant by "neighborhood". See scribd.com/read/282634061/… Theorem III 3.3. I will post a question about that, presently. Mar 4, 2021 at 7:05
• @KaviRamaMurthy I do not take "open neighborhood $\mathcal{N}$ of x" to mean $x\in\mathcal{N}$. For the very reason at issue in my question. I took real analysis 26 years ago, and haven't set foot in a classroom in 25 years. So, even though I didn't recall the details, I sensed there was an issue; hence the question. Mar 4, 2021 at 7:55
• No problem. The standard terminology is deleted neighorhood but it is not difficult to guess what your question really says. Mar 4, 2021 at 7:58

If your $$\mathcal N$$ is deleted neighborhhod of $$x_0$$ then there is a well known counter-example: $$f(x)=x^{2} \sin (\frac 1 x)$$ for $$x \neq 0$$ and $$f(0)=0$$. In this case $$\lim_{x \to 0} f'(x)$$ does not even exist.