# Differentiability of $f(x)$ and continuity of $f'(x)$: same thing or different?

If a function $f(x)$ is differentiable $f'(a+)=f'(a-)$ at any point $a$ , so does it mean necessarily that $f'(x)$ is continuous at that point.

Also vice versa.. if $f'(x)$ is continuous at any point, does it mean $f(x)$ is differentiable at that point? which of above two conclusion is valid ?

My main confusion is about following question -

$$f(x)= \left\{ \begin{array}{lr} x^2 \sin\left(\frac{1}{x}\right) & x>0 \\ 0 & x=0 \\ x^2 \sin\left(\frac{1}{x}\right) & x < 0 \end{array} \right.$$ Here function is differentiable at $x=0$, but $f'(x)$ is not continuous at $x=0$ ...

-
Your example is correct. Does this resolve your question? – Ben Derrett Sep 8 '11 at 18:05
I don't understand the first sentence... – Jack Sep 8 '11 at 21:39

I have the impression that you are mixing notations. $$f'_+(a)=\lim_{x\to a^+}\frac{f(x)-f(a)}{x-a}$$ is the right derivative of $f$ at $x=a$. On the other hand, if $f$ is diferentiable on a neighbourhood of $a$, $$f'(a+)=\lim_{x\to a^+}f'(x)$$ is the limit of $f'(x)$ as $x$ goes to $a$ from the right (and similarly for $f'_-(a)$ and $f'(a-)$).

If $f$ is differentiable at $x=a$, then $f'_+(a)=f'_-(a)=f´(a)$. But if $f$ is diferentiable on a neighbourhood of $a$, $f'(a+)$ and $f'(a-)$ may not exist, as your example shows.

-
I think this is the exact answer what i wanted . still some confusion ... will ask later. thanks for ur help – No Body Sep 9 '11 at 15:23

The derivative of a function doesn't need to be continuous. Your example is one counterexample. All the problems with the considered function appear at $0$, since that's where the formula $x^2\sin \frac{1}{x}$ does not work anymore.

For a start, notice that your function is continuous, since when you take $x\to 0$ you have zero multiplied by a bounded quantity ($\sin$ is bounded).

When the function is given like this, you can study the continuity in $0$ only by definition.

$$\lim_{x \to 0} \frac{f(x)-f(0)}{x-0}=\lim_{x \to 0}x \sin \frac{1}{x}=0$$

therefore $f'(0)$ exists and it equals zero.

For every other $x\neq 0$ you can differentiate like usual, using the formulas

$$\left( x^2\sin \frac{1}{x} \right)'=2x \sin \frac{1}{x}+x^2 \cos \frac{1}{x}\left(-\frac{1}{x^2}\right)=2x \sin\frac{1}{x}-\cos \frac{1}{x}$$

Notice that this function is not continuous in $0$.

Now you have

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

a function which is not continuous.

Maybe you are asking for a criterion for differentiability of a function using a corollary of Lagrange's theorem. You can see my answer in this post for more details, but this does not apply to your case, since the limit $\lim_{x \to 0}f'(x)$ does not exist.

To answer the second part of your question, the corollary presented in the link says that if you can calculate $f'(x)$ around $x_0$ but not in $x_0$ (directly) and $\lim\limits_{x \to x_0} f'(x)$ exists and it is finite, then $f'(x_0)$ also exists and it equals the previous limit.

-

On the other hand, derivatives do have the intermediate value property; that is, if $f\colon [a, b] \to \mathbf R$ is differentiable and $f'(a) < d < f'(b)$ then there exists a $c \in (a, b)$ such that $f'(c) = d$. This is sometimes called Darboux's theorem.

It follows from this that the discontinuities of $f'$ cannot be "jumps" for which $f'(a\pm)$ both exist but are simply unequal. They have to be crazy (there might be a more precise term), as in your example.

-
For those who might be interested, derivatives satisfy a stronger version of the intermediate value property that is (often) called the Denjoy-Clarkson property. For a few details and references, see groups.google.com/group/sci.math/msg/bc4d738500d2c961 – Dave L. Renfro Sep 8 '11 at 18:49

Oh dear, I believe I misread your question initially (I didn't see the primes somewhere). If $f$ is differentiable at $x$, then $f'(x)$ need not be continuous at $x$. However, of course, if $f'$ is continuous at $x$, then certainly $f$ will be differentiable at $x$. After all, you need to know in the first place that $f'$ exists in a neighborhood of $x$ to say it is continuous there. Your example demonstrates this perfectly.

ORIGINAL ANSWER TO MISREAD QUESTION: If a function is differentiable at that point, then it must be continuous at that point.
Proof: Suppose $\lim _{h\to 0}\frac{f(x+h)-f(x)}{h}$ converges. Then, $$\lim _{h\to 0}\left[ f(x+h)-f(x)\right] =\lim _{h\to 0}\left[ h\left( \frac{f(x+h)-f(x)}{h}\right) \right] =0\cdot f'(x)=0.$$

If a function is continuous at that point, it need not be differentiable. For example, $f(x)=|x|$ is continuous at $0$, but not differentiable.

-
But OP asked about continuity of the derivative, $f'(x)$. – Shaun Ault Sep 8 '11 at 18:08
Yes, I just realized I misread the question. I kept the original answer intact, however, as the OP might find it useful anyways. – Jonathan Gleason Sep 8 '11 at 18:09
@Jonathan Gleason: More to the point, if a function is defined throughout a neighborhood of a point, then it need not be continuous at the point. Roughly speaking, user15738's question has to do with whether a counterexample can be found from among the set of everywhere differentiable functions. (Sorry, I didn't see your reply comment to Shaun Ault until after I wrote this. But maybe my comment could also be of use to the OP ...) – Dave L. Renfro Sep 8 '11 at 18:18