Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, I'm given: $$f(x) = \left\{\begin{array}{ll} x^2\sin\left(\frac{1}{x}\right) & \mbox{if $x\neq 0$,}\\ 0 &\mbox{if $x=0$.} \end{array}\right.$$

I'm asked to show that this piecewise function is both continuous and differentiable on the real number line.

I'm not sure how to state what I know, i.e. that since $x^2$ and $\sin(1/x)$ are both continuous and differentiable on their domains, the product is also continuous and differentiable (on their domains where obviously $\sin(1/x)$ can't have $x = 0$.) But that case is covered since $f(x) = 0$ when $x = 0$.

I guess I just to know how I would state all that in a mathematically accurate fashion.

Any assistance is greatly appreciated.

share|cite|improve this question
I have explained this as part of another answer over here.… – user17762 Mar 10 '11 at 20:20
For future reference, $\neq$ is obtained by using \neq. – Arturo Magidin Mar 10 '11 at 20:39
up vote 8 down vote accepted

Differentiability at a point implies continuity at that point. Since $\sin$ is differentiable, $1/x$ is differentiable, $x$ is differentiable, compositions of differentiable functions are differentiable, and products of differentiable functions are differentiable, it follows that $f$ is differentiable at each nonzero point. To show that $f$ is differentiable at $0$, compute $f'(0)$ using the definition of the derivative. Once you know this exists, you'll know that $f$ is differentiable, and hence continuous, on all of the real number line.

share|cite|improve this answer

use the definition of differentiability, say at 0: $$ \lim_{x\to0}\frac{f(x)-f(0)}{x-0}=\lim_{x\to0}\frac{x^2\sin(1/x)}{x}=\lim_{x\to0}\ x\sin(1/x)=0 $$ where the last step can be justified various ways. for instance $|x\sin(1/x)|\leq|x|$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.