# Solving integral: $\int_0^1\ln^2{\left(\frac{1+x}{1-x}\right)} dx$

I want to show that the solution of a BVP: $$\ u(x) = \ln{\frac{1+x}{1-x}}$$ is in $$L^2(0,1)$$, so I need to show that the integral $$\int\limits_0^1\ln^2|\frac{x+1}{x-1}|dx < \infty$$

Just looking at the function, however, it's not even defined in the interval $$[0,1]$$, right? So can this not actually be a solution to the BVP? Even more generally about the integral itself, does that make it just $$0$$? And if not, can someone explain how an integral of a function can be defined in a region when the function itself is not?

Also, I know that there exist integral calculators online and have looked this up, specifically using: https://www.integral-calculator.com/

If you put in the given integral it says the integral could not be found and then gives a complex number approximation. What should be made of this? I have taken a complex variables course but don't really see how you could solve this using Residue Calculus since we don't have any symmetries.

EDIT: Note I had originally forgot the absolute value signs - my mistake.

• The bounds of the integral are $0$ and $1$, but you speak about the interval $[-1, 1]$ — is this just a typo or did you mean not defined in the interval $[0,1]$? What was the original BVP that you believe this function is a solution to? Apr 23, 2021 at 16:28
• I edited the typo although I think actually the function is still not defined in $[-1,1]$ at all Apr 23, 2021 at 16:30
• Since $\ln^2\frac{z+1}{z-1}$ is non-analytic over $z\in[0,1]$, I suspect this integral be well-defined even in complex domain. Apr 23, 2021 at 16:32
• @user170231 Canonically $\ln^2(x)$ means $\left(\ln(x)\right)^2$. This is frequent notation with logarithms and with trig functions. Apr 23, 2021 at 16:33
• Oh I see, OP is trying to show $u(x)$ is square-integrable. Apr 23, 2021 at 16:34

\begin{align} \int_0^1\log\left(\frac{1+x}{1-x}\right)^2\mathrm{d}x &=\int_1^\infty\log(u)^2\frac{2\,\mathrm{d}u}{(u+1)^2}\tag1\\ &=4\int_1^\infty\frac1{u+1}\frac{\log(u)}u\,\mathrm{d}u\tag2\\ &=-4\int_0^1\frac{\log(u)}{u+1}\,\mathrm{d}u\tag3\\ &=-4\sum_{n=0}^\infty\int_0^1(-1)^nu^n\log(u)\,\mathrm{d}u\tag4\\ &=4\sum_{n=0}^\infty\frac{(-1)^n}{(n+1)^2}\tag5\\ &=4\cdot\frac{\pi^2}{12}\tag6\\[3pt] &=\frac{\pi^2}3\tag7 \end{align} Explanation:
$$(1)$$: $$u=\frac{1+x}{1-x}\implies x=\frac{u-1}{u+1}$$ and $$\mathrm{d}x=\frac{2\,\mathrm{d}u}{(u+1)^2}$$
$$(2)$$: integrate by parts
$$(3)$$: substitute $$u\mapsto1/u$$
$$(4)$$: apply the Taylor series for $$\frac1{1+u}$$
$$(5)$$: $$\int_0^1u^n\log(u)\,\mathrm{d}u=-\frac1{(n+1)^2}$$
$$(6)$$: $$\sum\limits_{n=1}^\infty\frac{(-1)^{n-1}}{n^2}=\sum\limits_{n=1}^\infty\frac1{n^2}-2\sum\limits_{n=1}^\infty\frac1{(2n)^2}=\frac{\pi^2}6-\frac{\pi^2}{12}$$
$$(7)$$: simplify

• This has been a greatly helpful answer! Not only am I quite able to follow this but it's also been easy to verify each step - thank you! Apr 25, 2021 at 14:35

Actually, this integral is very straightforward to evaluate using Cauchy's Theorem in the complex plane.

Consider the complex integral

$$\oint_C dz \, \log^3{\left (\frac{z+1}{z-1} \right )}$$

where $$C$$ is the following contour in the complex plane:

The outer arc of $$C$$ has a radius $$R$$ and the small circular pieces around the branch points at $$z=\pm 1$$ have radius $$\epsilon$$. The contour integral is then equal to

$$e^{i \pi} \int_R^{1+\epsilon} dx \, \log^3{\left (\frac{x-1}{x+1} \right )} + i \epsilon \int_{\pi}^0 dx \, e^{i \phi} \, \log^3{\left (\frac{-1+\epsilon e^{i \phi}+1}{-1+\epsilon e^{i \phi}-1} \right )} \\ + \int_{-1+\epsilon}^{1-\epsilon} dx \, \left [\log{\left (\frac{1+x}{1-x} \right )} -i \pi\right ]^3 + i \epsilon \int_{\pi}^{-\pi} d\phi \, e^{i \phi} \, \log^3{\left (\frac{1+\epsilon e^{i \phi}+1}{1+\epsilon e^{i \phi}-1} \right )} \\ - \int_{-1+\epsilon}^{1-\epsilon} dx \, \left [\log{\left (\frac{1+x}{1-x} \right )} +i \pi \right ]^3 + i \epsilon \int_{2 \pi}^{\pi} dx \, e^{i \phi} \, \log^3{\left (\frac{-1+\epsilon e^{i \phi}+1}{-1+\epsilon e^{i \phi}-1} \right )} \\ - e^{-i \pi} \int_R^{1+\epsilon} dx \, \log^3{\left (\frac{x-1}{x+1} \right )} + i R \int_{-\pi}^{\pi} d\theta \, e^{i \theta} \, \log^3{\left (\frac{R e^{i \theta}+1}{R e^{i \theta}-1} \right )}$$

As $$\epsilon \to 0$$ and $$R \to \infty$$, all integrals vanish or cancel except the third and fifth; the contour integral is then equal to

$$\int_{-1}^1 dx \, \left \{\left [\log{\left (\frac{1+x}{1-x} \right )} -i \pi\right ]^3 -\left [\log{\left (\frac{1+x}{1-x} \right )} +i \pi\right ]^3 \right \}$$

By Cauchy's Theorem, the contour integral is equal to zero. Expanding the integrand, we immediately determine the value of the integral without further computation, because the cube and linear powers of the log cancel. That is, we are left with the log squared term sought, and a constant term that is trivially dealt with. The result is, using symmetry of an even function:

$$\int_0^1 dx \, \log^2{\left (\frac{1+x}{1-x} \right )} = \frac{\pi^2}{3}$$

• [+1] Now I remember this general trick of integrating $log^{n+1}$ in order to obtain $log^n$... Apr 23, 2021 at 20:27

A handy substitution when our limits are from $$x=0$$ and $$x=1$$ is $$t=\frac {1-x}{1+x}\qquad\implies\qquad\mathrm dx=-\frac {2\,\mathrm dt}{(1+t)^2}$$ The integral becomes \begin{align*}\mathfrak{I} & =\int\limits_0^1\mathrm dx\,\log^2\left(\frac {1-x}{1+x}\right)\\ & =2\int\limits_0^1\mathrm dt\,\frac {\log^2t}{(1+t)^2}\end{align*} Now recall the geometric series formula $$\sum\limits_{n\geq1}x^{n-1}=\frac 1{1-x}$$ Differentiating with respect to $$x$$ once gives $$\sum\limits_{n\geq1}nx^{n-1}=\frac 1{(1-x)^2}$$ Replacing the integrand with our modified geometric sequence, then \begin{align*}\mathfrak{I} & =2\sum\limits_{n\geq1}n(-1)^{n-1}\int\limits_0^1\mathrm dt\, t^{n-1}\log^2t\\ & \stackrel{\text{IBP}}{=}4\sum\limits_{n\geq1}\frac {(-1)^{n-1}}{n^2}\end{align*} If you're familiar with Basel's problem, then it's easy to see through some infinite sum manipulation that \begin{align*}\sum\limits_{n\geq1}\frac {(-1)^{n-1}}{n^2} & =\sum\limits_{n\geq1}\frac 1{n^2}-2\sum\limits_{n\geq1}\frac 1{(2n)^2}\\ & =\frac {\pi^2}{12}\end{align*} Hence $$\int\limits_0^1\mathrm dx\,\log^2\left(\frac {1-x}{1+x}\right)=4\left(\frac {\pi^2}{12}\right)=\frac {\pi^2}{3}$$

Substitute $$\frac{1-x}{1+x}\to x$$

\begin{align} \int_0^1\ln^2{\frac{1+x}{1-x}} dx = &\int_0^1\frac{2\ln^2{x}}{(1+x)^2}dx= \int_0^1{\ln^2{x}}\>d\left(\frac {2x}{1+x}\right)\\ =& -4\int_0^1\frac{\ln x}{1+x}dx=-4\cdot (-\frac{\pi^2}{12})=\frac{\pi^2}3 \end{align}

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

• [+1] For those who want to understand the result in blue : see here. Apr 23, 2021 at 21:39

Do you know that :

$$f(x):=\operatorname{ln}\frac{1+x}{1-x}=2\operatorname{arctanh}(x) \ ? \ \tag{1}$$

Remark: $$\operatorname{arctanh}$$ is the same as $$\operatorname{tanh}^{-1}$$.

Besides, Wolfram Alpha gives

$$\int_0^1 \operatorname{arctanh}(x)^2 dx= \pi^2/12$$

Therefore your result is $$\pi^2/48 < \infty$$

Wolfram Alpha also gives an (awful) expression for a primitive function of $$f$$.

• It sounds like you are aware of this, but on $(0,1)$, $\frac{x+1}{x-1}$ is negative. So it's not clear what $\ln\left(\frac{x+1}{x-1}\right)$ means for such $x$-values. Apr 23, 2021 at 18:31
• @JeanMarie is right I made a careless mistake in dropping the absolute value signs Apr 23, 2021 at 18:34
• Hi, isn't it more standard to use the notation $\operatorname{artanh}$ instead of $\operatorname{arctanh}$? Apr 25, 2021 at 21:12
• @A-level Student Thanks for having drawn my attention to the notation with "ar" (en.wikipedia.org/wiki/Inverse_hyperbolic_functions) that honestly I didn't know. In my country (France) we still use peculiar old notations (ch,sh,th instead of cosh, sinh, tanh, etc., argth instead of arctanh or arctanh or atanh) Apr 25, 2021 at 21:37
• @JeanMarie Interesting! My pleasure :) Apr 25, 2021 at 21:40