core29 min studyLesson 180 in Mathematics

Polynomial density and Stone–Weierstrass

Understand uniform approximation as density of a function algebra, with exact hypotheses and no hidden Taylor assumption.

On this page

What you’ll understand

  • Distinguish polynomial approximation from convergence of a function’s Taylor series.
  • Check constants, point separation, and algebra closure in the real Stone–Weierstrass theorem.
  • Use Bernstein polynomials and a binomial variance bound to explain constructive density.

A continuous curve may have corners and no useful Taylor expansion, yet polynomials can approximate it uniformly on a compact interval. This is a statement about choosing a new polynomial for each desired accuracy, not about summing derivatives at one center. Stone–Weierstrass explains which function families have this expressive power. Its hypotheses describe the ability to combine existing functions and distinguish locations, turning a broad approximation promise into concrete checks on a candidate representation.

Density does not mean exact finite representation

Weierstrass approximation says that every continuous real function on a finite closed interval is the uniform limit of polynomials. A sequence of polynomials may therefore approach the absolute-value function despite its corner at zero. The approximating derivatives need not approach a continuous derivative, and no contradiction arises with the earlier derivative-limit theorem. Uniform approximation controls values; it does not promise smooth convergence or a finite polynomial equal to the target.

Nor must the approximants be Taylor partial sums. A function may fail to be differentiable or may be smooth without equaling its Taylor series. Density allows coefficients to depend on global information and on the desired tolerance. This distinction matters when choosing numerical representations: approximation existence does not automatically give an efficient degree, a stable coefficient basis, or resistance to noisy samples. Those are quantitative and computational questions beyond the qualitative density theorem.

∀f∈C([a,b],R) ∀ε>0 ∃p∈R[x]:sup⁡x∈[a,b]∣f(x)−p(x)∣<ε\forall f\in C([a,b],\mathbb R)\ \forall\varepsilon>0\ \exists p\in\mathbb R[x]:\quad\sup_{x\in[a,b]}|f(x)-p(x)|<\varepsilon
Assume a<b are finite. The polynomial p may change with ε and need not be a Taylor polynomial of f.↔ Scroll wide equations horizontally.

An algebra must preserve constants and separate points

For compact Hausdorff K, the real Stone–Weierstrass theorem applies to a subalgebra of continuous real-valued functions containing the constants and separating points. Subalgebra means closure under finite sums, scalar multiplication, and products. Separation means that for any distinct locations, at least one family member takes different values there. Under these assumptions, the algebra is dense in all continuous real functions with the supremum norm. The compact interval polynomial theorem is the case generated by the coordinate function.

Each structural requirement removes a real obstruction. Polynomials lacking a constant term cannot uniformly approximate the constant one on an interval containing zero. Even polynomials cannot approximate x on a symmetric interval, because they never distinguish x from minus x. Merely taking affine functions supplies constants and separates points but fails product closure, and it cannot approximate arbitrary curved profiles arbitrarily well. For complex-valued algebras one needs the additional conjugation closure in the standard complex theorem; the real statement cannot be copied unchanged.

A⊂C(K,R),1∈A,A separates points⟹A‾∥⋅∥∞=C(K,R)\mathcal A\subset C(K,\mathbb R),\quad 1\in\mathcal A,\quad\mathcal A\ \text{separates points}\quad\Longrightarrow\quad\overline{\mathcal A}^{\|\cdot\|_\infty}=C(K,\mathbb R)
Here K is compact Hausdorff and A is a real subalgebra. For complex-valued functions, the standard version also assumes closure under complex conjugation.↔ Scroll wide equations horizontally.

Bernstein polynomials give a constructive route on an interval

On the unit interval, form a polynomial by weighting sampled values f(k/n) with binomial probabilities. At input x this is the expectation of f(K/n) when K has binomial parameters n and x. The sample fraction has mean x and variance x(1−x)/n, at most one over four n. Continuity on the compact interval is uniform continuity, so nearby sample fractions produce nearby function values with one location-independent tolerance.

Split the expectation into a nearby region and its complement. Uniform continuity bounds the nearby error; boundedness of f bounds the far error, while Chebyshev’s inequality makes the far probability uniformly small using the variance estimate. This proves uniform approximation without assuming differentiability. In the binomial lab, p plays the role of the approximation input and n the polynomial degree: predict how the distribution of K/n concentrates as n increases. The bars illustrate the weights, not an arbitrary target function or an automatic polynomial fitter.

A polynomial approximation with an exact variance error

Compute the Bernstein polynomial for f(x)=x2f(x)=x^2 on [0,1] and bound its uniform error.

  1. For K binomial with parameters n and x, the Bernstein construction gives Bnf(x)=E[(K/n)2]B_nf(x)=\mathbb E[(K/n)^2]. The expectation of K/n is x.

  2. Use the identity second moment equals variance plus squared mean. Since Var(K/n)=x(1−x)/n, the polynomial is x²+x(1−x)/n.

  3. The error is nonnegative and maximized at x=1/2, where x(1−x)=1/4. Thus the uniform error is exactly 1/(4n), giving a concrete rate for this particular target.

The result

Bₙ(x²)=x²+x(1−x)/n, with supremum error 1/(4n). The density theorem alone would not have supplied this rate.

Explore the model

Interactive lab

Interactive lab · probability

Binomial weights concentrate around the input

Set success probability p to the chosen input x and increase trial count n. Predict that K/n has mean p and variance p(1−p)/n, converting the displayed K mean and variance by dividing by n and n². The exact binomial bars illustrate Bernstein weights, not evaluation of an arbitrary f or a direct approximation-error readout.

Binomial weights concentrate around the inputThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forUniform concentration plus uniform continuity yields approximation without derivatives.

Check your understanding

Why do even polynomials fail the real Stone–Weierstrass hypotheses on [−1,1]?

Try it yourself

Can polynomials in x² approximate every continuous function on [0,1] uniformly? Compare the same family on [−1,1].

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Check whether x↦x² separates points on each domain.

Compare with the solution

On [0,1], squaring is injective. The algebra of polynomials in x² contains constants, is closed under sums and products, and separates distinct points, so real Stone–Weierstrass gives density. On [−1,1], it cannot distinguish x and −x. In particular, if an even polynomial approximated x with error below ε at both 1 and −1, its common endpoint value would have to lie within ε of both 1 and −1, impossible for ε<1.

Take it with you

  • Polynomial density concerns value approximation, not automatic Taylor convergence or derivative approximation.
  • A real function algebra needs constants, point separation, and compact-domain hypotheses.
  • Bernstein weights connect constructive approximation to binomial concentration.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.