# Can a function be differentiable on an interval, but not continuously differentiable somewhere besides an oscillating discontinuity in the derivative?

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

This function is diffrentiable everywhere and continuously differentiable everywhere except 0, where the derivative has an oscillating discontinuity. It seems like if a function is differentiable on an interval containing the discontinuity in the derivative, you couldn’t get the derivative to be discontinuous any other way besides an oscillating discontinuity because then it just wouldn’t exist. Is that true?

For example, if you tried to make the derivative a step function, the function would be piecewise linear and not differentiable when the slope changes.

• Essentially, the answer is NO. ("Essentially" used because the oscillations might not be finitely spaced like those in the example you gave.) I don't have time to write this out at the appropriate level, so here's an outline in case someone else wants a go at it. If a function $g$ is not continuous at $x=a,$ then the three values $g(a)$ and $\liminf_{x \rightarrow a}f(x)$ and $\limsup_{x \rightarrow a}f(x)$ do not all coincide. (continued) – Dave L. Renfro Oct 14 '17 at 19:11
• Since derivatives have the intermediate value property, if $g$ is a derivative that is not continuous at $x=a,$ it follows that in every open interval containing $x=a,$ the function $g$ takes ALL values in the interval $(b,B),$ where $b = \min\left\{g(a), \, \liminf_{x \rightarrow a}f(x), \, \limsup_{x \rightarrow a}f(x) \right\}$ and $B= \max\left\{g(a), \, \liminf_{x \rightarrow a}f(x), \, \limsup_{x \rightarrow a}f(x) \right\}.$ – Dave L. Renfro Oct 14 '17 at 19:15
• @PaulSinclair: I would have thought $f'(x)= 2 x \sin(x^{-1}) - \cos(x^{-1})$ for $x\not = 0$ and in any neighbourhood of $0$ takes all values in $[-\frac12, \frac12]$ and more, so does not have a limit of $0$ – Henry Dec 4 '17 at 10:03
• @Henry - you're right. I seem to have convinced myself at the time that differentiating the 2nd factor would yield a multiple of $x^{-1}$ instead of $x^{-2}$. – Paul Sinclair Dec 4 '17 at 23:46