Ways to show $\int_0^{\infty}\frac{\sin^2(\pi x)}{x^2}\Big\lvert x-\Big\lfloor x +\frac12 \Big\rfloor \Big\rvert \, \mathrm{d}x = \frac{\pi^2}{8}$

alternative-proofcalculusdefinite integralsintegrationsequences-and-series

Whilst reading about Lobachevsky's integral formula I tried constructing some interesting integrals which could be evaluated with said formula. One result I found was

$$\int\limits_{0}^{\infty} \frac{\sin^2(\pi x)}{x^2}\left\lvert x – \left\lfloor x + \frac12 \right\rfloor \right\rvert \, \mathrm{d}x = \frac{\pi^2}{8} $$

which under substitution $ u = \pi x$ can be evaluated with Lobachevsky's formula since $\int_0^\frac\pi2 \Big\lvert \frac{x}{\pi} – \Big\lfloor \frac{x}{\pi} + \frac12 \Big\rfloor \Big\rvert \, \mathrm{d}x =\int_0^\frac\pi2 \frac{x}{\pi}\, \mathrm{d}x =\frac{\pi}{8}$.

However, once I had shown this result I remembered that $\frac{\pi^2}{8}$ has the very nice series representation
$$
\sum_{n\ge0} \frac{1}{(2n+1)^2} = \frac{\pi^2}{8} \tag{1}
$$

So my question is

Is there a way to evaluate this integral using $(1)$? Or is it just a coincidence that the values match?

Best Answer

The triangle wave involved in the integral has a simple Fourier series:

$$ \left|x-\left\lfloor x+\frac{1}{2}\right\rfloor\right|=\frac{1}{4}-\frac{2}{\pi^2}\sum_{n\geq 0}\frac{\cos((2n+1)2\pi x)}{(2n+1)^2} \tag{1}$$ and since

$$ \int_{0}^{+\infty}\frac{\sin^2(\pi x)}{x^2}\,dx = \frac{\pi^2}{2},\qquad \int_{0}^{+\infty}\frac{\sin^2(\pi x)}{x^2}\,\cos((2n+1)2\pi x)\,dx = 0\tag{2}$$ the integral converges to $\frac{\pi^2}{2}$ times the average value of the triangle wave.
On the other hand, since the triangle wave is piecewise linear, such average value is exactly half the value at $x=\frac{1}{2}$. Since the RHS of $(1)$ is absolutely convergent the evaluation at $x=\frac{1}{2}$ leads to $$ \sum_{n\geq 0}\frac{1}{(2n+1)^2}=\frac{\pi^2}{8}\tag{3} $$ i.e. to a proof of the Basel problem, independent from Lobachevsky's integral formula.