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

From (Almost) Impossible Integrals, Sums, and Series section 1.3:

$$H_n = -n\int _0 ^1 x^{n-1} \log(1-x)dx$$

The proof of which was appetizingly difficult. I was unable to answer the follow-up challenge question, and do not have access to the given solution. It asks:

Is it possible to [prove this equality] with high school knowledge only (supposing we know and use the notation of the harmonic numbers)?

I've been fiddling with the integral on the right for an hour, but that $$\log$$ really throws a wrench in my plans.

• Please avoid writing a title with only a formula, and really avoid writing it as big as you have. See here for more tips about fomulae in titles. – Arnaud D. Dec 2 at 19:25
• Approach0 gives this more general question, I'm not sure if it helps. – Arnaud D. Dec 2 at 19:34
• @ heepo: +1 Good question. To my astonishment this simple reformulation by partial integration of the well known relation $H_n=\int_0^1 \frac{1-x^n}{1-x}\,dx$ is missing in Wolfram and Wikipedia. It should be added there. – Dr. Wolfgang Hintze Dec 3 at 9:11
• A generalization for real $a$ with $a+n\gt 0$ is $-n \int_0^1 x^{n-1} \log \left(1-x^a\right) \, dx=H_{\frac{n}{a}}$ – Dr. Wolfgang Hintze Dec 3 at 9:33

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)$$.

• Very nicely done (+1) – clathratus Dec 2 at 21:21
• @ marty cohen +1 Here we go again with $\log(2)$ ;-) – Dr. Wolfgang Hintze Dec 3 at 9:14
• @ marty cohen I get $-n \int_0^1 x^{n-1} \log (x+1) \, dx=\frac{1}{2} \left(H_{\frac{n}{2}}-H_{\frac{n-1}{2}}\right)-\log (2) \to -\log(2)$. Notice the sign error. – Dr. Wolfgang Hintze Dec 3 at 9:39
• I'll check into that. And looking at the integral, without the minus sign in front, it has to be positive, so with a minus sign it has to be negative. – marty cohen Dec 3 at 12:20
• So you should correct the sign error in the last formula of your solution. – Dr. Wolfgang Hintze Dec 4 at 13:41

$$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$$

• @ Ali Shather +1 Very elegant two liner. – Dr. Wolfgang Hintze Dec 4 at 11:33
• @Dr. Wolfgang Hintze thank you for the kind words. – Ali Shather Dec 4 at 23:45

This is not a solution but an extended comment, as the reasoning is probably not suited for high school students, as requested in the OP.

This proof starts with the observation that $$\log(1-x) = \frac{d}{da} (1-x)^{a-1} |_{a\to 1}$$ with which the integral in question can be written thus

$$-n \int_0^1 \log(1-x) x^{n-1}\,dx=- n\frac{d}{da}\left( \int_0^1 (1-x)^{a-1} x^{n-1}\,dx \right)|_{a\to 1} \\=- \frac{d}{da}\left( B(a,n) \right)|_{a\to 1}=- \frac{d}{da}\left( \frac{\Gamma(a) \Gamma[n+1]}{\Gamma(a+n)}\right)|_{a\to 1}\\= \left(\frac{\Gamma (a) \Gamma (n+1) \psi ^{(0)}(a+n)}{\Gamma (a+n)}-\frac{\Gamma (a) \psi ^{(0)}(a) \Gamma (n+1)}{\Gamma (a+n)}\right)|_{a\to 1}\\=\psi ^{(0)}(n+1)+\gamma= H_n$$

Remark: this method is easily adapted to integrals of the type $$\int_0^1 \log^k (1-x) x^{n-1}\,dx$$.