2

The function

$$f(x)=\begin{cases}\ x^2\sin\left(\frac1{x}\right), x\ne0\\ 0,x=0\end{cases}$$

is differentiable everywhere. My question by taking the limit definition of the function at $x=0$: $$\lim_{h \to 0} \frac{f(0+h)-f(0)}{h} = \lim_{h \to 0}\frac{h^2\sin\left(\frac1{h}\right)}{h}=\lim_{h \to 0}h\sin\left(\frac1{h}\right) =0$$ So the function is differentiable at $0$ and the derivative is equal to $0$, but if we take the derivative for any point: $$2x\sin\left(\frac1{x}\right)−\cos\left(\frac1{x}\right)$$ at $x=0$ this function is undefined. Do these two definitions disagree because the derivative is discontinous at $0$? How can the function be differentiable if the derivative of the function is discontinous or undefined at that point? How can these two definitions disagree?

Integreek
  • 8,530
  • Remark - using $\sin x$ makes $\sin x$ which looks a lot nicer than $sin x$. – Sean Roberson Nov 14 '24 at 17:01
  • 7
    The two aren't definitions. One follows from a definition, the other follows from an incorrect inference. They don't agree because the whole point of this example is, derivatives can exist and still not be continuous. Your inference is based on an assumption that this is not true. – Thomas Andrews Nov 14 '24 at 17:03
  • This is a followup to your previous question at https://math.stackexchange.com/questions/4998377/how-can-a-differentiable-function-not-have-a-continous-derivative – Ethan Bolker Nov 14 '24 at 17:08
  • 1
    The derivative is not undefined at $x=0.$ You've proved that. $x^2\sin(1/x)$ is also undefined at $x=0,$ of course, so the there is no reason to think the formula for $x\neq0$ would work at $x=0.$ – Thomas Andrews Nov 14 '24 at 17:14
  • It might be instructive to graph the function $f$ for small $x.$ It makes clear how the function is smooth at $x=0,$ but how the derivatives close to zero bounce around very quickly. – Thomas Andrews Nov 14 '24 at 17:20
  • You’re assuming that the derivative is continuous at $x=0$, which isn’t the case. Hence, in such cases, you should go by the fundamental way, i.e., the first principle of differentiation. – Integreek Nov 14 '24 at 17:20
  • Yes, the derivative is discontinuous at $0$; $f'(0)$ is defined, but $\lim_{x\to0} f'(x)$ is not defined. – md2perpe Nov 15 '24 at 22:58

1 Answers1

3

The underlying issue is this: the expression $f'(x) = 2x\sin(1/x)-\cos(1/x)$ is obtained using a combination of the chain and product rules. And all of those rules have the implicit hypothesis that all of the derivatives of the component pieces exist.

So in particular at $x=0$ the function $\sin(1/x)$ does not even have a value, so it makes no sense to apply the chain and product rules to compute the derivative at $x = 0$.

In general, the difference quotient definition always takes priority. It is THE definition of a derivative, and any rules and tricks you know are just tricks to help compute this limit without having to actually figure out the difference quotient.


In summary, $f'(0) = 0$ because that's what the definition gives. And $f'(x)$ for $x \neq 0$ is given by the formula you found.

Interestingly, this shows that a function with a derivative that exists everywhere can still have a discontinuous derivative!