7

I had just encountered the integral in the post, $$ \int_0^{\infty} \frac{\ln ^2 x}{(1+x)^2} d x=\frac {\pi^2} {3}$$ which attracts me to explore a bit further. $$I(m,2)= \int_0^{\infty} \frac{\ln ^{m} x}{(1+x)^2} d x $$ as $\int_0^{\infty} \frac{\ln ^{m} x}{(1+x)^2} d x=0$ for any odd integer $n$.

For any even integer $m $, let’s contract the interval $(0, \infty )$ to $(0,1)$ with the inverse substitution $x\mapsto \frac{1}{x}$ on $(1,\infty)$ and obtain $$ I(m,2)=2 \int_0^1 \frac{\ln ^m x}{(1+x)^2} d x $$

Using the series $\frac{1}{(1+x)^2}=\sum_{n=1}^{\infty}(-1)^{n-1} n x^{n-1}$, $$ \begin{aligned} I_m & =2 \int_0^1 \ln^m x \sum_{n=1}^{\infty}(-1)^{n-1} n x^{n-1} d x \\ & =2 \sum_{n=1}^{\infty}(-1)^{n-1} \int_0^1 x^{n-1} \ln^m x d x \\ & =2 \sum_{n=1}^{\infty}(-1)^{n-1} n \int_0^{\infty} y^m e^{-n y} d y, \quad \textrm{ where } y=e^{-x} \\ & =2 \sum_{n=1}^{\infty}(-1)^{n-1} n \cdot\frac{\Gamma(m+1)}{n^{m+1}} \\ & =2 m! \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^m} \\ & =2 m!\left(1-2 \cdot \frac{1}{2^m}\right) \zeta(m) \\ &= \left(2-2^{2-m}\right) m! \zeta(m) \end{aligned} $$ We can now conclude that for any even integer $m$, $$\boxed{ \int_0^{\infty} \frac{\ln ^{m} x}{(1+x)^2} d x = \left(2-2^{2-m}\right) m! \zeta(m) \cdots (1)}$$


Let’s go further with $$I(m,3)= \int_0^{\infty} \frac{\ln ^{m} x}{(1+x)^3} d x $$

We start with the simpler case: when $m$ is even.

Contracting again the integration interval to $(0,1)$ with inverse substitution yields $$ \begin{aligned} I(m, 3) &=\int_0^1 \left.\frac{\ln x}{(1+x)^3}+\frac{x \ln x}{(1+x)^3}\right] d x \\ & =\int_0^1 \frac{\ln ^m x}{(1+x)^2} d x \\&=\frac{1}{2} \int_0^\infty \frac{\ln ^m x}{(1+x)^2} d x\\ & =\left(1-2^{1-m}\right) m!\zeta(m) \quad (\textrm{ using }(1)) \end{aligned} $$ Now for the odd integer $m>1$, we use integration by parts repeatedly. $$ \begin{aligned} I(m, 3) & =\int_0^1 \frac{(1-x) \ln ^m x}{(1+x)^3} d x \\ & =\int_0^1 \ln ^m x d\left(\frac{x}{(x+1)^2}\right) \\ & =-m \int_0^1 \frac{\ln ^{m-1} x}{(x+1)^2} d x \\ & =-m \int_0^1 \ln ^{m-1} x d\left(\frac{x}{x+1}\right) \\ & =m(m-1) \int_0^1 \frac{\ln ^{m-2} x}{x+1} d x \\ & =m(m-1)\left[-\frac{1}{2^{m-2}}\left(2^{m-2}-1\right) \Gamma(m-1)\zeta(m-1)\right] \\ & =-\left(1-2^{2-m}\right)m! \zeta(m-1) \end{aligned} $$


My Question:

Though we can endlessly raise the power of the denominator and evaluate them one by one with higher difficulty in this way, we still wish to have a general method to evaluate the integral $$ I(m,n)= \int_0^{\infty} \frac{\ln ^m x}{(1+x)^n} d x ?$$

Mostafa Ayaz
  • 33,056
Lai
  • 31,615

3 Answers3

7

I will use a variation of Feynman's trick or rather the Leibniz rule of integration, along with identities involving the Gamma and the Beta function (for details and clarity see below).

Let
$$ I(m,n) = \int_0^\infty \frac{\ln^m x}{(1+x)^n} \, dx. $$

Introduce a parameter $a$ into the integrand:
$$ I(a) = \int_0^\infty \frac{x^a}{(1+x)^n} \, dx. $$

This integral evaluates to a Beta function expression:
$$ I(a) = \mathrm{B}(a+1, n - a - 1) = \frac{\Gamma(a+1)\Gamma(n - a - 1)}{\Gamma(n)}, $$ valid for $-1 < a < n - 1$.

Now differentiate under the integral sign:
$$ \frac{d^m}{da^m} I(a) = \int_0^\infty \frac{x^a \ln^m x}{(1+x)^n} \, dx. $$

So we get:
$$ \int_0^\infty \frac{x^a \ln^m x}{(1+x)^n} \, dx = \frac{d^m}{da^m} \left( \frac{\Gamma(a+1)\Gamma(n - a - 1)}{\Gamma(n)} \right). $$

Finally, set $a = 0$:
$$ \boxed{I(m,n) = \int_0^\infty \frac{\ln^m x}{(1+x)^n} \, dx = \left. \frac{d^m}{da^m} \left( \frac{\Gamma(a+1)\Gamma(n - a - 1)}{\Gamma(n)} \right) \right|_{a = 0}}. $$

Let's make sure this checks out, using your results from above $I(2,2) = \int_0^\infty \frac{\ln^2(x)}{(1+x)^2} \, dx,$

Using the formula (after a simple change of variables $p=a+1$)

$$ I(m,n) = \frac{1}{\Gamma(n)} \left. \frac{d^m}{dp^m} \left( \Gamma(p) \Gamma(n-p) \right) \right|_{p=1}, $$ Substitute $$ I(2,2) = \frac{1}{\Gamma(2)} \left. \frac{d^2}{dp^2} \left( \Gamma(p) \Gamma(2-p) \right) \right|_{p=1}. $$

Since $\Gamma(2) = 1$ (factorial property), this simplifies to

$$ I(2,2) = \left. \frac{d^2}{dp^2} \left( \Gamma(p) \Gamma(2-p) \right) \right|_{p=1}. $$

Define

$$ f(p) = \Gamma(p) \Gamma(2-p). $$

Using the digamma function $\psi(x) = \frac{d}{dx} \ln \Gamma(x)$ and trigamma function $\psi'(x) = \frac{d}{dx} \psi(x)$, we have

$$ f'(p) = f(p) \left[ \psi(p) - \psi(2-p) \right], $$

and

$$ f''(p) = f(p) \left[ \left( \psi(p) - \psi(2-p) \right)^2 + \psi'(p) + \psi'(2-p) \right]. $$

Evaluating at $p=1$:

$$ f(1) = \Gamma(1) \Gamma(1) = 1, $$

$$ \psi(1) = -\gamma, \quad \text{where } \gamma \text{ is the Euler–Mascheroni constant}, $$

$$ \psi(1) - \psi(1) = 0, $$

$$ \psi'(1) = \frac{\pi^2}{6}. $$

Thus,

$$ f''(1) = 1 \times \left[ 0^2 + \frac{\pi^2}{6} + \frac{\pi^2}{6} \right] = \frac{\pi^2}{3}. $$

$$ \int_0^\infty \frac{\ln^2(x)}{(1+x)^2} \, dx = \frac{\pi^2}{3}. $$

Similarly, one can evaluate it at other values.

I wrote a quick GeoGebra-Tool to evaluate it numerically (let me know if the link is working! Note that you can slide n and m and compare the expression for the integral with the formula I provided - it's all in the algebra view on the left): https://www.geogebra.org/classic/tppbxnj7


Additionally: In case you're not familiar with the use of the Beta-function above:

Recall, we defined $$ I(a) = \int_0^\infty \frac{x^a}{(1+x)^n} \, dx. $$

Make the substitution $$ t = \frac{x}{1+x} \implies x = \frac{t}{1 - t}, $$

which maps $x: 0 \to \infty$ to $t: 0 \to 1$.

Hence $$ dx = \frac{d}{dt} \left( \frac{t}{1-t} \right) dt = \frac{1}{(1 - t)^2} \, dt. $$

Rewrite the integrand terms: $$ x^a = \left( \frac{t}{1-t} \right)^a = \frac{t^a}{(1-t)^a}, $$ and $$ (1 + x)^n = \left( 1 + \frac{t}{1-t} \right)^n = \left( \frac{1}{1-t} \right)^n = (1 - t)^{-n}. $$

Substitute all into the integral: $$ I(a) = \int_0^1 \frac{t^a}{(1-t)^a} \cdot (1 - t)^n \cdot \frac{1}{(1 - t)^2} \, dt = \int_0^1 t^a (1 - t)^{n - a - 2} \, dt. $$

Rewrite the powers: $$ I(a) = \int_0^1 t^{(a+1) - 1} (1 - t)^{(n - a - 1) - 1} \, dt. $$

Recognize this as the Beta function: $$ B(p,q) = \int_0^1 t^{p-1} (1 - t)^{q-1} \, dt, $$ with $$ p = a + 1, \quad q = n - a - 1. $$

Thus, $$ \boxed{ I(a) = \int_0^\infty \frac{x^a}{(1+x)^n} \, dx = B(a+1, n - a - 1) = \frac{\Gamma(a+1) \Gamma(n - a - 1)}{\Gamma(n)}. } $$

Furthermore, the Beta function's key property (Wikipedia) with regard to the gamma function is directly on the first few lines of the Wiki article: https://en.wikipedia.org/wiki/Beta_function

Samuel
  • 1,051
4

By splitting the integral between $(0,1)$ and $(1,\infty)$ and taking $x\rightarrow 1/x$ in the latter we arrive at \begin{align} I(m,n)=\int_0^1\frac{1+(-1)^mx^{n-2}}{(1+x)^n}\log^mx\ \mathrm dx. \end{align} Utilizing the series \begin{align} \frac{1}{(1-x)^n}=\sum_{k\geq0}{k+n-1\choose n-1}x^k;\quad |x|<1 \end{align} we have that \begin{align} I(m,n)=\sum_{k\geq0}{k+n-1\choose n-1}(-1)^k\int_0^1x^k\left(1+(-1)^mx^{n-2}\right)\log^mx\ \mathrm dx. \end{align} See this answer for a derivation of the result: \begin{align} \int_0^1x^p\log^qx\ \mathrm dx=\frac{(-1)^q\Gamma(q+1)}{(p+1)^{q+1}}, \end{align} giving us \begin{align} I(m,n)&=\sum_{k\geq0}{k+n-1\choose n-1}(-1)^km!\left(\frac{(-1)^m}{(k+1)^{m+1}}+\frac{1}{(k+n-2)^{m+1}}\right)\\\\ &=(-1)^{m+1}m!\sum_{k\geq1}{k+n-2\choose n-1}\frac{(-1)^k}{k^{m+1}}+(-1)^{n+1}m!\sum_{k\geq n-2}{k\choose n-1}\frac{(-1)^k}{k^{m+1}} \end{align} note that for $k<n-1$, ${k\choose n-1}\equiv0$, so then \begin{align} I(m,n)&=-m!\sum_{k\geq1}\frac{(-1)^k}{k^{m+1}}\left({k+n-2\choose n-1}(-1)^m+{k\choose n-1}(-1)^n\right)\\\\ &=\frac{(-1)^{m+1}m!}{(n-1)!}\sum_{k\geq1}\frac{(-1)^k}{k^{m+1}}\left(\frac{(k+n-2)!}{(k-1)!}+\frac{k!}{(k-n+1)!}(-1)^{m+n}\right). \end{align} This expression is begging to be simplified but while the heart is willing the mind (and WolframAlpha) is unable... Perhaps someone can aid me here.

Eli Bartlett
  • 2,084
  • (+1) Thank you for your nice solution using Binomial expansion and Gamma function. – Lai Jun 06 '25 at 01:31
2

I use a slightly different notation.

$$I(m,n)= \int_0^{\infty} \frac{\ln ^m x}{(1+x)^{n+1}} d x$$

This means that instead of the original $n$, here is $n+1$

It is perhaps easiest to use a known result:

$$\int_0^{\infty} \frac{x^s}{b+x} d x=-\frac{\pi b^s}{\sin \pi x}$$ We differentiate this relation with respect to $b$ $n$ times:

$$\int_0^{\infty} \frac{x^s}{(b+x)^{n+1}} d x=$$

$$=\pi\frac{(-1)^{n+1}}{b^nn!}\frac{b^s\prod_{k=0}^{n-1}(s-k)}{\sin \pi s}$$

Or if we take $b=1$: $$\int_0^{\infty} \frac{x^s}{(1+x)^{n+1}} d x=$$

$$=\pi\frac{(-1)^{n+1}}{n!}\frac{\prod_{k=0}^{n-1}(s-k)}{\sin \pi s}$$

Now all that remains is to differentiate the last result with respect to s m times and then take s=0

We need to differentiate the expression:

$$y(s)=\frac{\prod_{k=0}^{n-1}(s-k)}{\sin \pi s}$$

We write it in the form:

$$y(s)\sin \pi s=\prod_{k=0}^{n-1}(s-k)$$

and apply the so-called "Leibniz's rule":

$$(fg)^{(m)}=\sum_{k=0}^{m}\binom{m}{k}f^{(k)}g^{(m-k)}$$

where $f^{(k)}$ denotes the kth derivative of f and the same for $g$

Result:

$$\sum_{k=0}^{m}\binom{m}{k}y^{(m-k)}(0)\pi^{k}\sin\frac{k\pi}{2}=$$

$$=\left [ \frac{d^m }{d s^m}\prod_{k=0}^{n-1}(s-k) \right ]_{s=0}$$

This is a recurrent equation that allows us to sequentially calculate at a fixed $n$

$$y^{(m)}(0);m=0,1,2,...$$

The expression for the integral we are looking for is expressed as

$$ \int_0^{\infty} \frac{\ln ^m x}{(1+x)^{n+1}} d x=\pi\frac{(-1)^{n+1}}{n!}y^{(m)}(0)$$

Some examples:

$$ \int_0^{\infty} \frac{\ln x}{(1+x)^{10}} d x=-\frac{761}{2520}$$

$$ \int_0^{\infty} \frac{\ln^{2}x}{(1+x)^{10}} d x=\frac{1680\pi^{2}+29531}{45360}$$

Martin Gales
  • 7,927