# Differentiability of $\sin\left({\frac{1}{x}}\right)$

So I came across this question and have encountered pretty similar questions to this and I always have had found it difficult to understand this. One way to think about differentiability is to find whether the following limit exists and is finite,

$$\lim_{x\to a} \frac {f (x)-f (a)}{x-a}$$

How I think of differentiability (let me know if I am right) for a function is the function should be smooth ie. no abrupt changes, no cusps or any that kind of thing, which simply imply the following

1. The function should be continuous, any removable or non-removable discontinuity must not be present as that will imply that the function changed abruptly.
1. The derivative should be continuous as this would constrain the derivative from changing instantaneously at any point. We see this with modulus function which is not differentiable at zero since the derivative is discontinuous at zero.

So I often stumble upon functions like $$\sin\left({\frac{1}{x}}\right)$$, and I become a bit confused. I know that this function is not differentiable at $$0$$, since the $$\lim_{x\to 0}\frac{\sin\left({\frac{1}{x}}\right)}{x}$$ isn't finite as the numerator keeps oscillating between $$0$$ and $$1$$ and this rapid changing of the curve makes it non-differentiable at $$0$$.

But what I don't understand whether $$\sin\left({\frac{1}{x}}\right)$$ is differentiable at $$0^{+}$$ or $$0^{-}$$ ?

I am reframing my question, my confusion is due to the fact that, we say the limit of the function doesn't exist when $$x\to 0$$ but if I correctly understand the idea that $$x$$ approaching zero convey is simply that x goes closer and closer to zero (if I got this wrong correct me) without actually going to zero else the denominator would be zero. So we are apparently saying that the above function is non-differentiable at values ever so slightly greater or less than zero (depending upon which side you approach to zero on the number line) the reasoning being that the function is changing very rapidly. But if one carefully observes, the function is continuous at all the values except for $$0$$, also the derivative is continuous for that, so the above two criterion are fulfilled and the function should be differentiable at $$0^{+}$$ if not at $$0$$. So where did I go wrong?

• At any $x\neq0$, the function is differentiable, since it's a differentiable function of a differentiable function. Use the chain rule to compute the derivative, and you'll see that the derivative oscillate increasing quickly as $x\to0$ and that it may be arbitrarily large in absolute value. May 6 at 21:43
• What do you mean that you can calculate the limit for values close to zero? $\lim\limits_{x\to 0.0000000000001}\ldots$? Then note, that $0.00000000000001$ is „far away“ from $0$. May 6 at 21:43
• @Hirshy I mean the smallest value of this set (0,1] May 6 at 21:47
• Your counterexample is not good. the function $x\mapsto \sin(\frac 1x)$ is not even continuous at $0$ and we cannot speak about differentiability. We can consider $x\sin(\frac 1x)$ which is continuous but not differentiable at $0$. We cannot define a tangent line to the curve at this point. Also, this function is even, and differentiability at $0^+$ or $0^-$ is the same thing. May 6 at 21:50
• Are you required to use the definition of the derivative? It is easy to see that, for x not 0, the derivative is cos(1/x)(-1/x^2) which exist for all x not 0. And sin(1/x) itself is not defined at x= 0. So sin(1/x) is differentiable for all x except x= 0. May 6 at 21:52

The derivative exists for any $$x \neq 0$$, and is given by the chain rule: $$f'(x) = \cos(1/x) \cdot (-1/x^2) ,\qquad x \neq 0 .$$ But the derivative at $$x=0$$ does not exist, and neither do the one-sided derivatives. To investigate them, you must look at the one-sided limits $$\lim_{h \to 0^\pm} \frac{f(h)-\color{red}{f(0)}}{h} ,$$ which involve the number $$f(0)$$, which is undefined for our function $$f$$. So the limits don't exist, for the very trivial reason that the expression whose limit we are supposed to investigate doesn't exist to begin with!

Let me elaborate a little. As I think you know, when we compute the derivate of $$f$$ at some point $$a$$, what we do geometrically is to look at the slope of a line through two points on the curve $$y=f(x)$$, namely the “fixed” point $$(x,y)=(a,f(a))$$ and the “moving” point $$(x,y)=(a+h,f(a+h))$$ where $$h \neq 0$$, and see what happens to the slope of that line as $$h \to 0$$ (when the moving point moves along the curve to approach the fixed point). But if there is no point $$(a,f(a))$$ to begin with, you don't have anywhere to “attach” that line, so it doesn't even make sense to ask the question about what the slope of the curve is just there.

Another question that you could ask is whether the function $$g(x) = \begin{cases} \sin(1/x),& x \neq 0,\\ A,& x=0, \end{cases}$$ would be differentiable at $$x=0$$ for some suitable value of $$A$$. (Now the number $$g(0)=A$$ exists, so at least we have some nontrivial limit to investigate, unlike the previous case where $$f(0)$$ was simply undefined.) However, this is also not the case, since whatever value you choose for $$A$$, the function $$g$$ is discontinuous at the origin (since $$0$$ is in the domain of $$g$$, but $$\sin(1/x)$$ doesn't have a limit there), and then $$g'(0)$$ cannot exist, by the well-known theorem that differentiability implies continuity.

It's also true that the limits $$\lim_{x \to 0^\pm} f'(x) = \lim_{x \to 0^\pm} \bigl( \cos(1/x) \cdot (-1/x^2) \bigr)$$ do not exist for our function $$f$$, but that's a different question. In that case, for each $$a \neq 0$$ you do the above investigation with the line between a fixed point and a moving point, so that you know what the slope is at any point $$a \neq 0$$, and after you've done that, you see what happens to the slope as $$a \to 0$$. But that does not necessarily give the same result as attaching the line to the fixed point $$(x,y)=(0,f(0))$$ (if there is such a point) and investigating what happens when the moving point approaches that point. (Although if you add some additional assumptions, it actually does; see for example this question and its countless duplicates.)

• But going through those questions, I guess only assumption I could get was that the function should be defined at the point at which we are trying to find the derivative which was already visible from your answer but I just can't see the others so immediately, it would be great if you could point them as well. May 8 at 20:27
• The assumptions are right at the beginning of the question I linked to: the function should be not only defined but also continuous at the point in question, and the limit of its derivative as you approach that point should exist. May 9 at 4:53

$$0^+$$ refers to a limit as you approach $$0$$ from the right.

So taking a value $$a$$, we can calculate the derivative there, and then try to take the limit as $$a \to 0^+$$.

$$\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{h \to 0} \frac{\sin(1/(a+h))-\sin(1/a)}{h}$$ which, using more calculus, gives $$-\frac{1}{a^2}\cos(\frac{1}{a})\cdot$$ which oscillates more and more wildly as $$a \to 0^+$$ and so does not have a limit.

• It doesn't blow up as $a\to0^+$. It oscillates. On the sequence $\frac2\pi,\frac2{3\pi},\frac2{5\pi},\dots$ it goes to $0$. May 6 at 21:54
• @saulspatz Well, it does both. May 6 at 21:55
• I am having difficulty understanding the question (the asker has not really done a good job of explaining what their confusion is, despite a lot of interaction in the comments). As such, I am really uncertain about how your answer addresses the question. It might be better to seek clarification from the asker before answering, as it is highly likely that the question will later be edited to aid clarity. May 6 at 22:07
• Derivatives don't need to be continuous. This doesn't address differentiability at $0$. May 6 at 22:09
• @UmbertoP. Indeed, the asker could be asking about Dini derivatives for all I know. My real point is that the question is not clear, and that the answer here is not obviously not an answer to the question, as the asker has not really done a good job of explaining what their misunderstanding is. May 7 at 0:31

Take $$\xi=\frac1x$$, then $$f(x)=\frac{sin({\frac 1x})}{x}=\xi\sin(\xi)=g(\xi)$$ and $$x\to 0^\pm\implies \xi\to\pm\infty$$

So, your question is equivalent to asking if $$g$$ is differentiable at $$\pm \infty$$.

Slightly abusing notation, $$g(\pm\infty)=\lim_{\xi\to\pm\infty} \xi\sin(\xi)$$ does not exist. This is because periodic functions do not have infinite limits. I attached the graph below, you can see the function oscillates between $$\pm\infty$$ on both sides.

Graph of g

However, so long as $$\xi$$ is finite, $$g$$ is defined, and we can show the derivative exists. This in turn means that $$f$$ is defined and differentiable for every $$x\neq 0$$.

• I am having difficulty understanding the question (the asker has not really done a good job of explaining what their confusion is, despite a lot of interaction in the comments). As such, I am really uncertain about how your answer addresses the question. It might be better to seek clarification from the asker before answering, as it is highly likely that the question will later be edited to aid clarity. May 6 at 22:07
• I took "But what I don't understand whether $\sin\left({\frac{1}{x}}\right)$ is differentiable at $0^{+}$ or $0^{-}$?" as the question. My answer resolves that as a no, because you can't determine the limit in either case. I introduce $\xi$ because the graph of $f$ is a jumbled mess around $0$, while its much easier to see that the infinite limits of $g$ are indeterminate May 6 at 22:18
• @RhysHughes It is indeed what I what my question is. May 6 at 22:22
• @buddy001 Does my answer make sense to that end? May 6 at 22:33
• It does, it is actually one way I look at it, I've edited my question because it was not very clear what my confusion is so if you could give it a read again. May 7 at 8:01