Stone Weierstrass Theorem fails with "polynomials in sin x" I have proven that every continuous real-valued function on $[0,\pi]$ is the uniform limit of a sequence of "polynomials in $\cos x$". That is, polynomials of the form:
$$a_0+a_1\cos x+a_2\cos^2 x+a_3\cos^3 x+\cdots +a_n\cos^n x$$
by showing that all polynomials of this form, satisfy the Stone Weierstrass theorem hypothesis.
But next, I am asked to explain why why this result would fail if $\cos(kx)$ is replaced by $\sin (kx)$ which I have no idea how to show.
These are questions 26B and 26D in Bartle´s Elements of Real Analysis
 A: If you look at polynomials of the form $$\sum\limits_{k=0}^n a_k\sin (kx),$$ then you cannot get constant functions, which are required to apply Stone Weierstrass. This is because the first term is $a_0\sin (0x)=0,$ whereas for polynomials in $\cos kx,$ you had $a_0\cos (0x)=a_0.$
Perhaps, a more glaring problem is the failure of closure under multiplication (check trig identities). This causes the result to break down when changing from $\cos$ to $\sin$, even if you choose to allow the polynomials to include constant functions.
Even more, as pointed out by the other response, you're going to have trouble separating points (I hadn't even considered it, as I immediately saw other problems). $\cos$ is injective on $[0,\pi]$, so it has no such issues, but $\sin$ is not.
EDIT: I want to emphasize this, if it’s getting missed. If you don’t include constants (not clear from context if you do or not), then you’re automatically done. Even if you do allow  them and consider functions of the form $$a_0+\sum\limits_{k=1}^n a_k\sin (kx),$$ the set doesn’t still form an algebra, as it’s not closed under multiplication. Also, as the other answer points out, point separation is problematic in this case.
If you want to consider things of the form $$a_0+\sum\limits_{k=1}^n a_k\sin^k(x),$$ you'll run into similar problems (the title says this, but the actual question in the body does not- the question the OP is asking about is $26$D in Bartle, which asks the question that I previously answered). 
A: The OP asks why, if we replace $\cos$ with $\sin$ in
$$a_0+a_1\cos x+a_2\cos^2 x+a_3\cos^3 x+\cdots +a_n\cos^n x,$$
we do not get a dense subset of $C[0,\pi].$ The reason is not that we don't get the constant functions. Clearly we do: The functions $a_0+0\cdot \cos x$ capture all constant functions.
The real reason is that $\cos x$ is $1–1$ on $[0,\pi],$ while $\sin x$ is not. Note that every function $f$ of the form
$$\tag 1 f(x)=a_0+a_1\sin x+a_2\sin^2 x+\cdots +a_n\sin^n x$$
satisfies $f(\pi/4)= f(3\pi/4).$ Hence so does the uniform limit of any sequence of such functions. Since there are loads of continuous functions on $[0,\pi]$ that do not have this property, the functions in $(1)$ are not dense in $C[0,\pi].$ 
