I'm doing a homework for my analysis class, and a problem says the following:
Let $f : \mathbb{T}^1 \to \mathbb{C}$ be the function $$f(\theta) = \begin{cases} 1 & 0 < \theta < \pi \\ 0 & - \pi < \theta < 0 \end{cases}$$ Compute the Fourier transform of $f$. Finally, it says to use the fact that the Fourier transform is an isometry from $L^2 \left( \mathbb{T}^1 \right) \to \ell^2$ to show that $\sum_{k = 1}^{\infty} k^{-2} = \pi^2 / 6$.
I've computed the Fourier transforms of $f$ as $$\hat{f}(k) = \begin{cases} \frac{1}{2} & k = 0 \\ 0 & \textrm{$k \neq 0$ even} \\ - \frac{i}{\pi k} & \textrm{$k$ odd} \end{cases}$$ If I understand correctly, what it wants me to do next is observe that since $f \mapsto \hat{f}$ is a unitary operator from $L^2 \left( \mathbb{T}^1 \right)$ to $\ell^2$, we have $$\pi = \| f \|_{L^2}^2 = \sum_{k \in \mathbb{Z}} \left| \hat{f}(k) \right|^2 = \frac{1}{4} + \frac{1}{\pi^2} \sum_{\textrm{$k$ odd}} \frac{1}{k^2}$$
Now there's an example in the text that does something with a different function to get that $\sum_{\textrm{$k \geq 1$} odd} k^{-2} = \frac{\pi^2}{8}$, then does some arithmetic trickery to get that $\sum_{k = 1}^{\infty} k^{-2} = \frac{\pi^2}{6}$. But whenever I do this calculation on the $f$ shown above, I get different numbers. I've already sunk a lot of time into this. Do I have an arithmetic error somewhere that I need to iron out, or am I on the wrong track?
Thanks.
EDIT: In this text, the Fourier transform is defined as $$\hat{f}(k) = (2 \pi)^{-1} \int_{- \pi}^{\pi} f(\theta) e^{-k i \theta} \mathrm{d} \theta$$