The result of $$\int_0^1 \frac{\ln(x+a)}{x^2+1}\, \mathrm{d}x$$ should be real for positive number $a$, but Mathematica always gives a result full of terms like $$\mathrm{i}
\cdot \operatorname{PolyLog[2,\text{a complex number}]}$$
I even tried Feynman's integral method, i.e. computing $$I^\prime(a)=\int_0^1 \frac{1}{(x+a)(x^2+1)}\, \mathrm{d}x$$ and then compute $$I(a)=\int I^\prime(a)\,\mathrm{d}a$$, but FullSimplify still didn't help. I'm not that familiar with polylogarithmic functions. I just guess since the result is real so we can have ways to represent it in a "nice" and "real" way. Are such representations exist?
- 261
-
3I don't think there's going to be a 'nice' form for the integral. Apply partial fraction decomposition on the integral you have for $I'(a)$ to get something like $$I'(a) = \frac{\pi a}{4(1 + a^2)} + \frac{1}{1 + a^2} \ln \left(\frac{1 + a}{a \sqrt 2}\right) $$ The first part of this is easy to integrate but the next one leads to the integral $$ \int \ln (1 + \cot \phi) d \phi $$ which I believe is non-trivial – Nikunj Mar 08 '25 at 16:49
-
1The structure of the integrand makes me think if a contour approach is possible. Maybe along $|z|=2$ to avoid the poles at $ \pm i$ – Kraken Mar 08 '25 at 17:40
-
1A purely real expression can be obtained in terms of the Clausen function. A more general integral that includes yours as a special case is evaluated in detail here: https://math.stackexchange.com/questions/188732/methods-to-evaluate-int-a-b-frac-ln-left-tx-u-right-mx/3333638#3333638 – David H Mar 08 '25 at 18:18
3 Answers
\begin{align}\int_0^1 &\frac{\ln(x+a)}{x^2+1}dx=\Im \int_0^1 \frac{\ln(x+a)}{x-i}dx\>\>\>\>\>\>(x-i\to x)\\ &=\Im\int_{-i}^{1-i} \frac{\ln(a+i)+\ln(1+\frac x{a+i})}{x}dx\\ &= \Im \bigg[\ln(a+i)\ln(1+i) +\bigg(\int_0^{1-i} -\int_0^{-i}\bigg) \frac{\ln(1+\frac x{a+i})}{x}dx\bigg]\\ &= \frac\pi8\ln(1+a^2)+\frac12\ln2\cot^{-1}a+\Im\bigg[ \text{Li}_2(\frac i {a+i})-\text{Li}_2(\frac {i-1} {a+i})\bigg] \end{align}
- 120,125
Using Feynman's trick $$I(k)=\int_0^1 \frac{\log (k x+a)}{x^2+1}\,dx$$ $$I'(k)=\int_0^1 \frac{x}{\left(x^2+1\right) (k x+a)}\,dx$$ $$I'(k)=\frac{1}{a^2+k^2} \int_0^1 \Bigg(\frac{a x+k}{x^2+1}-\frac{a k}{k x+a} \Bigg)\,dx$$ $$I'(k)=\frac{k\pi+2 a \log (2)+4 a \log\left(\frac{a}{a+k}\right)}{4 \left(a^2+k^2\right)}$$ Integrating termwise between $0$ and $1$ $$\frac{1}{8} \pi \log\left(1+\frac{1}{a^2}\right)+\frac{\log (2)}{2} \tan^{-1}\left(\frac{1}{a}\right)+a\int_0^1\frac{\log \left(\frac{a}{a+k}\right)}{a^2+k^2}\,dk$$ Expand the logarithm $$\int_0^1\frac{\log\left(\frac{a}{a+k}\right)}{a^2+k^2}\,dk=\frac{\log (a) \cot ^{-1}(a)}{a}-\int_0^1\frac{\log (a+k)}{a^2+k^2}\,dk$$ Use $k^2+a^2=(k+ia)(k-ia)$ and partial fraction decomposition to compute $$J=\int_0^1\frac{\log (a+k)}{a^2+k^2}\,dk$$ in terms of complex logarithms and polylogarithms.
Remembering that $$I(0)=\frac{1}{4} \pi \log (a)$$ recombining everything, you will end with @Quanto's result (which was obtained much faster).
- 289,558
Yes, there should be a way to express the result in a completely real form. The fact that Mathematica includes complex polylogarithmic terms doesn’t mean the integral itself is complex—it’s just a result of the way Mathematica chooses to handle certain functions and branch cuts. To get a purely real expression, we can use known identities for polylogarithms and logarithms to rewrite the result in a more natural, real-valued form. and this is nice question
- 464