# Approximation of absolute value function using polynomial

By Stone-Weierstrass theorem, the set of polynomial is dense in $$C[a,b]$$, I am wondering what is the sequence of polynomial which can approximate absolute value function $$|x|$$? I know using $$\sqrt{x^{2}+1/n}$$ can approximate it but it is not a polynomial.

• You can probably just pick $n$ points that range over the interval and construct the interpolating polynomial through those points. It won't be a nice sequence as $n$ increases, but I think it converges uniformly if you pick the points nicely. Jun 1, 2021 at 13:23
• Weierstrass' can be proven constructively using the Bernstein polynomials. You can scale your problem to the interval $[0,1]$ and then take the combination in the link of the first few Bernstein polynomials.
– plop
Jun 1, 2021 at 13:58

For example, you can consider the binomial expansion of $$\sqrt{1-y}$$ on $$[0,1]$$. Namely, setting $$y=1-x^2$$, we have $$|x|=\sqrt{1-y}=\sum_{m=0}^{\infty}\binom{1/2}{m}(-y)^m, \quad x\in[-1,1].$$