In solving the following problem with the method of separation of variables $ u_{tt}=u_{xx} \quad 0
i came across the problem of expanding $g$ in series of cosines. $g$ is of cass $C^1$, so if I extend it to an even function $G$ on $[-\pi,\pi]$ I should be able to expand it in series of cosine since $G$ is piecewise $C^1$. But in class we said for an analogous problem (with the data $u(t,0)=u(t,\pi)=0$) that since by the separation of variables we obtain the eigenvectors of the laplacian with 0-boundary data (in that case they are sines, which are a basis of $L^2[0,\pi]$) we can write g as a series of sines (in the sense of L^2, so a.e.). Can I say something analogous here, without extending $g$ to an even function. In this case, how can I say that cosines are a basis of $L^2[0,\pi]$?