9
$\begingroup$

I've been trying to solve the following integral for days now.

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

with $c > 0$. I figured out (numerically, by accident) that if $c = 1$, then $P = \pi^2/4$. But why? And more importantly: what's the general solution of $P$, for given $c$? I tried partial fraction expansions, Taylor polynomials for $ln(x)$ and more, but nothing seems to work. I can't even figure out where the $\pi^2/4$ comes from.

(Background: for a hobby project I'm building a machine learning algorithm that predicts sports match scores. Somehow the breaking point is this integral, so solving it would get things moving again.)

$\endgroup$
3
  • $\begingroup$ If it was me: I would do a partial fraction expansion, then integration by parts, and change of variable. YMWV! $\endgroup$
    – rrogers
    Jul 27, 2019 at 12:51
  • 2
    $\begingroup$ I would be interested in how that integral relates to machine learning. Could you give a link, or a brief comment? $\endgroup$ Jul 28, 2019 at 16:54
  • 1
    $\begingroup$ @thomasfermi: It's to predict sports match scores. There's a few assumptions in the model. 1. Every team has a strength s_i. 2. The probability that team i beats team j is a sigmoidal function e^(s_i)/(e^(s_i)+e^(s_j)). 3. The prior distribution of s_i is the PDF e^(s_i)/(e^(s_i)+1)^2. If you then apply Bayes' law, you can find the distribution of the full set S of all team strengths. That is, p(S|games) = p(games|S)*p(S) / p(games). If you simply take two teams, insert a 2-0 score, and try to calculate p(games), which is a double integral, then you wind up with the above integral. $\endgroup$
    – Hildo Bijl
    Jul 29, 2019 at 22:33

3 Answers 3

17
$\begingroup$

$$\bbox[10pt, border:2px, lightblue]{\int_0^\infty \frac{\ln x}{(x+c)(x-1)}dx=\frac{\pi^2+\ln^2 c}{2(1+c)},\ \ c>0}$$ A nice solution can be found here due to Yaghoub Sharifi.


Perhaps it might be into your interest to see a solution for the following integral: $$I(a,b)=\int_0^\infty \frac{\ln x}{(x+a)(x+b)}dx\overset{x\to \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\Rightarrow \boxed{I(a,b)=\frac{\ln(ab)}{2}\frac{\ln\left(\frac{a}{b}\right)}{a-b},\ \ a,b>0}$$ One might force putting $a=c, b=-1$ in the above and take $\ln(-1)=i\pi$ (the principal value). $$\Rightarrow I(c,-1)=\frac{\ln^2 c-\ln^2 (-1)}{2(c+1)}=\frac{\pi^2 +\ln^2 c}{2(1+c)}$$

$\endgroup$
7
  • 1
    $\begingroup$ Thanks! This is great. :-D It definitely provides me with enough inspiration for another day buried in equations. $\endgroup$
    – Hildo Bijl
    Jul 27, 2019 at 13:22
  • $\begingroup$ I don't get it how replacing $a$ with $c$ and $b=-1$ gets you from $ln(ab)ln(a/b)$ to $ln^2c-ln^2(-1)$. Because after replacing I simply get $ln(-c)ln(-c)$ which ($ln(-c)=ln(c)+ln(-1)$) is $ln^2c+2ln(c)ln(-1)+ln^2(-1)$ which gives another $2i{\pi}ln(c)$ Any explanation would be welcome. $\endgroup$
    – imranfat
    Jul 28, 2019 at 22:11
  • 1
    $\begingroup$ @imranfat I've asked a question about it here: math.stackexchange.com/questions/3306956/… hope it will be helpful. $\endgroup$
    – Zacky
    Jul 29, 2019 at 0:03
  • 1
    $\begingroup$ That's very interesting and quite coincidental. For fun I was working on $\int_0^\infty \frac{\ln x}{x^2-1}dx$, and when I subbed $x=1/t$, it lead to nothing as the integral $I$ cancels.You gave me enough food for thought for the time being. Now I can't sleep tonight. Thanks! :) $\endgroup$
    – imranfat
    Jul 29, 2019 at 1:26
  • 1
    $\begingroup$ I figured it out. Very helpful $\endgroup$
    – imranfat
    Jul 31, 2019 at 0:20
2
$\begingroup$

A more general way:

Use the classic integral

$$\int_0^\infty \frac{x^p}{a+x}\;dx=-a^p\frac{\pi}{\sin(\pi p)};-1<p<0$$

Then

$$\int_0^\infty\frac{x^p}{(a+x)(c+x)}\;dx=\frac{\pi}{\sin(\pi p)}\frac{c^p-a^p}{c-a}$$

Now differentiate this with respect to $p$ and compute the limit of the result of differentiation as $p$ approaches $0$ to get

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

$\endgroup$
3
  • $\begingroup$ An interesting approach, but is there a link how to find the anti derivative of the "classic" integral? $\endgroup$
    – imranfat
    Jul 30, 2019 at 16:19
  • $\begingroup$ @imranfat There is no simple expression for the antiderivative. But if you want to compute a similar, a bit of simpler integral $\int_0^\infty \frac{x^{p-1}}{1+x}\;dx=\frac{\pi}{\sin(\pi p)}$ then the shortest way is to note that $\frac{1}{1+x}=\int_0^\infty e^{-(1+x)y}\;dy$. Then change the order of integration in double integral and use Euler's reflection formula $\Gamma(p)\Gamma(1-p)=\frac{\pi}{\sin(\pi p)}$ $\endgroup$ Aug 2, 2019 at 14:50
  • $\begingroup$ Ah, something with the Gamma function. I knew there had to be something to it. Thanks. $\endgroup$
    – imranfat
    Aug 2, 2019 at 16:34
1
$\begingroup$

A different approach using polylogarithms

For this solution the following identities are used

$\displaystyle\text{Li}_2\left(z\right)=-\int _0^z\frac{\ln \left(1-t\right)}{t}\:dt$, $\displaystyle \int _0^1\frac{c\ln ^n\left(x\right)}{1-cx}\:dx=\left(-1\right)^nn!\text{Li}_{n+1}\left(c\right)$, $\displaystyle \text{Li}_2\left(-z\right)+\text{Li}_2\left(-\frac{1}{z}\right)=-\zeta \left(2\right)-\frac{1}{2}\ln ^2\left(z\right)$

$$\int_0^{\infty}\frac{\ln\left(x\right)}{\left(c+x\right)\left(x-1\right)}\:dx$$ $$=\int _0^1\frac{\ln \left(x\right)}{\left(c+x\right)\left(x-1\right)}\:dx+\underbrace{\int _1^{\infty }\frac{\ln \left(x\right)}{\left(c+x\right)\left(x-1\right)}\:dx}_{x=\frac{1}{x}}$$ $$\hspace{-5mm}=\frac{2}{1+c}\int _0^1\frac{\ln \left(x\right)}{x-1}\:dx-\frac{1}{1+c}\underbrace{\int _0^1\frac{\ln \left(x\right)}{c+x}\:dx}_{x=ct}-\frac{c}{1+c}\int _0^1\frac{\ln \left(x\right)}{1+cx}\:dx$$ $$\hspace{-8mm}=\frac{2}{1+c}\zeta \left(2\right)-\frac{\ln \left(c\right)}{1+c}\int _0^{\frac{1}{c}}\frac{1}{1+t}\:dt-\frac{1}{1+c}\underbrace{\int _0^{\frac{1}{c}}\frac{\ln \left(t\right)}{1+t}\:dt}_{\text{IBP}}-\frac{1}{1+c}\text{Li}_2\left(-c\right)$$ $$\hspace{-2mm}=\frac{2}{1+c}\zeta \left(2\right)-\frac{\ln \left(c\right)}{1+c}\ln \left(1+\frac{1}{c}\right)+\frac{1}{1+c}\ln \left(c\right)\ln \left(1+\frac{1}{c}\right)$$ $$+\frac{1}{1+c}\underbrace{\int _0^{\frac{1}{c}}\frac{\ln \left(1+t\right)}{t}\:dt}_{t=-t}-\frac{1}{1+c}\text{Li}_2\left(-c\right)$$ $$=\frac{2}{1+c}\zeta \left(2\right)-\frac{1}{1+c}\text{Li}_2\left(-\frac{1}{c}\right)-\frac{1}{1+c}\text{Li}_2\left(-c\right)$$ $$=\frac{2}{1+c}\zeta \left(2\right)-\frac{1}{1+c}\left(\text{Li}_2\left(-\frac{1}{c}\right)+\text{Li}_2\left(-c\right)\right)$$ $$=\frac{2}{1+c}\zeta \left(2\right)-\frac{1}{1+c}\left(-\zeta \left(2\right)-\frac{1}{2}\ln ^2\left(c\right)\right)$$ Thus $$\int_0^{\infty}\frac{\ln\left(x\right)}{\left(c+x\right)\left(x-1\right)}\:dx=\frac{3}{1+c}\zeta \left(2\right)+\frac{1}{2\left(1+c\right)}\ln ^2\left(c\right)$$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .