1
$\begingroup$

Derivative of $x^2\sin(1/x)$ :

if we use the derivative rules to take the derivative of this function we conclude that It is not defined at x =0,

but if we use the derivative definition (lim x -> a), we get this: $$x\sin(1/x)$$ which has a derivative of 1 at 0.

Which is the answer? I mean obviously the formal defintion is right, but why does this happen?

  • 0
    @S.C.B. would you mind editing title too?2017-01-31
  • 1
    The derivative rules are relevant on the domain $\mathbb{R} \setminus \{0\}$ only. If you define $f(0) = 0$ you have to deal with that separately.2017-01-31
  • 2
    I think you're confusing $\lim_{x\rightarrow 0}\frac{x}{\sin(x)}=1$ with $\lim_{x\rightarrow 0}x\sin(\frac{1}{x})=0$2017-01-31
  • 0
    @imranfat Haha, I often forget that part the first edit through.2017-01-31

2 Answers 2

3

The derivative by product rule and chain rule for $x\ne0$ gives us

$$\frac d{dx}x^2\sin(1/x)=2x\sin(1/x)-\cos(1/x)$$

While it is true that this is undefined at $x=0$, this is simply because we are not able to apply chain rule at $x=0$. At $x=0$, we must apply the limit definition:

$$\frac d{dx}\bigg|_{x=0}x^2\sin(1/x)=\lim_{h\to0}\frac{h^2\sin(1/h)}h=\lim_{h\to0}h\sin(1/h)=0$$

which follows from the squeeze theorem:

$$-h\le h\sin(1/h)\le h$$

One may note that it is not always the case that just because a function is differentiable everywhere, then the derivative will be continuous. Such behavior is called the smoothness of a function, and it depends on how many times you can differentiate a function and still have a continuous function.

Your specific example may be found on Wikipedia as the second example of smoothness

  • 0
    Why can't we apply chain rule when x = 0 ?2017-01-31
  • 0
    @ErfanAhmadi check the requirements to use chain rule.2017-01-31
  • 0
    I don't believe I read such a thing in Thomas calculus Can you point them out?2017-01-31
  • 0
    @ErfanAhmadi ah, it may not be in the book, but to apply chain rule to $f(g(x))$, then both $g'(x)$ must exist, $f'(g(x))$ must exist, and $g(x)$ must exist. I hope that's rather obvious.2017-01-31
  • 0
    @ErfanAhmadi In standard calc books, usually they don't deal with these kind of problems, in more advanced books (or introductory real analysis) they do. So when dealing with a "hole" in the graph, one needs to resort to the limit definition of the derivative and as pointed out $f'(0)$ indeed exists. Also note that $f'(x)$ is certainly NOT continuous at zero...2017-01-31
  • 0
    @imranfat good summary of the story.2017-01-31
0

Your application of the derivative definition is mistaken. We do not get $x \sin \frac{1}{x}$. I could show you where you went wrong if you showed me how you did it. It should be $$2x \sin \frac{1}{x}-\cos \frac{1}{x}$$ So your first answer is correct. The derivative is undefined at $x=0$.

  • 0
    But $f'(0)$ does exist and is zero...2017-01-31
  • 0
    @imranfat If we define $f(0)=0$, then it exists.2017-01-31
  • 0
    Yes, I kinda made that assumption.....2017-01-31
  • 0
    @imranfat Well the OP didn't mention it so...2017-01-31
  • 0
    Not explicitly, but when he mentioned "derivative definition...." he kind of eluded in that way. Anyway, SBA pointed it our in his answer. It's a staple problem...2017-01-31
  • 0
    @imranfat Which is why he accepted SBA's answer, probably. My answer simply concerns the case when it isn't defined as such. It may not be helpful to the OP, but it answers the question in some fashion.2017-01-31