Differentiable, but not uniformly differentiable, real-valued function (on closed real interval)

calculusderivativesreal-analysis

Exercise 8 on page 114 of Walter Rudin's "Principles of Mathematical Analysis, Third Edition" has the following definition for a "uniformly differentiable function" on a closed real interval:

Suppose $f'$ is continuous on $[a, b]$ and $\epsilon > 0$. Then there exists $\delta > 0$ such that $$\left\vert\frac{f(t)-f(x)}{t-x}-f'(x)\right\vert < \epsilon$$ whenever $0 < \vert t- x \vert < \delta, a \leq x \leq b, a \leq t \leq b$. This could be expressed by saying that $f$ is uniformly differentiable on $[a, b]$ if $f'$ is continuous on $[a, b]$.

I have the following question in mind: Is there an example of a real-valued function $f$ on a closed real interval $[a, b]$ such that $f$ is differentiable, but not uniformly differentiable, on $[a,b]$? I am unable to come up with an example, and would appreciate some help. Thanks.

(I see that there is a closely related post, but it does not discuss the case of a closed real interval. Didn't find any other related post.)

Best Answer

Let $$f(x)=\cases{x^2\sin(1/x), &$x\ne0$\cr 0, &$x=0$}.$$

One may compute $$f'(x)=\cases{2x\sin(1/x)-\cos(1/x), &$x\ne0$\cr 0, &$x=0$.}$$

For any $\delta>0$, there are $x_1,x_2$ in the interval $(0,\delta)$ with $x_1\ne x_2$, $f'(x_1)=-1$ and ${f(x_2)=f(x_1)}=0$ (look at points $x$ where $\cos(1/x)=1$). This implies $f$ is not uniformly differentiable on $[0,1]$.