# Stone-Weierstrass for monotone functions

Let $\; f : [0,1] \to \mathbb{R} \;$ be continuous and non-decreasing. $\;\;$ Let $\epsilon$ be a real number such that $\; 0 < \epsilon \;$.
Does it follow that that there exists a real polynomial $p$ such that $p$ is non-decreasing on

1. $\;$ $[0,1]$
2. $\;$ all of $\mathbb{R}$

and for all members $x$ of $[0,1]$, $\; |f(x)+(-(p(x)))| < \epsilon \;\;$?

• ... so, is this too easy for MO? $\;$ If no, what were the downvotes for? $\;\;$ – user5810 Jan 10 '12 at 23:57
• Best guess: manual spacing doesn't render as well in every browser. – François G. Dorais Jan 11 '12 at 0:06
• It is "too easy". Basically it boils down to approximating $f$ by a smooth function $g$ with positive derivative, approximating $\sqrt {g'}$ by a polynomial $q$ on $[0,1]$, and putting $p=\int q^2$ on the line. There are many other solutions too. BTW, what's the point of writing $+((-p(x)))$ instead of the usual $-p(x)$? – fedja Jan 11 '12 at 0:25
• Wow, people are really piling on here. While the question does not give any motivation, it is clearly formulated and has a definite answer. As a non-analyst, the answer was not obvious to me. As fedja points out it turns out to not be that difficult, but I don't think that's immediately obvious. – MTS Jan 11 '12 at 3:44
• fedja, why don't you post your comment as an answer? The site works best that way - if there is an accepted answer it won't get randomly pushed back to the front page. – MTS Jan 11 '12 at 15:15

In fact, the Bernstein polynomials approximating $f$ are non-decreasing on $[0,1]$. A cute way to see this is via coupling (I learned this from Lindvall's book Lectures on the Coupling Method):
The $n$th Bernstein polynomial $p_n(x)$ can be written as $\mathbf{E}\Big[f\big(\frac{\sum_{i=1}^n Z^x_i}{n}\big)\Big]$, where $Z^x_i$ are Bernoulli random variables with parameter $x$. If $0\leq x\leq y\leq 1$, then we can define the variables $Z^x_i$ and $Z^y_i$ on the same probability space, such that $Z^x_i\leq Z^y_i$, which immediately gives $p_n(x)\leq p_n(y)$.