How to prove $\int_0^1\frac{1-x}{(\ln x)(1+x)}\ dx=\ln\left(\frac2{\pi}\right)$?

We've $\displaystyle \sum_{n \ge 1} (-1)^n \left[\log(n+1)- \log(n)\right] = \sum_{n \ge 1}(-1)^n\log\left(\frac{n+1}{n}\right) = \log(\mathcal{P})$ where:

$\displaystyle \mathcal{P} = \prod_{n \ge 1}\bigg(\frac{n+1}{n}\bigg)^{(-1)^n} = \prod_{n \ge 1} \bigg(\frac{2n+1}{2n}\bigg) \bigg(\frac{2n}{2n-1}\bigg)^{-1} = \prod_{n \ge 1} \bigg(\frac{2n+1}{2n}\cdot \frac{2n-1}{2n}\bigg) = \frac{2}{\pi}. $

Where the last step is the Wallis product for $\pi$.


Define $I(a) := \int_0^1 \frac{x^a(1-x)}{\ln(x)(1+x)}dx$. Then, for $a > -1$, $I'(a) = \int_0^1 \frac{x^a(1-x)}{1+x}dx = \frac{2_2F_1(1,1+a;2+a;-1)-1}{1+a}$, so $I(a) = 2\log \left(\Gamma(\frac{a}{2}+1)\right)-2\log\left(\Gamma(\frac{a+1}{2})\right)-\log(a+1)+\log(2)$. Plug in $a=0$.


Note that $$\int_0^1 x^y dy=\frac{x-1}{\ln x}$$using this result our integral becomes $$\begin{aligned} I &=\int_0^1\frac{x-1}{(x+1) \ln x}\\&=\int_0^1\left(\frac{1}{x+1}\int_0^1x^ydy\right)dx \\&=\int_0^1\int_0^1\frac{x^y}{1+x}dy dx\\&=\int_0^1\underbrace{\int_0^1\frac{x^y}{1+x}dx }_{I_1}dy \end{aligned}$$ Since the integral $$I_1=\int_0^1\frac{x^y}{1+x}dx =\frac{1}{2}\left(H_{\frac{ y}{2}}-H_{\frac{y-1}{2}}\right)=\frac{1}{2}\left(\psi^0\left(\frac{2y+1}{2}\right)-\psi^0\left(\frac{y+1}{2}\right)\right)$$ is well know result which I have proved here by polynomial long division. Integrating $I_1$ we yield $$ \begin{aligned}I &= \int_0^1 I_1 dy \\&=\left[\ln\Gamma\left(\frac{y+2}{2}\right)-\ln\Gamma\left(\frac{y+1}{2}\right)\right]_0^1\\& =\ln\left[ \Gamma\left(\frac{3}{2}\right)\Gamma\left(\frac{1}{2}\right)\right)\cdots(1)\\&=\ln\left(\frac{\sqrt{\pi}}{2}\sqrt{\pi}\right)=\ln\left(\frac{\pi}{2}\right)\end{aligned}$$ we use the half gamma $\displaystyle \Gamma\left(\frac{1}{2}+n\right)=\frac{(2n)!}{4^n n!}\sqrt{\pi}$ argument in $(1)$ or using functional equation of gamma function we can write $(1)$ as $\displaystyle=\ln\left(\frac{1}{2}\Gamma^2\left(\frac{1}{2}\right)\right)=\ln\left(\frac{\pi}{2}\right)$

Alternatively$$\begin{aligned}I_1 & =\int_0^1\frac{x^y}{1+x}dx \\&=\int_0^1x^y \left(\sum_{r=0}^{\infty} (-1)^r x^r\right)dx\\&=\sum_{r=0}^{\infty} \frac{(-1)^r}{y+r+1}=\Phi\left(-1,1,y+1\right)\cdots(3)\end{aligned}$$ where $\Phi(z,s,\alpha )$ is Lerch Transcendent function using the equation 5 and 6 we obtain $$I= \frac{1}{2}\left(\psi^0\left(\frac{2y+1}{2}\right)-\psi^0\left(\frac{y+1}{2}\right)\right)$$ To prove tha relationship between $ (3)$ and final result we can directly use series formula of digamma function.

The above integral can be related as

$$\int_0^{\infty} \frac{\operatorname{tanh}x}{e^{2x}} \frac{dx}{x}=\int_0^1\frac{x-1}{(1+x)\ln x} =-\ln\left(\frac{2}{\pi}\right)$$