# The Weierstrass Approximation Theorem

We are now ready to state an important result known as the Weierstrass Approximation theorem. It can be proved using Fejer's Theorem (though we will omit the proof) and simply state the result.

Theorem 1 (The Weierstrass Approximation Theorem): If $f$ is a real-valued continuous function on the compact interval $[a, b]$ then for all $\epsilon > 0$ there exists a polynomial $p$ on $[a, b]$ such that $\mid f(x) - p(x) \mid < \epsilon$ for all $x \in [a, b]$. |

We will now look at an example problem regarding the Weierstrass Approximation theorem.

## Example 1

**Let $f$ be a real-valued continuous function on $\mathbb{R}$ for which $\displaystyle{\lim_{x \to \infty} f(x)}$ and $\displaystyle{\lim_{x \to -\infty} f(x)}$ exist and are finite. Prove that $f$ can be approximately uniformly by a function $g(x) = p(\tan^{-1} (x))$ where $p$ is a polynomial.**

We would like to apply the Weierstrass Approximation theorem to this problem however we cannot apply it defined since we are to approximate $f$ on all of $\mathbb{R}$ and $\mathbb{R}$ is not a compact interval.

Instead, define a new function $F : \left [ - \frac{\pi}{2}, \frac{\pi}{2} \right ]$ for all $x \in \left [ -\frac{\pi}{2}, \frac{\pi}{2} \right ]$ by:

(1)Since $f$ is continuous on $\mathbb{R}$ we have that $F$ is clearly continuous on $\left ( -\frac{\pi}{2}, \frac{\pi}{2} \right )$, and in fact, from the way $F$ is defined, we see that:

(2)So $F$ is actually continuous on $\left [ -\frac{\pi}{2}, \frac{\pi}{2} \right ]$. So, by the Weierstrass Approximation theorem, for all $\epsilon > 0$ there exists a polynomial $p$ such that for all $t \in \left [ -\frac{\pi}{2}, \frac{\pi}{2} \right ]$ we have that:

(4)Where $t = \tan^{-1} x$. Note that $F(t) = f(\tan t) = f(\tan (\tan^{-1}(x)) = f(x)$ and so we have that for all $x \in \mathbb{R}$:

(5)In other words, $f$ can be uniformly approximated by a function $g(x) = p(\tan^{-1}(x))$ where $p$ is a polynomial.