Usually one shows the density of the functions $\sin(kx)$ in $L^2([0,1])$ using the Fourier transform. This in fact comes from the Stone-Weierstrass theorem however and then uses the density of continuous functions in $L^2([0,1])$.


However, the Stone–Weirstrass theorem can be used to show, for example, that the functions $e^{ikx}$ are dense in $C([0,1])$ and hence dense in $L^1([0,1])$ as well. So we obtain (not-necessarily-unique) coefficients $c\_k$ such that $f\_k(x) =c\_ke^{ikx}$ converge to any given $f \in L^1([0,1])$. How should I think about these coefficients? How do they relate to the Fourier series of $f$ (with basis $e^{ikx})$?



Coefficients from Stone–Weierstrass versus Fourier transform
Just a comment if you choose coefficients $c\_{k,n}$ such that
$$
 \lim\_{n\to\infty} \left(\sum\_{k=-n}^{n} c\_{k,n} e^{2\pi i n x}\right) \to f (x)
$$
in some sense, e.g. $L^1$, then these are not unique. It is even known that the obvious choice $c\_{k,n} = \hat{f}(k) = \int e^{-2\pi i n x} f(x) dx$ is not the best. It's much better to choose
$$
 c\_{k,n} = \left(1 - \frac{|k|}{n}\right) \hat{f}(k).
$$
Then one Cesaro sums the Fourier series, and this is known to converge. 


As pointed out by Zen Harper below, I should mention that with the choice $c\_{k,n} = \hat{f}(k)$ for $-n \leq k \leq n$, the Fourier series of a $L^1$ function must not converge. In fact it can diverge almost-everywhere.


Having said these things, the obvious advantage of this is, that everything is explicit and does not rely on any abstract hocus pocus.


I realized one more thing: Consider the case $f \in L^2$. Then the choice $c\_{k,n} = \hat{f}(k)$ for $-n \leq k \leq n$ is optimal. This follows from easy Hilbert space theory!


