Linear hull of $x \mapsto \sin(\pi n x)$ is dense I need some help with an exercise of my analysis course:
Show that the linear hull of the functions $x \mapsto \sin(\pi n x)$ is dense in the subspace $\{f\in C[0,1]: f(0)=f(1)=0 \}$ of $C[0,1]$.
My idea was to use the Stone–Weierstrass theorem because we discussed it in the lecture but I have no clue how to apply it.
 A: Hint Here is a strategy:
1) By the Stone-Weierstrass theorem, the algebra of polynomials in $z$ and $\overline{z}$ is dense in $C(\mathbb{U}, \mathbb{C})$, where $\mathbb{U}$ is the unit circle.
2) Consequently, every continuous function $g\in C([-1, 1])$ such that $g(-1) = g(1)$ can be approximated uniformly by linear combinations of functions $(e^{\pm i\pi x})^k = e^{\pm i\pi k x}$ with $k\in \mathbb{N}$.
3) If $g$ is real valued, one can take the real part of the approximation and this approximates $g$ by a real combination of $\cos(\pi k x)$ and $\sin(\pi k x)$
4) If $g$ is odd, the odd part of the approximation gives a better uniform approximation. In this case, $g$ can be approximated by a combination of $\sin(\pi k x)$.
5) If $f\in C([0,1])$ satisfies $f(0) = f(1) = 0$, define $g\in C([-1,1])$ by $g(x) = -f(-x)$ when $x<0$ and $g(x) = f(x)$ when $x\ge 0$, then apply 4).
6) The conclusion is that if $V = \{f\in C([0,1], f(0) = f(1) = 0)\}$ and $W = \text{Span}(\{\sin(\pi k x), k\in\mathbb{N}\})$, then for every $f\in V$ and any $\varepsilon>0$, there is a $p\in W$ such that $\|f-p\|_{C([0,1])}\le \varepsilon$, that is to say $f$ belongs to the closure of $W$. As $W\subset V$, it follows that $V=\overline{W}$, that is to say $W$ is dense in $V$. 
