I have to calculate the Fourier series of $\cos(2x)$ using the basis $e_n = \dfrac{e^{inx}}{\sqrt{2\pi}}$ of $L_2 (0,2\pi)$. If I calculate the coefficients of the series I get $$c_n = \langle e_n|\psi\rangle = \int_{0}^{2\pi}dx\dfrac{e^{-inx}}{\sqrt{2\pi}}\dfrac{e^{i2x}+e^{-i2x}}{2} = \int_{0}^{2\pi}dx\dfrac{e^{ix(-n+2)}}{2\sqrt{2\pi}} + \int_{0}^{2\pi}dx\dfrac{e^{ix(-n-2)}}{2\sqrt{2\pi}} = \dfrac{1}{2\sqrt{2\pi}}\left[-\dfrac{i}{2-n}[1^{-n+2}-1]+\dfrac{i}{n+2}[1^{-n-2}-1]\right] = 0$$
Am I right? Or I'm doing something wrong? Thanks for the help.