I'm learning about uniform convergence. For example, consider a function sequence
$$f_n: \mathbb{R} \rightarrow \mathbb{R}, f_n(x) = n\sin(\frac{x}{n})$$
This sequence converges pointwise to $ f(x) = x $, but on $ \mathbb{R} $ the convergence is not uniform (one can look at $ f(\frac{\pi}{2n}) = n$ ).
I'm supposed to prove that on any closed interval $ [a,b] \subset \mathbb{R} $ the convergence is uniform.
To prove that I need to show that the supremum of
$$ | x – n\sin(\frac{x}{n}) | $$
converges to $ 0 $ as $n \rightarrow \infty $.
My take is this: if $ x \in [a,b] \subset \mathbb{R} $, then by Weierstrass theorem a continuous function on closed interval attains its maximum value, so there exists $ x_1 \in [a,b] $ that for every $x$
$$ | x – n\sin(\frac{x}{n}) | \leq | x_1 – n\sin(\frac{x_1}{n}) |$$
and then it's easy to see that as $n \rightarrow \infty $ the RHS also converges to $0$. But RHS is the supremum which converges to $0$, so the convergence is uniform on any $ [a,b] \subset \mathbb{R} $.
Is this method/trick correct? It seems like if it is, then proving almost uniform convergence can sometimes be easy just by invoking the Weierstrass theorem: suspiciously easy, that's why I'm asking.
Best Answer
Actually, you don't have $f_n\left(\frac\pi{2n}\right)=n$. You can prove that the convergence is not uniform on $\mathbb R$ usinge the fact that $f_n\left(\frac{\pi n}2\right)=n$ for each natural $n$.
And your proof is wrong, since $x_1$ depends upon $n$.
I suggest that you define $g_n(x)=f_n(x)-x=n\sin\left(\frac xn\right)-x$ and then you prove that it converges uniformly to the null function on $[a,b]$. Use the fact that $g_n'(x)=\cos\left(\frac xn\right)-1$.