# Evaluate $\int_{0}^{1} \ln(x)\ln(1-x)\,dx$

Evaluate the integral,

$$\int_{0}^{1} \ln(x)\ln(1-x)\,dx$$

I solved this problem, by writing power series and then calculating the series and found the answer to be $2 -\zeta(2)$, but I don't think that it is best solution to this problem. I want to know if it can be solved by any other nice/elegant method.

Integrating by parts,

$$\int \ln(x) \ln(1-x) \, dx = x \ln(x) \ln(1-x) - x \ln(1-x)+ \int \frac{x \ln (x)}{1-x} \, dx - \int \frac{x}{1-x} \, dx$$

where

$$\int \frac{x}{1-x} \, dx = - \int \ dx + \int \frac{1}{1-x} \, dx = -x - \ln(1-x) + C_{1}$$

and \begin{align} \int \frac{x \ln (x)}{1-x} \, dx &= -x \ln (x) - \ln(x) \ln(1-x) + \int dx + \int \frac{\ln (1-x)}{x} \, dx \\ &= -x \ln (x) - \ln(x) \ln(1-x) + x - \text{Li}_{2}(x) + C_{2}. \end{align}

$\text{Li}_{2}(x)$ is the dilogarithm function.

So we have \begin{align} \int \ln(x) \ln(1-x) \, dx &= x \ln(x) \ln(1-x) - x \ln(1-x) - x \ln(x) - \ln(x) \ln(1-x) + 2x \\ &- \text{Li}_{2}(x) + \ln(1-x) + C . \end{align}

Therefore,

$$\int_{0}^{1} \ln(x) \ln(1-x) \ dx = \lim_{x \to 1} \left[-x \ln(1-x)+\ln(1-x) \right] + 2 - \text{Li}_{2}(1) = 2 - \zeta(2) .$$

• I also tried this, but it turns out too lengthy. +1 as usual. – Tunk-Fey Sep 3 '14 at 19:39
• Thanks for your compliment but I think that's too much, rather your answers and sos440 are very impressive either at MSE or I&S, you both never ceases to amaze me. $\ddot\smile$ – Tunk-Fey Sep 3 '14 at 20:18
• @Tunk-Fey, so you are a user in I&S! – Zaid Alyafeai Sep 3 '14 at 20:25
• @ZaidAlyafeai No, I am not, maybe one day I'll join there. For the time being, I only participate in here and Brilliant.org. I only visit and observe I&S as a non-member. Anyway, I also enjoy your posts in I&S especially for the series and integral involving polylog. – Tunk-Fey Sep 3 '14 at 20:40
• @Tunk-Fey What is I&S? – user940 Sep 3 '14 at 21:53

\begin{align} \int_0^1\ln(1-x)\ln x\ dx&=\int_0^1\sum_{n=1}^\infty\frac{x^n}n\ln x\ dx\\ &=\sum_{n=1}^\infty\frac{1}n\int_0^1 x^n\ln x\ dx\\ &=-\sum_{n=1}^\infty\frac{1}n\cdot\frac1{(n+1)^2}\\ &=\sum_{n=1}^\infty\left[\frac{1}n-\frac1{n+1}-\frac1{(n+1)^2}\right]\\ &=1-\left[\sum_{n=1}^\infty\frac1{n^2}-1\right]\\ &=\large\color{blue}{2-\zeta(2)=2-\frac{\pi^2}6}. \end{align}

Note :

$\displaystyle\ \ \int_0^1 x^\alpha \ln^n x\ dx=\frac{(-1)^n n!}{(\alpha+1)^{n+1}}, \qquad\text{for }\ n=0,1,2,\ldots$

• Ups, I didn't see the OP. I'll edit it if an idea comes to mind. Sorry. – Tunk-Fey Sep 3 '14 at 6:18
• Thanks @JackD'Aurizio. Unfortunately, this is not what OP wants, he asked for other methods. Anyway, have you found a way to obtain the problem asked by V-Moy: a closed-form for $$\int_0^{\Large\frac{\pi}{4}}\ln^2\cos x\ dx\ ?$$I tried to answer but without success so far. – Tunk-Fey Sep 4 '14 at 4:20
• The line below (608) in pi314.net/eng/hypergse13.php#x15-12200013 was the key: Landen identities give that the value of such an integral depends on $\operatorname{Li}_3\left(\frac{1+i}{2}\right)$ as "claimed" by Mathematica. – Jack D'Aurizio Sep 4 '14 at 4:24
• $\zeta(2)$ might not look to significant to the OP. Add the fact that it is $\frac{\pi^2}6$ – Ali Caglayan Sep 7 '14 at 22:14

Using the reflection formula

$$\log(x)\log(1-x) =\zeta(2)-\mathrm{Li}_2(x)-\mathrm{Li}_2(1-x)$$

\begin{align} \int^1_0\log(x)\log(1-x) &=\zeta(2)-\int^1_0\mathrm{Li}_2(x)\,dx-\int^1_0\mathrm{Li}_2(1-x)\,dx\\ &=\zeta(2)-2\int^1_0\mathrm{Li}_2(x)\,dx\\ &=\zeta(2)-2\zeta(2)-2\int^1_0\log(1-x)\,dx\\ &=2-\zeta(2) \end{align}


\begin{align} &\color{#66f}{\large\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,\dd x} =\int_{x\ =\ 0}^{x\ =\ 1}\ln\pars{1 - x}\dd\bracks{x\ln\pars{x} - x + 1} \\[3mm]&=\left.\bracks{x\ln\pars{x} - x + 1}\ln\pars{1 - x}\right\vert_{0}^{1} -\int_{0}^{1}\bracks{x\ln\pars{x} - x + 1}\,{-1 \over 1 - x}\,\dd x =\int_{0}^{1}{x\ln\pars{x} \over 1 - x}\,\dd x + 1 \\[3mm]&=-\lim_{\mu\ \to\ 1}\partiald{}{\mu} \int_{0}^{1}{1 - x^{\mu} \over 1 - x}\,\dd x + 1 =-\lim_{\mu\ \to\ 1}\partiald{\Psi\pars{\mu + 1}}{\mu} + 1 \end{align} where $\ds{\Psi\pars{z}}$ is the Digamma Function $\ds{\bf 6.3.1}$ and we used the identity $\ds{\bf 6.3.22}$.

$$\color{#66f}{\large\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,\dd x} =-\Psi'\pars{2} + 1=-\Psi'\pars{1} + 2=-\zeta\pars{2} + 2$$ Here we used the identities: $$\Psi'\pars{z + 1} = \Psi'\pars{z} - {1 \over z^{2}}\,,\qquad \Psi^{\rm\pars{n}}\pars{1}=\pars{-1}^{n + 1}\,n!\,\zeta\pars{n + 1}\,,\quad n = 1,2,3,\ldots$$

Since $\ds{\zeta\pars{2} = {\pi^{2} \over 6}}$: $$\color{#66f}{\large\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,\dd x} =\color{#66f}{\large 2 - {\pi^{2} \over 6}} \approx {\tt 0.3551}$$

• i love your answers!+1 – RE60K Jan 19 '15 at 3:51
• @ADG Thanks a lot. – Felix Marin Jan 19 '15 at 4:06

You could start from the Beta function $$B(p+1,r+1) = \int_0^1 x^p (1-x)^r\; dx = \dfrac{\Gamma(p+1) \Gamma(r+1)}{\Gamma(p+r+2)}$$ take the derivatives with respect to $p$ and $r$, and evaluate at $p=r=0$.

I've found a solution that is interesting, but probably not elegant, and definitely not short.

$I = \displaystyle\int_0^1 \ln(x)\ln(1 - x) dx$

Basic results:

• $\lim\limits_{n \to 0} \dfrac{x^n - 1}{n} = \log x$, or $\lim\limits_{n \to 1}\dfrac{x^{n-1} - 1}{n - 1} = \log x$.
• $\dfrac{d}{dn}\beta(n, n) = 2\beta(n, n)(\psi_0(n) - \psi_0(2n))$ where $\psi_0(n)$ is the digamma function.
• $\dfrac{d^2}{dn^2}\beta(n, n) = 4\beta(n, n)(\psi_0(n) - \psi_0(2n))^2 + 2\beta(n, n)(\psi_1(n) - 2\psi_1(2n))$, where $\psi(1)(n)$ is the polygamma function.
• $\psi_0(1) - \psi_0(2) = -1$ according to the recurrence relation.
• $\psi_1(2) = \psi_1(1) - 1$ according to the recurrence relation.
• $\psi_1(1) = \zeta(2)$.

Solution:
\begin{align} I & = \lim\limits_{n \to 1} \displaystyle\int_0^1 \dfrac{(x^{n - 1} - 1)((1 - x)^{n - 1} - 1)}{(n - 1)^2} dx\\ & = \lim\limits_{n \to 1}\displaystyle\int_0^1 \dfrac{x^{n-1}(1-x)^{n-1} - x^{n - 1} - (1-x)^{n-1} + 1}{(n-1)^2} dx\\ & = \lim\limits_{n \to 1} \dfrac{\beta(n,n) - \frac{1}{n} - \frac{1}{n} + 1}{(n-1)^2}\\ & = \lim\limits_{n \to 1} \dfrac{\beta(n,n)(\psi_0(n)-\psi_0(2n)) + \frac{2}{n^2}}{2(n-1)} \quad [\text{l'Hospital's rule}]\\ & = \lim\limits_{n \to 1} \dfrac{4\beta(n,n)(\psi_0(n)-\psi_0(2n))^2 + 2\beta(n,n)(\psi_1(n)-2\psi_1(2n))- \frac{4}{n^3}}{2}\quad [\text{l'Hospital's rule}]\\ & = 2\beta(1, 1)(\psi_0(1) - \psi_0(2))^2 + \beta(1, 1)(\psi_1(1) - 2\psi_1(2)) - 2\\ & = 2(-1)^2 + 1(\psi_1(1) - 2\psi_1(1) + 2) - 2\\ & = 2 - \psi_1(1)\\ & = 2-\zeta(2) \end{align}

You could expand $\ln(1-x) =-\sum_{n=1}^{\infty} \frac{x^n}{n}$ and evaluate $\int_0^1 x^n \ln x\,dx$, probably by an induction via integration by parts.

Noting $$\frac{d}{dx}[x(1-\ln(1-x))+\ln(1-x)]=-\ln(1-x)$$ we have \begin{eqnarray} \int_0^1\ln x\ln(1-x)dx&=&-\int_0^1\ln xd[x(1-\ln(1-x))+\ln(1-x)]\\ &=&-[x(1-\ln(1-x))+\ln(1-x)]\ln x\bigg|_0^1+\int_0^1\frac{x(1-\ln(1-x))+\ln(1-x)}{x}dx\\ &=&\int_0^1(1-\ln(1-x)+\frac{\ln(1-x)}{x})dx\\ &=&\int_0^1(1-\ln(1-x))dx+\int_0^1\frac{\ln(1-x)}{x}dx\\ &=&2-\zeta(2). \end{eqnarray} Here we used the well-known result $$\int_0^1\frac{\ln(1-x)}{x}dx=-\zeta(2).$$