Finding Fourier cosine series of sine function

Certainly you should get cosine terms in the Fourier cosine series for $f(x)$.

I think you are confusing your situation with the result regarding full Fourier series on $-\ell<x<\ell$, $$ {1\over 2}a_0+\sum_{n=1}^\infty a_n\cos(n\pi x/\ell)+b_n\sin(n\pi x/\ell), $$ that says if $f(x)$ is an odd function on $-\ell<x<\ell$, then $a_n=0$ for all $n=0,1,2,\dots$ (and if $f(x)$ is an even function on $-\ell<x<\ell$, then $b_n=0$ for all $n=1,2,\dots$)