[Math] Using Parseval’s identity to show that $\frac{\pi^2}{8}=1+\frac{1}{3^2}+\frac{1}{5^2}+\frac{1}{7^2}+…$

fourier analysisordinary differential equationsproof-verification

By considering the Fourier sine series on the interval $[0,\pi]$ for $f(x)=1$, show that $$\frac{\pi^2}{8}=1+\frac{1}{3^2}+\frac{1}{5^2}+\frac{1}{7^2}+…$$

I am having trouble computing the Fourier sine series, which will have the form $$Sf(x)=\frac{a_0}{2}+\sum_{k=1}^{\infty} a_k\cos\left(\frac{k\pi x}{L}\right), \ \ k\geq 1.$$
I have computed that $a_0=1$ and $a_n=0$, using $$a_0=\frac{1}{L}\int_{-L}^{L} f(x) \ dx, \ \ a_k=\frac{1}{L}\int_{-L}^{L} f(x)\cos\left(\frac{k\pi x}{L}\right) \ dx,$$ where $L$ denotes half a period. Once the correct Fourier series is calculated, showing the result using $$\Vert{f}\Vert^2_{w}=\sum_{j=1}^{\infty} A^2_j\Vert\phi_j\Vert^2_w,$$
should not be so hard.


I have found the Fourier sine series, $$Sf(x)=\frac{4}{\pi}\sum_{j=1}^{\infty} \frac{\sin((2j-1)x)}{(2j-1)}.$$ But I having trouble proving the identity in the title. Using Parseval's identity provided above, I get that $$\Vert f\Vert^2_w=1, \ \ \sum_{j=1}^{\infty} A^2_j\Vert\phi_j\Vert^2_w=\frac{8}{\pi}\sum_{j=1}^{\infty}\frac{1}{(2j-1)^2},$$ which does not show the required result (out by a factor of $\pi$). Note: I took the weight function, $w$, to be $1$. Please help.

Best Answer

As mentioned in the comments, you're looking for a series of sines, not cosines here. I'm guessing you went for cosines because the function is even, like cosine. But the interval you're looking at here is $[0,\pi]$, not $[-\pi,\pi]$, and in fact in this interval it is the sine function that is symmetric (because $\sin(\pi-x)=\sin x$).

Your Fourier series should then look something like $\displaystyle \sum a_k\sin\left(\frac{k\pi x}{L}\right)$, where the $a_k$ are instead given by $$a_k=\frac{2}{\pi}\int_0^\pi f(x)\sin\left(\frac{k\pi x}{L}\right)\,dx$$ (so integrating over just half of the interval, from $0$ to $\pi$).

Another way to get this same series is to instead extend $f$ by defining $$f(x)=\begin{cases}1&x>0\\-1&x<0\end{cases}$$ on the entire interval $[-\pi,\pi]$. Now you can use the form of the Fourier series you have in your question; since the function is odd, its series will have only sines. On the interval $[0,\pi]$ it is just equal to $1$ still, though.