I am trying to find the Fourier coefficients of f with respect to the sequence $ \lbrace \phi_k \rbrace_{k=1}^\infty = \lbrace \frac{1}{\sqrt{2 \pi}}, \frac{\cos(x)}{\sqrt{\pi}}, \frac{\sin(x)}{\sqrt{\pi}},..., \frac{\cos(kx)}{\sqrt{\pi}}, \frac{\sin(kx)}{\sqrt{\pi}},... \rbrace $ I know that $f \in L([-\pi, \pi])$ and $f(x) = x$ where $x \in [-\pi, \pi]$. I know that the Fourier coefficients for an orthonormal sequence in $L^2$ are $c_k = \langle f, \phi_k \rangle $. So using this I can say that $ \langle f, \phi_k \rangle = \int \limits_{-\pi}^\pi f \phi_k $ I know that when $\phi_k = \frac{\cos(kx)}{\sqrt{\pi}}$ or if $\phi_k = \frac{\sin(kx)}{\sqrt{\pi}}$ then the integral goes to 0. So I am left with $ \int \limits_{-\pi}^\pi \frac{f}{\sqrt{2 \pi}} = \int \limits_{-\pi}^\pi \frac{x}{\sqrt{2 \pi}} = \frac{(\pi^2 - (-\pi)^2)}{2\sqrt{2 \pi}}=0 $ So in other words there are no Fourier coefficients, which I am pretty sure is wrong. I am also supposed to show that $\sum \limits_{k=1}^\infty \frac{1}{k^2} = \frac{\pi^2}{6}$. I know the sequence is complete so then I know that $\sum \limits_{k=1}^\infty c_k=\parallel f\parallel_2^2 $. I can solve for $\parallel f\parallel_2^2 $ $ \parallel f\parallel_2^2 = \int \limits_{-\pi}^\pi x^2 = \frac{(\pi^3 - (-\pi)^3)}{3}= \frac{2\pi^3}{3} $ I am clearly doing something wrong, but I can't figure out what. Any ideas?
EDIT: The assumption I made, if $\phi_k = \frac{\cos(kx)}{\sqrt{\pi}}$ or if $\phi_k = \frac{\sin(kx)}{\sqrt{\pi}}$ then the integral goes to 0, was not true. Doing the full integral yields the correct answer.