# Let $f(x) := x^2 \sin \frac 1 x, f(0)=0$. Show $f$ is differentiable on $\mathbb R$. [duplicate]

This question already has an answer here:

Let $f: \mathbb R \rightarrow \mathbb R$ defined by $$f(x) := \begin{cases}x^2 \sin \frac 1 x\ & x \neq 0\\ 0\ & x = 0\end{cases}$$

Show $f$ is differentiable on $\mathbb R$:

Let $\epsilon > 0$.

$x_0 \neq 0$: $\left\lvert\frac {x^2 \sin \frac 1 x - x_0^2 \sin \frac 1 {x_0}}{x-x_0} \right\rvert \le \epsilon$

I'm thinking that since the fraction is continuous there exists $\delta > 0$ satisfying the above for $x \in [-\delta,\delta] / \{0\}$ ?

$x_0 = 0$: $\left\rvert\frac {x^2 \sin \frac 1 x - 0} {x} \right\rvert \le \epsilon$

How can I evaluate this limit ? I cannot say the fraction is continuous at $0$ ?

Also I must find the derivative of $f$ and show it is not continuous at $x=0$, but I'm stuck.

## marked as duplicate by Strants, Empty, user147263, Claude Leibovici calculus StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 14 '15 at 4:38

• Do you require an $\varepsilon$-$\delta$ proof? – Git Gud Apr 9 '14 at 9:21
• No probably not, but it is the formal way of doing it ? – Shuzheng Apr 9 '14 at 9:24
• It's hard to believe an $\varepsilon$-$\delta$ proof would be asked to prove this. It's probably safe to assume that you can use properties like $g,h\text{ differentiable}\implies gh\text{ differentiable}$ and so on. So you really only have to worry about proving differentiability at $0$ and to do this you just need to evaluate a limit. – Git Gud Apr 9 '14 at 9:28
• What are the points, where you may have troubles/are not sure that function is differentiable? It is only $x=0$, obviously. – sas Apr 9 '14 at 9:28
• Yes, but it is also this limit I'm having trouble evaluating. – Shuzheng Apr 9 '14 at 9:37

Proving differentiability at $0$ is equivalent to proving that $\lim \limits_{x\to 0}\left(\dfrac {f(x)-f(0)}{x-0}\right)$ exists and is finite.

This is turn is equivalent to proving the same hods for $\lim \limits_{x\to 0}\left(x\sin \left(\dfrac 1 x\right)\right)$.

The last statement above is equivalent to $$\forall \varepsilon >0\,\exists \delta >0\,\forall x\in D_f\left(0<|x-0|<\delta \implies \left|x\sin \left(\dfrac 1 x\right)\right|<\varepsilon\right).$$

To prove it recall that $\forall \alpha \in \mathbb R(|\sin(\alpha)|<1)$. Can you find $\delta$ given $\varepsilon$?

• I suggest to rather use $|\sin\alpha|\le 1$ – Hagen von Eitzen Apr 9 '14 at 9:51
• Ahh, I have $|x \sin(\frac 1 x)| \le |x|$. So I should choose $|x| \le \epsilon$ ?. I have calculated $f^{'}(x)$ as $2x \sin \frac 1 x - \cos \frac 1 x$ for $x \neq 0$ and $0$ for $x = 0$. Is there a clever way of showing that continuity doesn't hold at $x = 0$ ? – Shuzheng Apr 9 '14 at 9:53
• @HagenvonEitzen Of course, much better. Thank you. – Git Gud Apr 9 '14 at 9:53
• @user111854 Your question confuses me: "So I should choose $|x|≤ϵ$". You don't choose $\varepsilon$ and you don't choose $x$, what you choose is $\delta$. – Git Gud Apr 9 '14 at 9:55
• My point is that given $\epsilon > 0$ I must choose $\delta > 0: 0 < |x| \le \delta$ satisfies $|x| \le \epsilon$. But in this case I can choose $\delta = \epsilon$ ? – Shuzheng Apr 9 '14 at 9:57

Lemma: if $\;h,g\;$ are real functions defined in some neighborhood $\;D_0\;$ of $\;x_0\in\Bbb R\;$ s.t.

$$\begin{cases}\lim_{x\to x_0}h(x)=0\\{}\\\exists\,M\in \Bbb R\;\;s.t.\;\;\forall\,x\in D_0\;,\;\;|g(x)|\le M\end{cases}\;\;,\;\;\text{then}\;\;\lim_{x\to\ x_0}h(x)g(x)=0$$

The proof is boringly simple, and it gives you what you want since

$$\frac{f(x)-f(0)}{x-0}=x\sin\frac1x$$

and $\;\sin\frac1x\;$ is bounded in a neighborhood of zero....