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.