In mathematical analysis, the **Weierstrass approximation theorem** states that every continuous function defined on a closed interval [*a*, *b*] can be uniformly approximated as closely as desired by a polynomial function. Because polynomials are among the simplest functions, and because computers can directly evaluate polynomials, this theorem has both practical and theoretical relevance, especially in polynomial interpolation. The original version of this result was established by Karl Weierstrass in 1885 using the Weierstrass transform.

Marshall H. Stone considerably generalized the theorem (Stone 1937) and simplified the proof (Stone 1948). His result is known as the **Stone–Weierstrass theorem**. The Stone–Weierstrass theorem generalizes the Weierstrass approximation theorem in two directions: instead of the real interval [*a*, *b*], an arbitrary compact Hausdorff space *X* is considered, and instead of the algebra of polynomial functions, a variety of other families of continuous functions on are shown to suffice, as is detailed below. The Stone–Weierstrass theorem is a vital result in the study of the algebra of continuous functions on a compact Hausdorff space.

Further, there is a generalization of the Stone–Weierstrass theorem to noncompact Tychonoff spaces, namely, any continuous function on a Tychonoff space is approximated uniformly on compact sets by algebras of the type appearing in the Stone–Weierstrass theorem and described below.

A different generalization of Weierstrass’ original theorem is Mergelyan’s theorem, which generalizes it to functions defined on certain subsets of the complex plane.

## Stone–Weierstrass theorem, complex version

Slightly more general is the following theorem, where we consider the algebra of complex-valued continuous functions on the compact space , again with the topology of uniform convergence. This is a C*-algebra with the *-operation given by pointwise complex conjugation.**Stone–Weierstrass Theorem (complex numbers).** Let be a compact Hausdorff space and let be a separating subset of . Then the complex unital*-algebra generated by is dense in .

The complex unital *-algebra generated by consists of all those functions that can be obtained from the elements of by throwing in the constant function 1 and adding them, multiplying them, conjugating them, or multiplying them with complex scalars, and repeating finitely many times.

This theorem implies the real version, because if a net of complex-valued functions uniformly approximates a given function, , then the real parts of those functions uniformly approximate the real part of that function, , and because for real subsets, taking the real parts of the generated complex unital (selfadjoint) algebra agrees with the generated real unital algebra generated.

As in the real case, an analog of this theorem is true for locally compact Hausdorff spaces.*In 1885 it was also published an English version of the paper whose title was On the possibility of giving an analytic representation to an arbitrary function of real variable. ^{[3][4][5][6][7]} According to the mathematician Yamilet Quintana, Weierstrass “suspected that any analytic functions could be represented by power series“.^{[7][6]}*