# If $f \in C([a, b],\mathbb{R})$ is differentiable on $(a,b]$ and $\lim_{x\to a}f'(x)$ exists, then $f\in C^1([a, b],\mathbb{R})$?

The following is exercise IV.2.3. from Analysis I by Amann and Escher.

Let $-\infty < a < b < \infty$ and $f \in C([a, b],\mathbb{R})$ be differentiable on $(a, b]$. Show that, if $\lim_{x\to a} f'(x)$ exists, then $f$ is in $C^1([a, b],\mathbb{R})$ and $f'(a) = \lim_{x\to a} f'(x)$. (Hint: Use the mean value theorem.)

I think this is false and found a counterexample: Set $b=0$ and define $f:[a,0]\to\mathbb{R}$ by $$f(x):= \begin{cases} x^2\sin(1/x),&x\in[-a,0);\\ 0,&x=0. \end{cases}$$ The function $f$ satifies all the hypotheses but $f'$ is not continuous at $x=0$.

Am I right?

Edit: My point is that $\lim_{x\to a} f'(x)$ does not imply $f\in C^1([a, b],\mathbb{R})$, or, roughly speaking, the continuity of $f'$ at $x=a$ does not imply its continuity on the whole interval. However, the second conclusion, $f'(a) = \lim_{x\to a} f'(x)$, is correct.

• @Thomas But I think the hypothesis did not say that... – Colescu Jan 21 '18 at 13:06
• @Colescu That's exactly what the hypothesis says. – José Carlos Santos Jan 21 '18 at 13:07
• @Thomas If you'll post your comment as an answer, I will upvote it. – José Carlos Santos Jan 21 '18 at 13:08
• @JoséCarlosSantos thanks, but no. – Thomas Jan 21 '18 at 13:10
• @Colescu The statement asked to be prove, as stated, is clearly wrong by the very reason you mentioned. It should be either assumed that $f \in C^1((a,b],\mathbb{R})$, or the conclusion should be changed to then $f$ is differentiable at $a$ and (...). This is what the author probably had in mind. – Aloizio Macedo Jan 21 '18 at 15:33

As I said in the comments, the statement asked to be proved, as stated, is clearly wrong by the very reason you mentioned in your edit. It should be either assumed that $f \in C^1\left((a,b] \right)$, or the conclusion should be changed to then $f$ is differentiable at $a$ and (...).
Let $-\infty < a < b < \infty$ and $f \in C([a, b],\mathbb{R})$ be differentiable on $(a, b]$. Show that, if $\lim_{x\to a} f'(x)$ exists, then $f$ is differentiable at $a$ and $f'(a) = \lim_{x\to a} f'(x)$. (Hint: Use the mean value theorem.)
Proof: Let $L:= \lim\limits_{x\to a} f'(x)$. It follows from the hypotheses that $f$ is continuous at $[a,c]$ and differentiable at $(a,c)$ for every $c \leq b$.
Take $\epsilon>0$. By the definition of limit, there exists $\delta>0$ such that if $x< a+\delta$, then $|f'(x)-L|<\epsilon$. From the mean-value theorem we have that if $x \in (a,a+\delta),$ $$\left|\frac{f(x)-f(a)}{x-a}-L\right|=|f'(\xi_x)-L|<\epsilon,$$ since $\xi_x \in (a,x)$, hence in $(a,a+\delta)$. But this proves precisely that $f'(a)=L$.
• The "$\;C^1\;$" in the book is likely a typo..............+1 – DanielWainfleet Jan 21 '18 at 23:49