# A question about existence of derivative of function at Zero

Assume that $f:\mathbb{R}\to\mathbb{R}$ is continuous and differentiable everywhere but at $0$.

If $\displaystyle\lim_{x\to0} f'(x) = L$ exists, then does it follow that $f'(0)$ exists?

Prove or disprove.

I think it has to be true. I know that by definition $\displaystyle f'(0)=\lim_{h\to0}\frac{f(h)-f(0)}{h}$, but I could not able to further steps from here. could you please help me out.

• Analyse the function $f(x) = x^2$ for $x \ne 0$ and $f(0) = 1$ – vonbrand Oct 3 '15 at 16:07
• Doesn't the existence of the limit imply the existence of the derivative at the point? – najayaz Oct 3 '15 at 16:07
• @G-man: The function is actually not continuous. "Assume that f:R↦Rf:R↦R is continuous and differentiable everywhere but at 0." – Daniel R. Collins Oct 3 '15 at 16:43
• Comments below show there's a difference in opinion about parsing the assumption as "(continuous and differentiable) everywhere but at 0" versus "continuous and (differentiable everywhere but at 0)". Perhaps clarification is needed on that point. – Daniel R. Collins Oct 3 '15 at 16:54
• @DanielR.Collins: If it were continuous everywhere but differentiable only everywhere but at $x = 0$, then the limit of the derivative at $x = 0$ could not exist and equal $L$. – Brian Tung Oct 3 '15 at 16:56

By the mean value theorem there is $c_h\in(0,h)$ such that

$$\frac{f(h)-f(0)}h=f'(c_h)$$ so pass to the limit $h\to0^+$ and you get $f_r'(0)=L$. Similarly you get $f'_l(0)=L$. Conclude.

• What if $f(0)$ isn't defined, or is just different from $\lim_{x \to 0} f(x)$? – vonbrand Oct 3 '15 at 16:11
• @vonbrand $f$ is assumed to be continuous. – Cameron Williams Oct 3 '15 at 16:13
• If $f$ isn't defined on $0$ then there is no possibility to get that $f$ is differentiable at $0$ and the question in this case doesn't make sense@vonbrand – user66407 Oct 3 '15 at 16:15
• @DanielR.Collins The intended grouping is "Assume that $f\colon \mathbb{R}\to \mathbb{R}$ is continuous and (differentiable everywhere but at $0$)", not "… (continuous and differentiable) everywhere but at $0$". – Daniel Fischer Oct 3 '15 at 16:48
• @DanielR.Collins: I agree with Daniel Fischer here. With the "(continuous and differentiable)" interpretation, the word "continuous" would be completely redundant... – Hans Lundmark Oct 3 '15 at 17:03

This is an application of L'Hospital's Rule:

$$f'(0) = \lim_{t \to 0} \frac{f(t)-f(0)}{t-0} = \lim_{t \to 0} f'(t)=L$$

where the second equality is given by the rule.

• Doesn't L'Hospital's Rule require that both nominator and denominator are both $0$ or both $\pm\infty$? To use it you would have to assume that $\lim_{t \to 0} (f(t) - f(0)) = 0$ so $\lim_{t \to 0} f(t) = f(0)$ and therefore the function would be continuous at $f(0)$. But as function may not be continuous at $f(0)$ then there is no reason for $\lim_{t \to 0} f(t) = f(0)$ and the nominator might not tend to 0. So $\lim_{t \to 0} \frac{f(t) - f(0)}{t - 0}$ might also diverge or not even exist (Take $f(x) = \frac{1}{x}$ for $x \neq 0$ and $f(0) = 0$ or $f(x) = e^{-\left|x\right|}$). – Maciej Piechotka Oct 3 '15 at 19:48
• @ MaciejPiechotka The function is not differentiable at 0 (a priori) but it is continuos at 0. If the function is not even continuos at 0, then the statement of the problem is not true. See @DanielR.Collins comments above. – Roberto Nunez Oct 3 '15 at 23:38
• Still $f(x) = e^{-\left|x\right|}$ is continuous at $0$ as $\lim_{x \to 0^+} e^{-\left|x\right|} = \lim_{x \to 0^-} e^{-\left|x\right|} = e^{-\left|x\right|} = 1$. Or even simpler $f(x) = |x|$. – Maciej Piechotka Oct 3 '15 at 23:56
• @ MaciejPiechotka these functions don't satisfy $\lim{x \to 0} f^{'}(x)=L$ for any L, which is one of the hypothesis. – Roberto Nunez Oct 4 '15 at 0:02
• Sorry. Missed that one. – Maciej Piechotka Oct 4 '15 at 0:14

There is an ambiguity in your question. I assume you mean $f(x)$ is continuous everywhere but at $x=0$ and differentiable everywhere but at $x=0$. In this case what you said and the converse of what you said can be violated.

I give you some examples. Consider the following function

$$f(x) = \left\{ \matrix{ {x^2}\sin ({1 \over x})\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x \ne 0 \hfill \cr 0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x = 0 \hfill \cr} \right.$$

It's derivative is

$$f'(x) = \left\{ \matrix{ 2x\sin ({1 \over x})\, - \cos ({1 \over x})\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x \ne 0 \hfill \cr 0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x = 0 \hfill \cr} \right.$$

You can simply see that $f'(0)$ exist since

$$f'(0) = \mathop {\lim }\limits_{x \to 0} {{f(x) - f(0)} \over {x - 0}} = \mathop {\lim }\limits_{x \to 0} {{f(x)} \over x} = \mathop {\lim }\limits_{x \to 0} {{{x^2}\sin ({1 \over x})} \over x} = \mathop {\lim }\limits_{x \to 0} x\sin ({1 \over x}) = 0$$

but $\mathop {\lim f'(x)}\limits_{x \to 0}$ doesn't exist. Hence, the existence of $f'(0)$ doesn't imply the existence of $\mathop {\lim f'(x)}\limits_{x \to 0}$.

The vice versa can also happen, i.e., $\mathop {\lim f'(x)}\limits_{x \to 0}$ exists but $f'(0)$ doesn't exist. For this case you can consider the following simple function

$$f(x) = \left\{ \matrix{ \sin (x)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x \ne 0 \hfill \cr 1\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,x = 0 \hfill \cr} \right.$$

which is a discontinuous function at $x=0$ and hence $f'(0)$ doesn't exist but simply you can check that $\mathop {\lim f'(x)}\limits_{x \to 0}$ exists.

• Irrelevant. The first example just shows that the converse is false. The last example doesn't apply because the OP assumed $f$ was continuous. – David C. Ullrich Oct 3 '15 at 16:38
• About the first part you are right. I just wanted to say the converse is also false. About the second part, question says that it can be discontinous at $x=0$! :) – Hosein Rahnama Oct 3 '15 at 16:44
• @H.R.: The only reasonable interpretation of the question is "assume $f$ is continuous (everywhere), and also assume $f$ is differentiable for $x \neq 0$". Otherwise the word "continuous" would be superfluous. – Hans Lundmark Oct 3 '15 at 16:55
• @ Hans Lundmark: I do not agree with you! When $f(x)$ is not differentiable at $x=0$, there are two possibilities for continuity at $x=0$. This makes an ambiguity in the question. – Hosein Rahnama Oct 3 '15 at 17:05
• I agree with you that the question is sloppily formulated, and in principle can be interpreted in several ways. But the only interesting interpretation is the one where you assume that $f$ is continuous at 0, since if not, (1) obviously $f'(0)$ couldn't exist, and (2) continuity at the other points would be automatic, so why mention it at all? (I didn't downvote your answer, by the way.) – Hans Lundmark Oct 4 '15 at 8:58

If you take:

\begin{align} f(x) = \begin{cases} x^2 & x \ne 0 \\ 1 & x = 0 \end{cases} \end{align}

then $f'(x) = 2 x$ unless $x = 0$, and $\lim_{x \to 0} f'(x) = 0$. But the definition of the derivative at $x = 0$ yields:

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

This just doesn't exist. The derivative has a "hole" (more precisely, a removable singularity) at $x = 0$.

• Irrelevant. Just shows that the converse of what the OP wants to prove is false. – David C. Ullrich Oct 3 '15 at 16:39
• I upvoted because I think you have a correct counterexample. But I think a bit more explanation as to why "this just doesn't exist" is appropriate. – Daniel R. Collins Oct 3 '15 at 16:48
• Thank you all, for your comments. I got it very clearly. – user145993 Oct 3 '15 at 19:31
• Where you wrote $$\lim_{h \to 0} \frac{f(h) - f(0)}{h} = \frac{h^2 - 1}{h}$$ you need $$\lim_{h \to 0} \frac{f(h) - f(0)}{h} = \lim_{h\to0} \frac{h^2 - 1}{h}.$$ – Michael Hardy Aug 26 '17 at 23:13