# Desity of Trigonometric Polynomials

Define $$\mathcal{A}:=\Big\{p_n(x) = a_0+\sum^n_{k=1}(a_k\cos(kx)+b_k\sin(kx)): 1\leq k\leq n, \,{\rm and}\,\, a_0,a_k,b_k\in \mathbb{R}\Big\}$$ a) Prove that $\mathcal{A}$ is not dense in $C([0,2\pi])$ but $\mathcal{A}$ is dense in $$\mathcal{G}:=\{g\in C([0,2\pi]:g(0) = g(2\pi)\}$$ b) Prove that $\mathcal{A}$ is dense in $L^1([0,2\pi])$

I have recently studied the Stone-Weierstrass theorem and suspect that I can use it for this problem. I think that every $p_n(x)$ separates points because when sine does not separate points, cosine separates, and when cosine does not separate sine separates. So I believe $\mathcal{A}$ satisfies the conditions for Stone-Weierstrass theorem. But I have failed to prove that $\mathcal{A}$ not dense in $[0,2\pi]$ and moreover why is $\mathcal{A}$ dense in $\mathcal{G}$.

• Take $f(x) = x$. Note that $f(0) = 0$, $f(2 \pi) = 2 \pi$, whereas any function $g \in {\cal A}$ satisfies $g(0)=g(2 \pi) = a_0$. – copper.hat Feb 9 '17 at 6:31
• There is a little-known theorem of Fejer, proved by elementary Fourier series methods: For $f\in C[0,2\pi]$ with $f(0)=f(2\pi)$, let $F_n(x)$ be the partial sum of the Fourier series for$f$ (up to the terms in $\cos nx$ & $\sin nx)$. Then $\;(1/n)\sum_{j=1}^n F_j(x)\;$ converges uniformly to $f(x)$ on $[0,2\pi]$ as $n\to \infty.$ – DanielWainfleet Feb 9 '17 at 14:36

Let $f \in C([0,2\pi])$ such that $f(0) \ne f(2 \pi)$ (for example $f(x)=x$.)
Suppose that $\mathcal{A}$ is dense in $C([0,2\pi])$. Then there is a sequence $(p_n)$ in $\mathcal{A}$ which converges uniformly to $f$ on $[0,2\pi]$.
Then we get from $p_n(0)=p_n( 2 \pi)$, with $n \to \infty$, that $f(0) = f(2 \pi)$, a contradiction.
The example in the comment and other answer shows why ${\cal A}$ is not dense in $C[0,2 \pi]$. The key missing feature is that the subalgebra does not separate points. There is no $g \in {\cal A}$ that separates $0,2 \pi$.
For ${\cal G}$, we can consider the functions $C(\mathbb{T})$ instead, and note that $\mathbb{T}$ is compact in the usual metric and ${\cal A}$ does separate points of $\mathbb{T}$ and contains the function $x \mapsto 1$. Hence Stone Weierstraß applies and hence ${\cal A}$ is dense in ${\cal G}$.
To prove that ${\cal A}$ is dense in $L^1[0,1]$, note that ${\cal A}$ is dense in indicator functions of intervals, hence of open sets and hence of measurable sets. Since simple functions are dense in $L^1[0,1]$, we obtain the desired result.