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}$.