# proof of Weierstrass approximation theorem

To simplify the notation, assume that the function is defined on the interval $[0,1]$. This involves no loss of generality because if $f$ is defined on some other interval, one can make a linear change of variable which maps the domain of $f$ to $[0,1]$.

## The case $f(x)=1-\sqrt{1-x}$

Let us start by demonstrating a few special cases of the theorem, starting with the case $f(x)=1-\sqrt{1-x}$. In this case, we can use the ancient Babylonian method of computing square roots to construct polynomial^{} approximations. Define the polynomials ${P}_{0},{P}_{1},{P}_{2},\mathrm{\dots}$ recursively as

$${P}_{0}(x)=0$$ |

$${P}_{n+1}(x)=\frac{1}{2}\left({P}_{n}{(x)}^{2}+x\right)$$ |

It is an obvious consequence of this definition that, if $0\le x\le 1$ then $0\le {P}_{n}(x)\le 1$ for all $n$. It is equally obvious that each ${P}_{n}$ is a monotonically increasing function on the interval $[0,1]$. By subtracting the recursion from itself, cancelling, and factoring, we obtain the relation

$${P}_{n+2}(x)-{P}_{n+1}(x)=\frac{1}{2}({P}_{n+1}(x)+{P}_{n}(x))({P}_{n+1}(x)-{P}_{n}(x))$$ |

From this relation, we conclude that ${P}_{n+1}(x)\ge {P}_{n}(x)$ for all $n$ and all $x$ in $[0,1]$. This implies that ${lim}_{n\to \mathrm{\infty}}{P}_{n}(x)$ exists for all $x$ in $[0,1]$. Taking the limit of both sides of the recursion that defines ${P}_{n}$ and simplifying, one sees that ${lim}_{n\to \mathrm{\infty}}{P}_{n}(x)=1-\sqrt{1-x}$. The relation also implies that ${P}_{n+1}(x)-{P}_{n}(x)$ is also a monotonically increasing function of $x$ in the interval $[0,1]$ for all $n$. Therefore,

$${P}_{n+1}(x)-{P}_{n}(x)\le {P}_{n+1}(1)-{P}_{n}(1)$$ |

Summing over $n$ and cancelling, one sees that

$${P}_{m}(x)-{P}_{n}(x)\le {P}_{m}(1)-{P}_{n}(1)$$ |

whenever $m>n$. Taking the limit as $m$ approaches infinity, one concludes that

$$1-\sqrt{1-x}-{P}_{n}(x)\le 1-{P}_{n}(1)$$ |

Since the ${P}_{n}$’s converge, for any $\u03f5>0$, there exists an $n$ such that $$. For this value of $n$, $$, so the Weierstrass approximation theorem^{} holds in this case.

## The case $f(x)=|x-c|$

Next consider the special case $f(x)=|x-c|$, where $0\le c\le 1$. A little algebra shows that

$$\sqrt{{(x-c)}^{2}+{\u03f5}^{2}/4}-|x-c|\le \u03f5/2$$ |

By the case of the approximation theorem already proven, there exists a polynomial $P$ such that

$$ |

when $x\in [0,1]$. Combining the last two inequalities^{} and applying the triangle inequality^{}, one sees that $$, so the Weierstrass approximation theorem holds in the case $f(x)=|x-c|$.

## The case of piecewise linear functions

A corollary of the result just proven is the Weierstrass appriximation theorem for piecewise linear functions. Any piecewise linear function $\varphi $ can be expressed as

$$\varphi (x)=b+\sum _{m=0}^{N}{a}_{m}|x-{c}_{m}|$$ |

for suitable constants ${a}_{0},\mathrm{\dots},{a}_{N},b,{c}_{0},\mathrm{\dots},{c}_{N}$. By the result just proven, there exist polynomials ${P}_{0},\mathrm{\dots},{P}_{N}$ such that

$$ |

By the triangle inequality,

$$ |

## The general proof

Having succeeded in proving all these special cases, we now have the courage to attack the general theorem. In light of the case just proven, it suffices to show that if $f$ is continuous^{} on [0,1] then for all $\u03f5>0$ there exists a piecewise-linear function $\varphi $ such that for all $x$ in $[0,1]$, $$. For, if such a function exists, then there also exists a polynomial $P$ such that $$, but then $$.

Since the interval $[0,1]$ is compact^{}, $f$ is uniformly continuous^{}. Hence, for all $\u03f5>0$ there exists an integer $N$ such that $$ whenever $|x-y|\le 1/N$.

Define $\varphi $ by the following two conditions: If $m$ is an integer between $0$ and $N$, $\varphi (m/N)=f(m/N)$. On any interval $[m/N,(m+1)/N]$, $\varphi $ is linear.

For every point $x$ in the interval $[0,1]$, there exists an integer $m$ such that $x$ lies in the subinterval $[m/N,(m+1)/M$. Since a linear function is bounded^{} by its values at the endpoints, $\varphi (x)$ lies between $\varphi (m/N)=f(m/N)$ and $\varphi ((m+1)/N)=f((m+1)/N)$. Since $|f(m/N)-f((m+1)/N)|\le \u03f5/2$, it follows that $|f(m/N)-\varphi (x)|\le \u03f5/2$. Because $|x-m/N|\le 1/N$, it is also true that $|f(m/N)-f(x)|\le \u03f5/2$. Hence, by the triangle inequality, $$.

Title | proof of Weierstrass approximation theorem |
---|---|

Canonical name | ProofOfWeierstrassApproximationTheorem |

Date of creation | 2013-03-22 14:34:58 |

Last modified on | 2013-03-22 14:34:58 |

Owner | rspuzio (6075) |

Last modified by | rspuzio (6075) |

Numerical id | 9 |

Author | rspuzio (6075) |

Entry type | Proof |

Classification | msc 41A10 |