Question about Weierstrass approximation theorem I hope that someone can answer this question.
Can the Weierstrass approximation theorem be generalized to the interval $(-\infty,\infty)$?
If for example one covers $(-\infty,\infty)$ with $\cup_{i=1}^\infty[-i,i]$ then for a function $x(t):(-\infty,\infty)\rightarrow\Bbb R$ if one chooses any specific $t\in(-\infty,\infty)$ a $i_0$ can be found such that $t\in[-i_0,i_0]$ and now using the theorems statement on a closed interval if follows that $\forall \varepsilon\gt0$ there exists a polynomial $p(t)$ on $[-i_0,i_0]$ such that $|x(t)-p(t)|\lt\varepsilon$.
So if follows that on $(-\infty,\infty)$ there exists a polynomial that has all the features as on a closed interval.
There must be something wrong about the explanation above, please if someone could tell me what it is.
I hope I've been clear enough, Thanks .
 A: What you have proved is that for a fixed $t\in\mathbb{R}$, given $\epsilon>0$ there is a polynomial $p$ such that $|f(t)-p(t)|<\epsilon$. But the Weierstrass approximation theorem is about uniform approximation; $|f(t)-p(t)|<\epsilon$ must hold for all $t$ on a given set.
It is true that given an interval $[-i,i]$ and $\epsilon>0$ there is a polynomial $p$ such that $|f(t)-p(t)|<\epsilon$ for all $t\in[-i,i]$. But $p$ depends on $\epsilon$ and $i$.
You can see that the theorem does not hold on unbounded sets by considering for example $f(t)=e^t$. Suppose that there is a polynomial $p$ such that $|e^t-p(t)|<1$ for all $t\in\mathbb{R}$. Let $n$ be the degree of $p$. Then we would have $e^t\le p(t)+1$ and
$$
\lim_{t\to+\infty}\frac{e^t}{t^{n+1}}=0.
$$
A: There is a version of Weierstrass' approximation theorem, due to Torsten Carleman (1927), which is valid for the interval $(-\infty,\infty)$, but it requires you to replace the approximating polynomial by a convergent power series:
If $\epsilon : \bf R\rm \to (0,\infty)$ is a positive, continuous function (for instance, a positive constant), then for any continuous function $f :\bf R \rm \to \bf C\rm$ there is an entire function $h(z)$ such that $|h(t)-f(t)|<\epsilon(t)$ for all $t\in\bf R\rm$. 
(That $h(z)$ is entire is equivalent to saying that there is a Taylor series expansion $h(z)=\sum_{n=0}^\infty a_n z^n$ which converges on all of $\bf C$.)
