Extra factor of 2 when evaluating an infinite sum using fourier series and parseval's theorem. I'm asked to find the fourier series of the $2 \pi $ periodic function f(x) which is $sin(x)$ between $0$ and $\pi$ and $0$ between $\pi$ and $2\pi$
I use the complex form to proceed and get $$\frac{1}{2\pi}\int_{0}^{\pi}sin(x)e^{-ikx}dx$$. The complex coefficient $c_k$ I get as result is $\frac{-1}{\pi(k^2-1)}$ where $k=2n$ (k even) which is also correct according to WolframAlpha.
But then, I'm asked to use this result to evaluate $\sum_{n=1}^{\infty}\frac{1}{(4n^2-1)^2}$. For that, I switch to the real coefficients using $a_k=c_k+c_{-k},  b_k=i(c_k-c_{-k})$. I get:  $a_k=\frac{-2}{\pi(k^2-1)}, a_0=\frac{2}{\pi}$ and $b_k$ is $0$.
So $f(x)=\frac{a_0}{2}+\sum_{k=1}^{\infty}a_kcos(kx)$
I then use Parseval's theorem to evaluate the sum we are looking for, remembering that k is even, i.e. $k=2n$ and that the function is $0$ between $\pi$ and $2\pi$:
$$\frac{1}{\pi}\int_{0}^{2\pi}|f(x)|^2 dx=\frac{a_0^2}{2}+\sum_{k=1}^{\infty}a_k^2$$ (1)
$$\frac{1}{\pi}\int_{0}^{\pi}sin^2(x)dx=\frac{\frac{2^2}{\pi^2}}{2}+\sum_{n=1}^{\infty}\frac{4}{\pi^2(4n^2-1)^2}$$ (2)
$$\frac{1}{2}-\frac{2}{\pi^2}=\sum_{n=1}^{\infty}\frac{4}{\pi^2(4n^2-1)^2}$$ (3)
So finally I get$\frac{\pi^2}{8}-\frac{1}{2}=\sum_{n=1}^{\infty}\frac{1}{(4n^2-1)^2}$ (4)
However, WolframAlpha gets $\frac{\pi^2}{16}-\frac{1}{2}$ so I must somehow have forgotten a factor of $\frac{1}{2}$ or put an extra factor of $2$ by $\frac{\pi^2}{8}$.  
Logically, this missing/extra factor must have happened while I was evaluating $\frac{1}{\pi}\int_{0}^{\pi}sin^2(x)dx$ because the $-\frac{1}{2}$ at the end that came from the right side of the equality is correct according to WolframAlpha. But even when I evaluate $\frac{1}{\pi}\int_{0}^{\pi}sin^2(x)dx$ in WolframAlpha, I get the $\frac{1}{2}$ from step (3) which finally becomes $\frac{\pi^2}{8}$ and again, an factor of $\frac{1}{2}$ is missing, so I'm a bit perplex about what's wrong.
Thanks for your help !
Edit: the strange thing is that when I evaluate this sum using Parseval but with the fourier series of |sin(x)| between $0$ and $2\pi$, I get the correct result.
 A: I can't check your calculations since you haven't included them, but it is clear that the Fourier series you found is not the Fourier series of $f$. Your function is not even, so it cannot have a Fourier cosine series. For example,
$$ b_1 = \frac{1}{\pi} \int_0^{2\pi} f(x) \sin(x) \, dx = \frac{1}{\pi} \int_0^{\pi} \sin^2(x) \, dx = \frac{1}{2}. $$
My guess is that you haven't been careful in checking the special case when integrating the complex form (that is, $\int e^{ikx} \, dx = \frac{e^{ikx}}{ik} + C$ only when $k \neq 0$). In fact, the Fourier series of $f$ is given by
$$ \sum_{k = 1}^{\infty} \frac{2}{\pi(1-4k^2)} \cos(2kx) + \frac{1}{\pi} + \frac{1}{2} \sin(x) $$
and you'll get your missing factor from the extra $\sin$ term.

The complex coefficient $c_1$ is given by
$$ c_1 = \frac{1}{2\pi} \int_0^{2\pi} f(x) e^{-ix} \, dx = \frac{1}{2\pi} \int_0^{\pi} \frac{e^{ix} - e^{-ix}}{2i} e^{-ix} \, dx = \frac{1}{4\pi i} \int_0^{\pi} (1 - e^{-2ix}) \ dx = \frac{1}{4\pi i} \left[x - \frac{e^{-2ix}}{-2i} \right]_{x = 0}^{x = \pi} = -\frac{1}{4}i. $$
Similarly,
$$ c_{-1} = \frac{1}{2\pi} \int_0^{2\pi} f(x) e^{ix} \, dx = \frac{1}{2\pi} \int_0^{\pi} \frac{e^{ix} - e^{-ix}}{2i} e^{ix} \, dx = \frac{1}{4\pi i} \int_0^{\pi} (e^{2ix} - 1) \ dx = \frac{1}{4\pi i} \left[\frac{e^{2ix}}{2i} - x \right]_{x = 0}^{x = \pi} = \frac{1}{4}i. $$
Hence,
$$ b_1 = i(c_1 - c_{-1}) = i(-\frac{1}{4}i - \frac{1}{4}i) = \frac{1}{2}. $$
