In physics class we learned that any string vibration with two fixed endpoints can be written as a superposition of normal modes, where the shape of each normal mode is given by $y(x)=A_n\sin(nx)$. As I understand it, this means that any continuous function with fixed endpoints can be written as a series of only sines.
Then, I thought of the function $$y(x,0)=\cos(x)-\cos(2x),$$ which is fixed at $x=0$ and $x=2\pi$, and wondered about the Fourier expansion for this. The general Fourier expansion allows both cosines and sines, so obviously the general series is given by the function itself. But since the normal modes are given by sine functions, I'm guessing that I'd have to find an equivalent Fourier series in terms of only sines.
I used mathematica to find the Fourier sine series (20 terms) and plotted it, and I got a weird discontinuity. Does this mean that it's just impossible to expand this function properly? What does this mean physically? I'm starting to think that I fundamentally misunderstand something, but I can't figure out what I'm doing wrong. Any help would be appreciated!