How to prove that $ -n \int _0 ^1 x^{n-1} \log(1-x)dx$ equals the $n$-th harmonic number?

If you call the RHS $I_n$, then \begin{align}I_n-I_{n-1}&=\int_0^1((n-1)x^{n-2}-nx^{n-1})\log(1-x)\,dx\\ &=\left[(x^{n-1}-x^n)\log(1-x)\right]_{x=0}^1 +\int_0^1\frac{x^{n-1}-x^n}{1-x}\,dx \end{align} on integration by parts. Then $$\lim_{x\to1}(x^{n-1}-x^n)\log(1-x)=\lim_{x\to1}(1-x)\log(1-x)= \lim_{y\to0}y\log y=-\lim_{t\to\infty}te^{-t}=0$$ and the integral reduces to $\int_0^1x^{n-1}\,dx=1/n$. Therefore $I_n-I_{n-1}=1/n$. Similarly $I_1=1$, using integration by parts. I'd count all of this as A-level level maths.


My usual naive plug in and assume everything converges.

$\begin{array}\\ -n\int _0 ^1 x^{n-1} \log(1-x)dx &=n\int _0 ^1 x^{n-1} \sum_{m=1}^{\infty}\dfrac{x^m}{m}dx\\ &=n\sum_{m=1}^{\infty}\dfrac{1}{m}\int _0 ^1 x^{n-1} x^mdx\\ &=n\sum_{m=1}^{\infty}\dfrac{1}{m}\int _0 ^1 x^{n+m-1}dx\\ &=n\sum_{m=1}^{\infty}\dfrac{1}{m}\dfrac1{n+m}\\ &=n\sum_{m=1}^{\infty}\dfrac{1}{m(n+m)}\\ &=n\sum_{m=1}^{\infty}\dfrac1{n}(\dfrac1{m}-\dfrac1{n+m})\\ &=\sum_{m=1}^{\infty}(\dfrac1{m}-\dfrac1{n+m})\\ &=\sum_{m=1}^{\infty}\dfrac1{m}-\sum_{m=1}^{\infty}\dfrac1{n+m}\\ &=\sum_{m=1}^{\infty}\dfrac1{m}-\sum_{m=n+1}^{\infty}\dfrac1{m}\\ &=\sum_{m=1}^{\infty}\dfrac1{m}-\sum_{m=n+1}^{\infty}\dfrac1{m}\\ &=\sum_{m=1}^{n}\dfrac1{m}\\ &=H_n\\ \end{array} $

If you do the same thing with $\log(1+x)$, you get a similar result but it cancels out only for even $n$ - I got $-n\int _0 ^1 x^{n-1} \log(1+x)dx\\ =\sum_{m=1}^{\infty}\dfrac{(-1)^{m+1}}{m}-(-1)^n\sum_{m=n+1}^{\infty}\dfrac{(-1)^{m+1}}{m} $.

In any case, $-n\int _0 ^1 x^{n-1} \log(1+x)dx \to \ln(2) $.


$$H_n=\sum_{k=1}^n\frac1k=\sum_{k=1}^n\int_0^1 x^{k-1}dx=\int_0^1\sum_{k=1}^nx^{k-1}dx\\=\int_0^1\frac{1-x^n}{1-x}dx\overset{IBP}{=}\underbrace{-\ln(1-x)(1-x^n)|_0^1}_{0}-n\int_0^1x^{n-1}\ln(1-x)dx$$