# Let $r \geq 0$ and $f(x)=x^r \sin \frac{1}{x}$, for $x\neq 0$ and $f(0)=0$. Which values of $r$, $f(x)$ is uniformly continuous or differentiable?

Let $r\geq 0$ and $f(x)=x^r \sin \frac{1}{x}$, for $x\neq 0$ and $f(0)=0$.

a) For which values of $r$, $f(x)$ is uniformly continuous on $(0,\pi)$?

b) For which values of $r$, $f$ is differentiable at $x=0$?

My solution.

a) $f'(x)= r x^{r-1} \sin \frac{1}{x}- \frac{x^r}{x^2}\cos \frac{1}{x}$

Then \begin{align*} |f'(x)|&\leq |r x^{r-1} \sin \frac{1}{x}| +|x^{r-2}| \quad\text{(since $\cos \frac{1}{x} \leq 1$)}\\ &\leq |r x^{r-2}|+|x^{r-2}|\quad\text{(since $|\sin y| \leq |y|$ when $0 \leq y \leq 1$)}\\ &\leq (|r|+1) x^{r-2} \end{align*}

When $x< \pi$ then $x^{r-2} < \pi^{r-2}$ iff $r-2 \geq 0$ or $r \geq 2$. Thus $|f'(x)| < (r+1)\pi^{r-2}$ and $f$ has a bounded derivative on $(0,\pi)$, and hence uniformly continuous on $(0, \pi)$.

b) $\lim_{x\to 0} \frac{f(x)-f(0)}{x-0}= \lim_{x\to 0} x^{r-1}\sin \frac{1}{x}$

When $r>1$ then this limit tends to $0$ as $x\to 0$, hence $f'(0)=0$ when $r>1$.

Am I right? Thanks so much.

• If in a you are asked about continuity why are you differentiating it ? Oct 23, 2017 at 17:06
• Yes, I am wrong. Thanks Archis
– Ross
Oct 23, 2017 at 17:23

Your answer for a) is not correct. Note that, since $f$ is continuous in $(0,\pi)$, by the extension theorem, the uniform continuity of $f$ on $(0,\pi)$ is equivalent to show that the following limits exist and they are finite $$\lim_{x\to 0^+}f(x)\quad\text{and}\quad \lim_{x\to \pi^-}f(x).$$ Can you take it from here?

Your answer for b) is correct. The function $f$ is differentiable at $0$ if and only if the following limit exists and it is finite $$\lim_{x\to 0^+}\frac{f(x)-f(0)}{x-0}=\lim_{x\to 0^+}x^{r-1}\sin \frac{1}{x}.$$ This happens if and only if $r>1$ and the derivative at $0$ is $0$.

• @Ross Sorry for the mess. Is my hint for a) of any help? Oct 23, 2017 at 17:33
• I got the answer $r>1$ from your hint. But could you please explain why by the extension theorem, the uniform continuity of $f$ on $(0,\pi)$ is equivalent to show that those limits exist and they are finite? I read that theorem but I still do not understand.
– Ross
Oct 23, 2017 at 17:36
• Basically, if $f$ is u,c, in $(0,\pi)$ then for any sequence $x_n\to 0^+$, the sequence $(f(x_n))_n$ is a Cauchy sequence and therefore it is convergent. On the other hand if the limit at the end points exist, $f$ can be extended to a continuous function in $[0,\pi]$ which is compact and therefore $f$ is u.c. in $(0,\pi)$. See also math.stackexchange.com/questions/814402/… Oct 23, 2017 at 17:44
• Thanks so much for your nice explanation. I have 1 more question, is it enough with any sequence $x_n \to 0^+$ or do we need to consider any sequence $x_n \to 0^-$
– Ross
Oct 23, 2017 at 17:58
• @Ross We need to consider any sequence which is convergent to the endpoints. Oct 23, 2017 at 23:12