# Is it true that if the derivative of a function is not continuous then the function is not differentiable?

It has been along time since I did real analysis. Someone asked me this question and I could not respond. I am not sure if this is the right place to ask.

He said:

The function $f: [0, \infty)\mapsto [0, \infty)$ given by $f(x)=\sqrt{x}$ is not differentiable at $0$ because its derivative $f'(x)=1/(2\sqrt{x})$ is not continuous at $0$.

I said (what I could remember):

It is not differentiable at $0$ because $\lim_{x\to 0}(f(x)-f(0))/(x-0)=\infty$.

He said that I know that but what I told is it true?

• Hopefully your natural reaction would be that this is not true, since in general one can't show that a function doesn't exist by showing "if it did exist, then it would not be continuous". – Dave L. Renfro Aug 3 '16 at 19:13
• @TonyS.F. Actually, no; they are not saying the same thing. See my posted answer for a classical example of a function that is everywhere differentiable, but not continuous everywhere. – Mark Viola Aug 3 '16 at 19:25
• A meta/rule-of-thumb argument: if that were true, why on Earth would we have two separate concepts for "differentiable" and "continuously differentiable"? – Clement C. Aug 3 '16 at 19:42
• Possible duplicate of Discontinuous derivative. – user541686 Aug 3 '16 at 20:14
• Your friend is wrong: as $f'$ isn't defined for $x=0$ it is neither continuos nor discontinuous, it simply doesn't exist. – Michael Hoppe Aug 4 '16 at 10:36

The derivative $f'(x)$ of a differentiable function, $f(x)$, need not be continuous itself. A classical example is the function

$$f(x)=\begin{cases}x^2\sin(1/x)&,x\ne0\\\\0&,x=0\end{cases}$$

Then, we have

$$f'(x)=\begin{cases}2x\sin(1/x)-\cos(1/x)&,x\ne0\\\\0&,x=0\end{cases}$$

Clearly, $\lim_{x\to 0}f'(x)$ does not even exist while $f'(0)=0$ as shown by

$$f'(0)=\lim_{h\to 0}\frac{h^2\sin(1/h)-0}{h}=0$$

Hence, we have an example of a function that is differentiable at $x=0$ although it derivative is discontinuous at $x=0$.

Another counterexample, which has the additional property $\limsup\limits_{x\to 0^+} f'(x)=\infty$ and $\liminf\limits_{x\to 0^+} f'(x)=-\infty$ is $$f(x):=x^2\left( \sin\frac1x\right)\ln\lvert x\rvert$$ whose derivative (basically the same reason as DR.MV's answer) is $$f'(x)=\begin{cases}2x\left( \sin\frac1x\right)\ln\lvert x\rvert-\color{blue}{\left(\cos\frac1x\right)\ln\lvert x\rvert}+x\sin\frac1x&\text{if }x\ne0\\ 0&\text{if }x=0\end{cases}$$

However, there are restrictions on how a derivative can be discontinuous at a given point. For instance, an interesting question for the sake of your problem is:

Let $f$ be a differentiable function $[0,\varepsilon)\to \Bbb R$. Can $\lim\limits_{x\to0^+} f'(x)=\infty$ hold?

The answer is no: in fact, assume as a contradiction that this were the case. Then, by extending $f$ to $$\overline f(x):=\begin{cases} f(x)&\text{if }x\in[0,\varepsilon)\\ f'(0)x+f(0)&\text{if }x<0\end{cases}$$

we can assume that $f$ is a differentiable function on $(-\infty,\varepsilon)\ni 0$ with constant derivative for $x\le0$.

Now, due to Darboux's theorem, the image under $f'$ of any interval $(-\delta,\delta)$ must be an interval $I$ containing $f'(0)$. But this cannot be the case, because, since $\lim\limits_{x\to 0^+}f'(x)=\infty$, $\{f'(0)\}\subsetneqq f'(-\delta,\delta)\subseteqq \{f'(0)\}\cup [f'(0)+1,\infty)$ for $\delta$ sufficiently small. Absurd.

With the same idea, you can also prove that the derivative of a function, though it can be discontinuous, it cannot have jump discontinuities.

Added: To spill the beans, at each point $x$ it must hold $$\liminf_{t\to x^+} f'(t)\le f'(x) \le \limsup_{t\to x^+}f'(t)\\ \liminf_{t\to x^-} f'(t)\le f'(x) \le \limsup_{t\to x^-}f'(t)$$

• For reference: Darboux's theorem states that if $f$ is a real-valued, differentiable function, then $f'$ has the intermediate value property. – Clement C. Aug 3 '16 at 19:51
• I was going to point out both of your points. An example of a differentiable function with unbounded derivative that seems simpler to me is given by $x^2\sin(1/x^2)$. – David C. Ullrich Aug 3 '16 at 19:53
• @DavidC.Ullrich In fact, while I was juggling with logarithms, I started wondering if I was overcomplicating. How could I not think of it? :D – user228113 Aug 3 '16 at 19:55
• What does the subset symbol with the equal/different sign below it mean? "$\subsetneqq$" – someonewithpc Aug 3 '16 at 23:09
• @someonewithpc "$A\subsetneqq B$" (or "$A\subsetneq B$") means "$A\subseteq B$ but $A\neq B$". – user228113 Aug 3 '16 at 23:15

However, continuity is required when we say that a function $f$ is in $\mathcal{C}^1(I)$ (here $I$ is an interval): $f$ is in $\mathcal{C}^1(I)$ if it is differentiable in $I$, and the derivative is also continuous in $I$.
In this context, the example given by Dr MV is an example of a function which is differentiable everywhere, but does not belong to $\mathcal{C}^1(\mathbb{R})$.