# Differentiability/continuity of a piece wise function

If I have a piece wise function such that

• $x^3\sin(1/x)$, if $x \neq 0$

• $0$, if $x = 0$

Is the function differentiable and/or continuous?

So from here, I apply the definition of a derivative, where

$$(x^3 \sin(1/x))' = \lim_{h \to 0} -h \cos\left(\frac{1}{h}\right)+3h^2 \sin\left({1\over h}\right)= 0$$

The derivative is differentiable since when I apply the limit of $h \to 0$, the function = $0$ showing it is differentiable, which also implies continuity. In addition, I used $h \to 0$ to check for the break point.

Is this correct?

edit: I figured it out. thanks!

• Is there a typo in your question? $x!$ can never equal 0. – user484604 Nov 30 '17 at 16:59
• For all points, when x is not equal 0, the function is $x^3sin(1/x)$ – user13123 Nov 30 '17 at 17:01
• I think it's continuous but not differentiable at zero. How did you find limit of $h\cos(1/h)$? – Vasya Nov 30 '17 at 17:09
• It's pretty easy to show that it is continuous at x= 0. Sine of $\theta$ is always between -1 and 1 so $-x^3\le x^3sin(1/x)\le x^3$. As x goes to 0, both $-x^3$ and $x^3$ go to 0. $x^3 sin(1/x)$ is trapped between the two so its limit as x goes to 0, is also 0. That is the given value of the function at x= 0 so the function is continuous there. As for "limit of h cos(1/h)", the same argument is true: $-h \le hcos(1/h)\le h$. – user247327 Nov 30 '17 at 18:22
• Thank you @user247327 – user13123 Dec 1 '17 at 20:19