Find the sum using Fourier series I got the Fourier series for $x^2$ on the interval $[-1,1]$:
$$x^2 = \frac{1}{3}+\frac{4}{\pi^2}\sum_{n=1}^{\infty}(-1)^n\frac{\cos(n\pi x)}{n^2}$$
and I'm supposed to find the sum of:
$$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{(2n-1)^3}.$$
I would think it would be normal to take the integral of both sides of the Fourier series from $-1$ to $1$, but in the solution sheet the take the integral from $-1/2$ to $1/2$, and says it would be wrong to take the integral from $-1$ to $1$. How come that?
 A: Because $$\int_{-1}^1\cos(n\pi x)\,dx=\frac2{n\pi}\sin(n\pi)=0,\qquad n\geq 1.$$
Integration from $-1$ to $1$ gives us nothing but $\int_{-1}^1x^2\,dx=\int_{-1}^1\frac13\,dx=\frac23,$ which doesn't help us to find the value of the series.
However,
$$\int_{-1/2}^{1/2}\cos(n\pi x)\,dx=\frac2{n\pi}\sin(n\pi/2),\qquad n\geq 1$$
So
$$\int_{-1/2}^{1/2}x^2\,dx=\frac13+\frac8{\pi^3}\sum_{n=1}^\infty(-1)^n\frac{\sin\left(\frac{n\pi}2\right)}{n^3}=\frac13-\frac8{\pi^3}\sum_{k=1}^\infty\frac{(-1)^{k+1}}{(2k-1)^3},$$
where we used the fact that, if $n=2k$ for $k\geq1$, then $\sin(n\pi/2)=\sin(k\pi)=0$; if $n=2k-1$ for $k\geq 1$, then
$$\sin\left(\frac{n\pi}2\right)=\sin\left(k\pi-\frac\pi2\right)=(-1)^k\sin\left(-\frac\pi2\right)=(-1)^{k+1},$$
and $(-1)^n=(-1)^{2k-1}=-1$.
Now, we can get the value of the series easily:
$$\sum_{n=1}^\infty\frac{(-1)^{n+1}}{(2n-1)^3}=\frac{\pi^3}{32}.$$
Btw, it is also OK to integrate from $0$ to $1/2$. We are not always integrating on the whole interval where the Fourier expansion holds. We derive the Fourier expansion, and then we use it, in a way depending more on "what we want", rather than "what we have".
