# Show that $f'$ is not continuous at 0 for the following function:

$$f(x) = \begin{cases} x + 2x^2\sin(1/x) & \text{ for }x \neq 0 \\ 0 & \text{ for } x = 0\end{cases}$$

This is another exam practice question I am working on.

I simply took the derivative:

$$f'(x) = 1 + 4x\sin(1/x) - 2x^4\cos(1/x)$$

Now we see that $f'$ is undefined at $x = 0$, therefore $f'$ cannot be continuous there.

Is this sufficient to answer this question? The previous part of the question required me to use the limit definition of the derivative to show that $f'(0) = 1$. Would I need to use the limit definition here as well?

Thanks for any feedback!

-

No. What you have is incorrect.

$f'(x)$ is in-fact well defined at all $x$ including $0$. Just that $f'$ is not continuous at $0$.

When you compute the derivative $f'(x)$ as $$f'(x) = 1 + 4x \sin(1/x) - 2 \cos(1/x),$$ this computation is valid only when $x \neq 0$ (There is an error in your derivative computation for $x \neq 0$. There is no $x^4$ infront off $\cos(1/x)$).

To compute the derivative at $x=0$, lets go back to the definition of the derivative at $0$. We have that $$f'(0) = \lim_{h \to 0} \dfrac{f(0+h) - f(0)}{h} = \lim_{h \to 0} \dfrac{h + 2h^2 \sin(1/h) - 0}{h} = \lim_{h \to 0} \left(1 + 2h \sin(1/h) \right) = 1$$ In the above derivation, we have used the fact that $\displaystyle \lim_{h \to 0} h \sin(1/h) =0$.

This is because of the fact that $-1 \leq \sin(1/h) \leq 1$ and hence $$-\lvert h \rvert \leq h \sin(1/h) \leq \lvert h \rvert \implies -\lim_{h \to 0} \lvert h \rvert \leq \lim_{h \to 0} h \sin(1/h) \leq \lim_{h \to 0} \lvert h \rvert$$

Whereas for $x \neq 0$, we have that $f'(x) = 1 + 4x \sin(1/x) - 2 \cos(1/x)$. Putting these together, we get that $$f'(x) = \begin{cases} 1 + 4x \sin(1/x) - 2 \cos(1/x) & x \neq 0\\ 1 & x = 0\end{cases}$$Now you can see that $f'(x)$ is discontinuous at $0$ even though $f'(x)$ is well-defined at all $x$ including $x=0$ where $f'(0) = 1$. However, \begin{align} \lim_{x \to 0} \left(1 + 4x \sin(1/x) - 2 \cos(1/x) \right) & = 1 + \lim_{x \to 0} 4x \sin(1/x) - \lim_{x \to 0} 2 \cos(1/x)\\ & = 1 - \lim_{x \to 0} 2 \cos(1/x)\\ \text{ And the above limit doesn't exists} \end{align} Hence, $\lim_{x \to 0} f'(x)$ doesn't exist. This means that even though $f'(0)$ is well-defined and in-fact $f'(x)$ is well-defined for all $x$, $f'(x)$ is not continuous at $x=0$.

-
Thank you! Very well explained! –  mathstudent Jun 13 '12 at 7:56
Enough to show $\cos(1/x)$ is not continuous at $0$, take $x_n=\frac{1}{n\pi}$ and $y_n=\frac{2}{(2n+1)\pi}$ both the sequence converges to $0$ but functional sequence $\cos(1/x_n)$ and $\cos(1/y_n)$ converges to $-1$ and $0$ respectively in different limit. So $lim_{x\rightarrow 0}\cos(1/x)$ does not exist, hence not continuous and hence your function is not continuous.