7

Let $b>1$. What's the analytical expression for the following integral?

$$\int_0^1 \ln(x)\ln(b-x)\,\mathrm{d}x$$

Mathematica returns the following answer:

$$2-\frac{\pi^{2}}{3}b+\left(b-1\right)\ln\left(b-1\right)-b\ln b+\mathrm{i}b\pi\ln b+\frac{1}{2}b\ln^{2}b+b\mathrm{Li}_{2}\left(b\right)$$

which contains the imaginary term $\mathrm{i}b\pi\ln b$. But the actual answer is real, so this term should cancel somehow with the dilogarithm function. But I don't know how to do this.

a06e
  • 6,665
  • 3
    For $b>1$, the imaginary part of $\text{Li}_{2}(b)$ is $-i \pi \ln b$. http://en.wikipedia.org/wiki/Polylogarithm#Dilogarithm – Random Variable Jun 19 '14 at 19:43
  • @RandomVariable My problem is that I need to program this in C++. Is there a way to obtain directly the answer without having to go through imaginary values? – a06e Jun 19 '14 at 19:44
  • The Maple code $$int(ln(x)*ln(b-x), x = 0 .. 1),assuming,b>0 $$ produces the real-valued answer $$ 2-1/6,{\pi }^{2}b-\ln \left( b \right) b-\ln \left( b \right) b\ln \left( -1+b \right) +1/2, \left( \ln \left( b \right) \right) ^{2} b-b{\it dilog} \left( b \right) +b\ln \left( -1+b \right) -\ln \left( -1+b \right) $$ – user64494 Jun 19 '14 at 19:52
  • @user64494 Can you use the assumption $b>1$ instead of $b>0$? The problem is that $\mathrm{Li}_2(b)$ is complex for $b>1$. – a06e Jun 19 '14 at 19:54
  • This is a misprint. In fact, I use $assuming, b>1$. See the code with the output exported as PDF here. – user64494 Jun 19 '14 at 20:17
  • @user64494 Then I don't understand your formula. There's no term to take away the imaginary part of $\mathrm{Li}_2 (b)$. Am I missing something? Or is Maple using a different definition of $\mathrm{Li}_2$? – a06e Jun 19 '14 at 20:30
  • @RandomVariable I just realized that GSL computes the real part of the dilogarithm function, so this is no problem in C++. You can post an answer if you like, since your observation solves my problem. – a06e Jun 19 '14 at 20:38
  • @ besko : see dilog for info. This is a real-valued function if $b>1.$ – user64494 Jun 19 '14 at 20:38
  • That appears to be some sort of alternative definition of the dilogarithm. If you ask Maple to evaluate $ \text{polylog}(2,x)$ for any value of $x>1$, it will return something with an imaginary part. And you could just replace $\text{Li}{2}(b)$ with that expression for $\text{Li}{2}(b)$ for $b >1$ on the Wikipedia page. Then the answer will be in terms of $\text{Li}_{2}(\frac{1}{b})$. – Random Variable Jun 19 '14 at 21:01

3 Answers3

7

The following is an evaluation in terms of $ \displaystyle \text{Li}_{2} \left(\frac{1}{b} \right)$, which is real-valued for $b > 1$.

$$\begin{align} \int_{0}^{1} \log(x) \log(b-x) \ dx &= \log(b) \int_{0}^{1} \log(x) + \int_{0}^{1}\log(x) \log \left(1- \frac{x}{b} \right) \ dx \\ &= - \log(b) - \int_{0}^{1} \log(x) \sum_{n=1}^{\infty} \frac{1}{n} \left( \frac{x}{b}\right)^{n} \ dx \\ &= - \log(b) - \sum_{n=1}^{\infty} \frac{1}{nb^{n}} \int_{0}^{1} \log(x) x^{n} \ dx \\ &= - \log(b) + \sum_{n=1}^{\infty} \frac{1}{nb^{n}} \frac{1}{(n+1)^{2}} \\ &= - \log(b) - \sum_{n=1}^{\infty} \frac{1}{n+1} \frac{1}{b^{n}} - \sum_{n=1}^{\infty} \frac{1}{(n+1)^{2}} \frac{1}{b^{n}} + \sum_{n=1}^{\infty} \frac{1}{n} \frac{1}{b^{n}} \\ &= - \log(b) - \left(-\frac{\log(1-\frac{1}{b})}{\frac{1}{b}}-1\right) - \left(\frac{\text{Li}_{2}(\frac{1}{b})}{\frac{1}{b}} -1\right) - \log \left(1- \frac{1}{b} \right) \\ &= - \log(b) +2 + (b-1) \log \left(1-\frac{1}{b} \right) - b \ \text{Li}_{2} \left( \frac{1}{b}\right) \end{align}$$

EDIT:

The answer can be written in the form

$$-b \ \text{Li}_{2} \left( \frac{1}{b}\right) +2 + (b-1) \log(b-1) - b \log(b) $$

which is what Wolfram Alpha returns for specific integer values of $b$ greater than $1$.

For non-integer values of $b$ greater than $1$, it manipulates the answer a bit differently.

  • Can you take a look at: http://math.stackexchange.com/q/840146/10063? It's a similar integral. I've tried to follow your steps, but I have had no success. I'm stuck at the long expression returned by Mathematica. – a06e Jun 19 '14 at 23:54
6

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{1}\ln\pars{x}\ln\pars{b - x}\,\dd x:\ {\large ?}\,,\qquad b > 1}$.

With $\ds{0 < \epsilon < 1}$: \begin{align}&\totald{}{b} \color{#c00000}{\int_{\epsilon}^{1}\ln\pars{x}\ln\pars{b - x}\,\dd x} =\int_{\epsilon}^{1}\ln\pars{x}\bracks{-\,\partiald{\ln\pars{b - x}}{x}}\,\dd x \\[3mm]&=\ln\pars{\epsilon}\ln\pars{b - \epsilon} +\int_{\epsilon}^{1}\ln\pars{b - x}\,{1 \over x}\,\dd x \\[3mm]&=\ln\pars{\epsilon}\ln\pars{b - \epsilon} +\int_{\epsilon/b}^{1/b}{\ln\pars{b} + \ln\pars{1 - x} \over x}\,\dd x \\[3mm]&=\ln\pars{\epsilon}\ln\pars{b - \epsilon} +\ln\pars{b}\bracks{\ln\pars{1 \over b} - \ln\pars{\epsilon \over b}} -\int_{\epsilon/b}^{1/b}{\rm Li}_{1}\pars{x}\,\dd x \\[3mm]&=\ln\pars{\epsilon}\bracks{\ln\pars{b - \epsilon} - \ln\pars{b}} -\int_{\epsilon/b}^{1/b}\totald{{\rm Li}_{2}\pars{x}}{x}\,\dd x \\[3mm]&=\ \overbrace{\ln\pars{\epsilon}\bracks{\ln\pars{b - \epsilon} - \ln\pars{b}}} ^{\ds{\to\ 0\quad\mbox{when}\quad\epsilon\ \to\ 0^{+}}}\ -\ {\rm Li}_{2}\pars{1 \over b} + {\rm Li}_{2}\pars{\epsilon \over b} \end{align}

$$ \totald{}{b} \color{#c00000}{\int_{0}^{1}\ln\pars{x}\ln\pars{b - x}\,\dd x} = -{\rm Li}_{2}\pars{1 \over b} $$

\begin{align} \color{#c00000}{\int_{0}^{1}\ln\pars{x}\ln\pars{b - x}\,\dd x} =\overbrace{\quad-\int_{0}^{1}\ln\pars{x}\ln\pars{1 - x}\,\dd x\quad} ^{\ds{-2 + {\pi^{2} \over 6}}}\ -\ \int_{1}^{b}{\rm Li}_{2}\pars{1 \over t}\,\dd t \end{align} In the RHS, the first integral is easily evaluated by means of a Beta function or/and $\ds{\ln\pars{1 - x}}$ expansion. The second one is evaluated, in a rather cumbersome way, by using the serie definition of $\ds{{\rm Li}_{2}\pars{z}}$. I see other answers already did that.

Felix Marin
  • 89,464
3

Define $$ I(a)=\int_0^1x^a\ln(b-x)dx. $$ It is easy to see that $$ \int_0^1\ln x\ln(b-x)dx=\lim_{a\to 0^+}I'(a). $$ Now \begin{eqnarray*} I(a)&=&\frac{1}{a+1}\int_0^1\ln(b-x)d(x^{a+1})=\frac{1}{a+1}\left(x^{a+1}\ln(b-x)|_0^1+\int_0^1\frac{x^{a+1}}{b-x}dx\right)\\ &=&\frac{1}{a+1}\left(\ln(b-1)+\frac{1}{b}\sum_{n=0}^\infty\int_0^1\frac{1}{b^n}x^{a+1+n}dx\right)\\ &=&\frac{1}{a+1}\left(\ln(b-1)+\sum_{n=0}^\infty\frac{1}{b^{n+1}(a+2+n)}\right)\\ \end{eqnarray*} and hence \begin{eqnarray*} I'(0) &=&-\ln(b-1)-\sum_{n=0}^\infty\frac{1}{b^{n+1}(2+n)}-\sum_{n=0}^\infty\frac{1}{b^{n+1}(2+n)^2}\\ &=&-\ln(b-1)+2+b\ln\frac{b-1}{b}-b\text{Li}_2(1/b). \end{eqnarray*}

xpaul
  • 44,000