I've been given the piecewise function (on period interval $]-\pi,\pi]$ $$f(x) = \begin{cases} \pi & x=\pi \\ x & 0\leq x < \pi \\ 0 & -\pi<x<0 \end{cases} $$
And was asked to find its Fourier coefficients, and then to derive the formula $\sum_{n=1}^\infty \frac{1}{(2n-1)^2}=\frac{\pi^2}{8}$ based on this.
I found the Fourier coefficients (with regards to $e^{inx}$) $$c_n = \frac{1}{2\pi} \int_{-\pi}^\pi f(y)e^{-iny} \, dy =\cdots = \frac{\pi n i (-1)^n + (-1)^n-1}{2\pi n^2}$$ with $c_0=\frac{1}{2\pi} \int_{-\pi}^\pi f(y) \, dy = \frac{\pi}{4}$
I then tried to use Parseval's identity $\sum |c_n|^2 = \|f\|^2$, (where $\|f\|^2=\pi/4$), but have gotten a little stuck.
$$|c_0|^2 + \sum_{n=1}^\infty |c_n|^2 + |c_{-n}|^2 = \pi/4$$ $$\pi/4 - \pi^2/16 = \sum_{n=1}^\infty \bigg|\frac{\pi n i (-1)^n + (-1)^n-1}{2\pi n^2} \bigg|^2 + \bigg|\frac{\pi (-n) i (-1)^{(-n)} + (-1)^n-1}{2\pi (-n)^2}\bigg|^2$$ $$=\sum_{n=1}^\infty \frac{1}{4\pi^2}\frac{1}{n^2}\bigg|\pi n i (-1)^n + (-1)^n-1\bigg|^2 + \bigg|\pi (-n) i (-1)^{(-n)} + (-1)^n-1\bigg|^2$$
And now am a little uncertain how to go forward. I've noticed that for n=1,2,3... the series value is $2\pi^2+8... 2\pi^2...2\pi^2+4/9$... (Where I haven't applied the $\frac{1}{4\pi^2}$ factor), but I'm not quite sure how to categorize this.