# A lucky proof for the Basel problem.

I'll modify this part since I want the proof to be here.

$$\sum_{n=1}^\infty \frac{1}{n^2}=\frac43\sum_{n=0}^\infty \frac{1}{(2n+1)^2}=-\frac43\sum_{n=0}^\infty \int_0^1 x^{2n}\ln x dx=\frac43\int_0^1 \frac{\ln x}{x^2-1}dx$$ $$\int_0^1 \frac{\ln x}{x^2-1}dx\overset{x\rightarrow \frac{1}{x}}=\int_1^\infty \frac{\ln x}{x^2-1}dx\Rightarrow \sum_{n=1}^\infty \frac{1}{n^2}=\frac23 \int_0^\infty \frac{\ln x}{(x+1)(x-1)}dx$$

$$=\frac23 I(1,-1)=\frac23 \frac{\ln^2 (1)-\ln^2(-1)}{2(1-(-1))}=\frac23 \frac{\pi^2}{4}=\frac{\pi^2}{6}$$

Where we considered the following integral: $$I(a,b)=\int_0^\infty \frac{\ln x}{(x+a)(x+b)}dx\overset{x\rightarrow \frac{ab}{x}}=\int_0^\infty \frac{\ln\left(\frac{ab}{x}\right)}{(x+a)(x+b)}dx$$ Summing up the two integrals from above gives: $$2I(a,b)=\ln(ab)\int_0^\infty \frac{1}{(x+a)(x+b)}dx=\frac{\ln(ab)}{a-b}\ln\left(\frac{x+b}{x+a}\right)\bigg|_0^\infty$$ $$\Rightarrow I(a,b)=\frac{\ln(ab)}{2}\frac{\ln\left(\frac{a}{b}\right)}{a-b}=\frac{\ln^2 a-\ln^2 b}{2(a-b)}$$

From here we know that:

$$\int_0^\infty \frac{\ln x}{(x+a)(x-1)}dx=\frac{\ln^2 a+\pi^2}{2(a+1)}$$

Also by plugging $$b=-1$$ in $$I(a,b)$$ we get: $$I(a,-1)=\int_0^\infty \frac{\ln x}{(x+a)(x-1)}dx=\frac{\ln^2a -\ln^2 (-1)}{2(a-(-1))}=\frac{\ln^2 a+\pi^2 }{2(a+1)}$$

We already know that this is true from the linked post, but let's ignore it, since the linked post uses the Basel problem to prove the result.

Can someone prove rigorously that we are allowed to plug in $$b=-1$$ in order to get the correct result?

• I always get queasy when improper integrals are manipulated purely symbolically. – Randall Jul 29 at 0:33
• @Randall what do you mean by that? What is wrong with my approach? – Zacky Jul 29 at 15:53
• Nothing is wrong with your question. I just get worried when improper integrals are broken up and rearranged with sum-rules without explicitly examining convergence. – Randall Jul 29 at 15:55

Fixing $$a >0$$, we see that the integral \begin{align*} f(z) := \int_0^\infty \frac{\log x}{(x+a)(x+z)} dx. \end{align*} converges absolutely for $$z$$ away from $$(-\infty,0]$$. So $$f$$ defines an analytic function on $$\mathbb C \setminus (-\infty,0]$$ (which can be checked by Morera's theorem and Fubini's theorem, for example.) This implies $$f(z) = \frac{\log^2 a - \log^2 z}{2(a-z)}$$ holds not only on $$(0,\infty)$$ but also $$\mathbb C \setminus (-\infty,0]$$ by analytic continuation. Now we need to check the continuity of $$f$$ at $$z=-1$$. Let $$F(x) = \int_1^x \frac{ \log t}{(t+a)(t-1)} dt,\quad x\ge 0$$ so that $$F(\infty) - F(0)$$ is the desired integral $$\displaystyle I(a) = \int_0^\infty \frac{\log x}{(x+a)(x-1)} dx$$. By integration by parts, \begin{align*} f(z) =& \left[F(x)\frac{ x-1}{x+z}\right]^\infty _0 - (1+z)\int_0^\infty \frac{F(x)}{(x+z)^2} dx\\ =& \left(F(\infty) +\frac{F(0)}{z} \right)- (1+z)\int_0^\infty \frac{F(x)}{(x+z)^2} dx,\quad z\neq 0 \end{align*} The first term tends to $$I(a)$$ as $$z\to -1$$. For $$z=-1+it, t>0$$, the second term can be estimated as \begin{align*} |1+z|\left|\int_0^\infty \frac{F(x)}{(x+z)^2} dx\right| \le& t \int_0^\infty \frac{|F(x)|}{|x-1+it|^2} dx \\ \le& \int_0^\infty \frac{t}{(x-1)^2 + t^2} |F(x)| dx\\ &\xrightarrow{t\to 0} \pi |F(1)| = 0. \end{align*} Thus $$I(a)= \lim_{t\to 0^+} f(-1+it) =\frac{\log^2 a +\pi^2}{2(1+a)} .$$ Note that this argument only works for $$z=-1$$ since $$\displaystyle F(x) =\int_c^x \frac{\log t}{(t+a)(t-c)} dt$$ is not well-defined (due to the singularity at $$t=c$$) for $$c>0, c\ne 1$$.

• This looks clean, thank you! Also can you please take a look at the comments from here: math.stackexchange.com/a/3305543/515527 ? Is my explanation correct to the fact that we should take the right-most equality from $I(a,b)=\frac{\ln(ab)}{2}\frac{\ln\left(\frac{a}{b}\right)}{a-b}=\frac{\ln^2 a-\ln^2 b}{2(a-b)}$ and not the first one since we don't get rid of the imaginary part? – Zacky Jul 30 at 20:30
• @ㄴㄱ I think we can see the validity of the first equality this way. Note I took limit along $z= -1 + it$ as $t\to 0^+$ in my answer, because it may be potentially risky to take $\log (-1)=\pi i$ perfunctorially and there are other possible candidates for this value, such as $-\pi i$ or even $\pm 3\pi i$, etc. That's why we use branch cut of complex log and I took the limit approach. If we take the same limit $z=-1+it, t\to 0^+$, then the first equation would give the correct result - – Song Jul 31 at 14:18
• $$\lim_{\epsilon \to 0^+}\frac{\log(-a-i\epsilon)\log(-a+ i\epsilon)}{2(a+1-\epsilon)} = \frac{\left(\log a-\pi i\right)\left(\log a + \pi i\right)}{2(a+1)} = \frac{\ln^2 a + \pi^2}{2(a+1)}.$$ (Or we can take limit as $z=-1+it, t\to 0^-$ to get the same result.) And according to Dave's answer, for general principal value integral $\int_0^\infty \frac{\log x}{(x+a)(x-b)}dx$, we should take two sided limit $\lim_{t \to 0^+}\frac{f(-b+it) + f(-b-it)}2.$ – Song Jul 31 at 14:20
1. In fact, the equation $$\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x+b)}=\frac{(\ln a)^2-(\ln b)^2}{2(a-b)}$$ holds for all distinct complex $$a$$, $$b$$ not lying on the nonpositive real axis, as follows immediately from the contour integral representation $$\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x+b)}=-\int_H\frac{\mathrm{d}x}{2\pi\mathrm{i}}\frac{(\ln x)^2}{2(x-a)(x-b)}\text{.}$$ Here $$H$$ is a Hankel contour about the negative real axis—where the branch cut of $$\ln$$ is chosen to be.

2. Even if $$b<0$$, we may consider the Cauchy principal value $$\mathrm{P}\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x-\lvert b\rvert)}\text{.}$$ In this case, we may use the Sokhotski–Plemelj theorem to arrive at $$\mathrm{P}\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x-\lvert b\rvert)}=\frac{(\ln a)^2-(\ln \lvert b\rvert )^2+\pi^2}{2(a+\lvert b\rvert)}\text{.}$$

3. If we let $$b=-1$$, then the integral converges and is equal to its Cauchy principal value. Therefore $$\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x-1)}=\frac{(\ln a)^2+\pi^2}{2(a+1)}\text{.}$$
• In $\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+a)(x+b)}=\frac{(\log a)^2-(\log b)^2}{2(a-b)}$ it is the branch of $\log$ analytic on $\Bbb{C}-(-\infty,0]$ which is $\ln$ on $(0,\infty$), then you can say $\int_0^{\infty}\frac{\ln x\mathrm{d}x}{x^2-1}=\lim_{\epsilon \to 0^+}\int_0^{\infty}\frac{\ln x\mathrm{d}x}{(x+1)(x-1+i\epsilon)}$ – reuns Jul 29 at 13:59

Here is an 'elementary' proof of its validity, which stays clear of any complex analyses and infinite expansions. Decompose the integrand as below,

$$I =\int_0^\infty \frac{\ln x}{(x+c)(x-1)}dx = \frac{1}{c+1} \int_0^\infty {\ln x}\left[ \frac{c-1}{(x+c)(x+1)} +\frac{2}{x^2-1} \right] dx$$

Thus, the integral $$I$$ can be expressed as,

$$I = \frac{c-1}{c+1}I_1 + \frac{2}{c+1}I_2 \tag{1}$$

where,

$$I_1 =\int_0^\infty \frac{\ln x}{(x+c)(x+1)}dx,\>\>\>\>\> I_2 =\int_0^\infty \frac{\ln x}{x^2-1}dx$$

The integral $$I_1$$, valid for $$c>0$$, has already been evaluated in a couple of places, which is sketched below with the variable change $$x=c/t$$,

$$I_1 =\int_0^\infty \frac{\ln c - \ln t}{(t+c)(t+1)}dt = \int_0^\infty \frac{\ln c}{(t+c)(t+1)}dt - I_1$$ $$= \frac{\ln c}{2} \int_0^\infty \frac{dt}{(t+c)(t+1)} = \frac{\ln^2 c}{2(c-1)}\tag{2}$$

The second integral is more involved, evaluated below with some agile manipulation. Recognizing $$I_2 = J(\alpha=1)$$, where $$J(\alpha)$$ is defined as

$$J(\alpha) =\int_0^\infty \frac{\ln (1-\alpha^2 + \alpha^2 x^2)}{2(x^2-1)}dx$$

The computation of its derivative is straightforward,

$$J'(\alpha) =\int_0^\infty \frac{\alpha dx}{1-\alpha^2 + \alpha^2 x^2} = \frac{1}{\sqrt{1-\alpha^2}} \int_0^\infty \frac{du}{1+u^2} = \frac{\tan^{-1}(\infty)}{\sqrt{1-\alpha^2}} = \frac{\pi/2}{\sqrt{1-\alpha^2}}$$

which allows the desired integral $$I_2$$ to be evaluated,

$$I_2 = J(1) = \int_0^1 J'(\alpha) d\alpha = \frac{\pi}{2}\int_0^1 \frac{d\alpha}{\sqrt{1-\alpha^2}} =\frac{\pi}{2} \sin^{-1}(1) = \frac{\pi^2}{4} \tag{3}$$

Finally, substituting (2) and (3) into (1), we obtain the sought-after result

$$I =\int_0^\infty \frac{\ln x}{(x+c)(x-1)}dx = \frac{\pi^2 + \ln^2 c}{2(c+1)}$$