How to prove Algebra generated by$\{1,e^{ix}\}$ is dense in $C([0,\pi],\mathbb C)$? Is it possible to approximate every function $f\in C([0,\pi],\mathbb C)$ uniformly with arbitary precision bby functions in the algebra generated by $\{1,e^{ix}\}$?
I know it's true for $\{1,e^{ix},e^{-ix}\}$, because for every continious function $f(x)=u(x)+v(x)i$,
$u,v$ is able to be approximated by algebra generated by $\{1,\cos x\}$ according to stone-weierstrass approximation theorem. But here we don't have $e^{-ix}$？
 A: r9m's idea of using Mergelyan's Theorem is a good one.  In this special case, we can reduce the proof to be much simpler.
By the usual complex version of Stone-Weierstrass, it suffices to show that the function $e^{-ix}$ is in the closure $\overline{\mathcal{A}}$ of the algebra $\mathcal{A}$ generated by $\{1, e^{ix}\}$.
Let $S^1_+ = \{e^{ix} : 0 \le x \le \pi\}$ be the upper unit semicircle in the complex plane.  Fix $\epsilon > 0$ and consider the complex function $f(z) = 1/(z+i\epsilon)$, which is holomorphic except at $z=-i\epsilon$.  Choose $R>0$ so large that $\sqrt{1+R^2} < R+\epsilon/2$; then the open disk $D = D(iR, R+\epsilon/2)$ contains all of $S^1_+$ but excludes $-i\epsilon$.  Thus $f$ is holomorphic on $D$, so its Taylor series centered at $z=iR$ converges uniformly to $f$ on compact subsets of $D$, and in particular converges uniformly on $S^1_+$.  So if we let $p_n(z)$ denote the $n$th Taylor polynomial of $f$ centered at $iR$, we have $p_n(e^{ix}) \to f(e^{ix}) = 1/(e^{ix} + i\epsilon)$ uniformly on $x \in [0,\pi]$, and therefore $1/(e^{ix}+i\epsilon) \in \overline{\mathcal{A}}$.  Now letting $\epsilon \to 0$, we have $1/(e^{ix}+i\epsilon) \to e^{-ix}$ uniformly on $x \in [0,\pi]$, and therefore $e^{ix} \in \overline{\mathcal{A}}$ as well.
Note the full version of Mergelyan's theorem would show that the same result is true on any interval $[0, a]$ for $a < 2\pi$, but it is false on $[0,2\pi]$.
