# Value of $n$ for which the function $x^n \sin {\frac{1}{x}}$ is continuous at $x=0$

The question is as follows,

Determine the values of $$n$$ for which the function, $$f(x) = \begin{cases}x^n\sin\left(\frac1x\right) & ,x\neq 0 \\ 0 & ,x=0\end{cases}$$ is continuous at $$x=0$$

The way I tried to solve it is by using inequalities, starting with, $$-1 \leq \sin \left(\frac1x\right) \leq 1$$ $$-x^n \leq x^n\sin \left(\frac1x\right) \leq x^n$$ $$\lim_{x\rightarrow 0} -x^n \leq \lim _{x\rightarrow0} f(x) \leq \lim_{x\rightarrow 0} x^n$$ Which gives us, continuity $$\forall \;n$$
This seems right but I'm not sure, could someone confirm it and also is there a better method?

• Well done! Your answer is correct. The function is continuous for all $n \in \Bbb N$ Commented Jun 15, 2020 at 17:28
• what if $n=0{}$? Commented Jun 15, 2020 at 17:28
• An interesting extension is to answer the same question, but instead of asking about continuity, consider whether the 1st derivative exists. What about the 2nd derivative? n-th derivative? Commented Jun 15, 2020 at 17:29
• @BenjaminWang I will try that too :) Commented Jun 15, 2020 at 17:32
• @AnginaSeng I'm not sure since that would be an indeterminant form right? ($0^0$) Commented Jun 15, 2020 at 17:33

Let $$f_n(x) = x^n\,\sin(1/x)$$. About the easy cases first, this function is continuous when $$x$$ is away from $$0$$ by as a composition of continuous functions, and as you say, when $$n>0$$, $$|f_n(x)| ≤ |x|^n \underset{x\to 0}{\to} 0$$, so the function is also continuous in $$0$$.

Now if $$n=0$$. Take the sequence $$x_k = \frac{1}{2πk+\pi/2}$$ Then $$x_k\underset{k\to \infty}{\to} 0$$, but $$f(x_k) = \sin(2πk+\pi/2) = \sin(\pi/2) = 1$$ does not converge to $$0$$, so the function is discontinuous in $$0$$ by the sequential definition of the limit (the same is true by the way if $$n<0$$).

• Where do you see any $(x_k)^n$? The only case when I take $x_k$ is when $n=0$, so $x^n=1$ for any $x>0$ (so if you prefer, the sequence $(x_k)^0 =1$ so it converges to $1$, was that your problem?) Commented Jun 16, 2020 at 16:21
• Yes, I deleted my comment, I came to the same conclusion. Although I am wondering now, how did you come with the expression for $x_k$? After all we could take $x_k$ as $\frac{1}{2\pi k + \pi/6}$ Commented Jun 16, 2020 at 19:54
• Yes, of course, you can take a lot of different sequences that will converges to whatever value between $-1$ and $1$. I just chose $1$ to take a simple case, since you just need to find one sequence along which the function is not converging to $0$. Commented Jun 16, 2020 at 20:54

Define $$f_n(x)=x^n\sin\frac{1}{x}$$, $$x\neq0$$.

For any $$n>0$$, setting $$f_n(0)=0$$, one obtains a continuous function since $$|f_n(x)|\leq x^n\xrightarrow{x\rightarrow0}0$$.

If $$n\leq0$$, the discontinuity at $$x=0$$ is not removable as can can see by choosing sequences $$x_n=\frac{2}{\pi(2n+1)}$$ and $$y_n=\frac{1}{n\pi}$$. Both sequences converge to $$0$$ but $$f(y_n)=0$$ while $$f(y_n)$$ is highly oscillatory.