# Is possible to use "Feynman's trick" (differentiate under the integral or Leibniz integral rule) to calculate $\int_0^1 \frac{\ln(1-x)}{x}dx\:?$

I heard that the equivalent integral: $-\int_0^\infty \frac{x}{e^x-1}dx$ can be done using Contour integration (I never studied this). Also that sometimes "Leibniz integral rule" is used instead of Contour integration. So can "Feynman's trick" be used to show that $\int_0^1 \frac{\ln(1-x)}{x}dx = -\frac{\pi^2}{6}$ $\:\:?$

Let $\displaystyle J=\int_0^1 \frac{\ln(1-x)}{x}\,dx$

Let $f$ be a function defined on $\left[0;1\right]$,

$\displaystyle f(s)=\int_0^{\frac{\pi}{2}} \arctan\left(\frac{\cos t-s}{\sin t}\right)\,dt$

Observe that,

\begin{align} f(0)&=\int_0^{\frac{\pi}{2}}\arctan\left(\frac{\cos t}{\sin t}\right)\,dt\\ &=\int_0^{\frac{\pi}{2}} \left(\frac{\pi}{2}-t\right)\,dt\\ &=\left[\frac{t(\pi-t)}{2}\right]_0^{\frac{\pi}{2}}\\ &=\frac{\pi^2}{8} \end{align}

\begin{align} f(1)&=\int_0^{\frac{\pi}{2}}\arctan\left(\frac{\cos t-1}{\sin t}\right)\,dt\\ &=\int_0^{\frac{\pi}{2}}\arctan\left(-\tan\left(\frac{t}{2}\right)\right)\,dt\\ &=-\int_0^{\frac{\pi}{2}}\arctan\left(\tan\left(\frac{t}{2}\right)\right)\,dt\\ &=-\int_0^{\frac{\pi}{2}} \frac{t}{2}\,dt\\ &=-\frac{\pi^2}{16} \end{align}

For $0<s<1$,

\begin{align} f^\prime(s)&=-\int_0^{\frac{\pi}{2}}\frac{\sin t}{1-2s\cos t+s^2}\,dt\\ &=-\Big[\frac{\ln(1-2s\cos t+s^2)}{2s}\Big]_0^{\frac{\pi}{2}}\\ &=\frac{\ln(\left(1-s)^2\right)}{2s}-\frac{\ln(1+s^2)}{2s}\\ &=\frac{\ln(1-s)}{s}-\frac{\ln(1+s^2)}{2s}\\ \end{align}

Therefore,

\begin{align} f(1)-f(0)&=\int_0^1 f^\prime(s)\,ds\\ &=\int_0^1 \left(\frac{\ln(1-s)}{s}-\frac{\ln(1+s^2)}{2s}\right)\,ds\\ -\frac{\pi^2}{16}-\frac{\pi^2}{8}&=J-\int_0^1 \frac{\ln(1+s^2)}{2s}\,ds\\ -\frac{3\pi^2}{16}&=J-\int_0^1 \frac{\ln(1+s^2)}{2s}\,ds\\ \end{align}

In the latter integral perform the change of variable $y=s^2$,

\begin{align} -\frac{3\pi^2}{16}&=J-\frac{1}{4}\int_0^1 \frac{\ln(1+y)}{y}\,dy\\ &=J-\frac{1}{4}\int_0^1 \frac{\ln(1-y^2)-\ln(1-y)}{y}\,dy\\ &=J+\frac{1}{4}J-\frac{1}{4}\int_0^1 \frac{\ln(1-y^2)}{y}\,dy\\ \end{align}

In the latter integral perform the change of variable $x=y^2$,

\begin{align} -\frac{3\pi^2}{16}&=J+\frac{1}{4}J-\frac{1}{4}\times \frac{1}{2}J\\ &=\frac{9}{8}J\\ \end{align}

Therefore,

\begin{align}J&=\frac{8}{9}\times -\frac{3}{16}\pi^2\\ &=\boxed{-\frac{\pi^2}{6}}\end{align}

A direct application might be

$$\left.\frac{d}{ds} \int_0^{1-\delta} \frac{x^s}{1-x} \, dx\right|_{s = 0} = \left.\int_0^{1-\delta} \frac{ x^s \ln x}{1-x} \, dx\right|_{s = 0} = \int_0^{1-\delta} \frac{\ln x}{1-x} \, dx = \int_\delta^{1 } \frac{\ln (1-x)}{x} \, dx$$

Evaluate the integral on the LHS using the geometric series expansion expansion of $1/(1-x)$ and then take the limit as $\delta \to 0$ (since the improper integral on the RHS converges).

You can also proceed by proving the second equality in

$$- \int_0^1 \frac{\ln(1-x)}{x} \,dx = \int_0^1 \int_0^1 \frac{1}{1 - xy}\, dx \,dy = \sum_{k=1}^\infty \frac{1}{k^2} =\zeta(2) = \frac{\pi^2}{6}$$

using the geometric series $1/(1 -xy) = 1 + xy + (xy)^2 + \ldots$ The first equality is fairly obvious.

More generally we get by the same process

$$\int_0^1 \int_0^1 \frac{x^\alpha y^\alpha}{1 - xy}\, dx \,dy = \sum_{k=1}^\infty \frac{1}{(k + \alpha)^2}$$

and Feynman's trick of repeated integration with respect to $\alpha$ is used to extend the result to other integrals.

• $\int_0^1 x^s/(1-x)dx$ diverges. I realize that formally differentiating the series gives you the correct $-\zeta(2)$, but still, not entirely proper. Commented Jan 29, 2018 at 6:08
• @eyeballfrog: Good catch. I added that without thinking as the OP seems less interested in alternatives and more in the differentiation trick. I'll remove the egregious part for now although I think I can fix this by regularizing.
– RRL
Commented Jan 29, 2018 at 6:12

I assume you're not happy with $$\ln(1-x) = -\sum_{n=1}^\infty \frac{x^n}{n}, \qquad x\in(-1,1)$$ from which \begin{align} \int_0^1 \frac{\ln(1-x)}{x}dx &= -\int_0^1 \sum_{n=1}^\infty \frac{x^{n-1}}{n} dx = -\int_0^1 \sum_{n=0}^\infty \frac{x^{n}}{n+1} dx \\&\stackrel{\rm (\ast)}{=} -\sum_{n=0}^\infty \frac{1}{n+1}\int_0^1 x^n dx = -\sum_{n=0}^\infty \frac{1}{(n+1)^2}\\ &= -\sum_{n=1}^\infty \frac{1}{n^2} = \boxed{-\frac{\pi^2}{6}} \end{align} ? (It's not Feynman's trick, just a nice series representation for $\ln(1-x)$ which goes a long way.)

The only "catch" here is that swapping $\int$ and $\sum$ in $(\ast)$ actually requires a little bit of justification.

• I have seen this before. But i wanted some other way to compute this integral. I can compute some other integrals such as $\int_0^\infty e^{-x^2}, \int_0^\infty sin(x^2), \int_0^\infty sinx/x,$ using Feynman's trick, so i was looking for other integrals to use this method and I found $\int_0^1 \ln(1-x)/x$. So I asked here if it's possible. But thanks for you answer. Commented Jan 29, 2018 at 5:02

You can use the beta function to do that, namely $$B(x,y) = \int _0^{1} t^{x-1} (1-t)^{y-1 } \mathop{\text{d} x}$$ We will use that $$\frac{\partial B(x,y)}{\partial y}=B(x,y)( \psi(y) - \psi(x+y))$$ where $\psi$ is the digamma function.

Therefore, $$\frac{\partial B(x,1)}{\partial y}=\int _0^{1} t^{x-1} (-\ln(1-t))\mathop{\text{d} x}$$ And by monotone convergence we have $$\lim_{x\rightarrow 0}\frac{\partial B(x,1)}{\partial y}=\int _0^{1} -\frac{\ln(1-t)}{t}\mathop{\text{d} x}$$ Finally, we have \begin{align} \lim_{x\rightarrow 0}\frac{\partial B(x,1)}{\partial y}&= \lim_{x\to 0}xB(x,y) \lim_{x\to 0}\frac{( \psi(y) - \psi(x+y))}{x}\\ &=1 \cdot(-\psi^{(1)}(1))\\ &=\frac{\pi^2}{6} \end{align} So we conclude.

• How you compute $\psi^{(1)}(1)$? Using $\zeta(2)=\pi^2/6$ ?
– FDP
Commented Jan 30, 2018 at 7:55
• @FDP The expression for $\psi^{(1)}(z)$ that I used is $\psi^{(1)}(z) = \sum_{ k\geq 0} \dfrac{1}{(z+k)^2}$ Commented Jan 30, 2018 at 13:52
• And how do you obtain the value of that series? Using $\zeta(2)=\pi^2/6$?
– FDP
Commented Jan 31, 2018 at 21:28
• @FDP yes exactly Commented Jan 31, 2018 at 23:11

It is possible to use Feynman’s Trick. The right substitution in this case is inside the natural log

$$I(z)=\int\limits_0^1dx\,\frac {\log(1-zx)}x$$

So when we differentiate, we get

$$I’(z)=-\int\limits_0^1dx\,\frac {1}{1-zx}$$

Can you complete the rest?

• There's a typo in your fist line: $\log$ is missing. Commented Nov 7, 2018 at 14:45
• @Dr.WolfgangHintze Thanks. Commented Nov 7, 2018 at 18:09
• I tried this and it diverged. Due to ln(0). Commented Jun 16, 2020 at 15:47