# About example of continuous function on $\mathbb{R}$ which cannot be uniformly approximated by polynomials? [duplicate]

Possible Duplicate:
Weierstrass approximation does not hold on the entire Real Line

If a function $f: \mathbb{R}\rightarrow \mathbb{R}$ is continuous then $f$ can be uniformly approximated by smooth functions (see here). By the Weierstrass approximation theorem $f$ can be uniformly approximated by polynomials on each compact subinterval of $\mathbb{R}$.

What is example of continuous function $f: \mathbb{R}\rightarrow \mathbb{R}$ which cannot be uniformly approximated by polynomials on the whole $\mathbb{R}$?

Thanks

-

## marked as duplicate by Nate Eldredge, Asaf Karagila, Eric Naslund, t.b., Zev ChonolesFeb 13 '12 at 23:28

Any bounded non-constant function should do. Since polynomials explode at infinity, the uniform distance of any bounded function and any polynomial will be infinite.

-
Thanks very much . – Richard Feb 4 '12 at 10:01
Any bounded, non-constant function should I add. – Najib Idrissi Feb 4 '12 at 12:30
@zulon Indeed, thanks for reminding me. – Miha Habič Feb 4 '12 at 13:15

This was the subject of a previous question. The result is:

If $f$ can be approximated uniformly on $\mathbb{R}$ by a sequence of polynomials $p_n$, then $f$ is a polynomial. Moreover, for sufficiently large $n$, we have $p_n = f + c_n$ where $c_n$ is a sequence of real numbers with $c_n \to 0$ (so the convergence is not really very interesting).

Thus any function which is not a polynomial will do as a counterexample for you.

The proof is essentially a consequence of the fact that the only bounded polynomials are constant. Suppose $p_n \to f$ uniformly. Since $\{p_n\}$ is uniformly Cauchy, there exists an $M$ so large that for any $n \ge M$, we have $\sup_{x \in \mathbb{R}} |p_n(x) - p_M(x)| \le 1$. So for all such $n$, $p_n - p_M$ is a bounded polynomial, hence is some constant $a_n$, and we have $p_n = p_M + a_n$. Since $\{p_n\}$ converges uniformly, we must have $a_n$ converging to some $a$. So $f = \lim_{n \to \infty} p_n = p_M + a$ which is a polynomial, and we have $p_n = f + (a_n - a)$ for all $n \ge M$.

-
Dear Nate: Nice answer! One can also phrase your argument as follows. If a series $\sum_{n\ge0}f_n$ of functions $f_n:X\to\mathbb R$ converges uniformly, then the sequence $(f_n)$ converges uniformly to $0$. In particular $f_n$ is bounded for $n$ large enough. – Pierre-Yves Gaillard Feb 4 '12 at 17:55