Distinguishing differentiable and continuously differentiable functions

continuityderivativesfunctions

I came across this question as stated below:

let $g(x) = xf(x)$ where $
f(x)=
\begin{cases}
x \hspace{0.1cm}\sin(\frac{1} {x} ) &\text{if}\ x\neq 0\\
0 &\text{if}\, x= 0
\end{cases}
$


Show that $g(x)$ is differentiable at $x = 0 \hspace{0.2cm}$but $g'(x)$ is not continuous at
$x=0$

Please note that I do NOT want answers to the question

What I want to know is whether functions can exist which are differentiable but their derivative isn't continuous at that point. And, if they do exist, why would the derivative be discontinuous but the function be differentiable?

Until now, whenever they asked to check differentiability, instead of going for the limit definition, I directly differentiate the function and then check the continuity of the new function which clearly goes wrong as in this example.

Why are there functions that behave like that?

*To know exactly what I mean to ask, re-read the lines below the bold sentence.

Best Answer

For most functions that we can apply the usual "rules" of differentiation to (such as the product rule), the derivative will be continuous over any interval in which it exists. That is convenient, as it saves a lot of laborious delta-epsilon work.

In this particular case it is not hard to confirm that the derivative exists at all non-zero values of $x$, that the usual convenient rules of differentiation give the same formula for the derivative at all non-zero $x,$ and that there is no possible value of the derivative at $x$ that would make the derivative continuous there.

On the other hand, if we compute the derivative from first principles (delta-epsilon), we find that it exists at $x = 0$ and we can find the value of the derivative there.

For an intuitive notion of how to construct a function with such bizarre properties as this, note that the factor $\sin(1/x)$ puts an infinite number of oscillations into the function near $x = 0.$ The factor $x^2$ (in $g(x) = x f(x) = x^2 \sin(1/x)$ when $x\neq 0$) "suppresses" the effect of those oscillations on the slope of the secant lines through $(0,g(0)),$ but it still allows the derivative oscillate between values that don't converge as we approach $x = 0$ from either side.

If we consider $f(x)$ then the oscillations of $\sin(1/x)$ near $x = 0$ would prevent convergence of the slopes of the secant lines at $(0,f(0))$. On the other hand, the derivative of $x^2 f(x)$ is continuous. That is, if we only multiply $\sin(1/x)$ by $x$ when $x \neq 0,$ it does not "suppress" the oscillations enough to allow defining the derivative at $x=0$; but if we multiply by $x^3$ it "suppresses" the oscillations so thoroughly that it suppresses the discontinuity of the derivative too.