# How do we prove that $\int_{0}^{1}x^n\left({1\over \ln{x}}+{1\over 1-x}\right)dx={\gamma+\ln(1+n)-H_n}$

How do we prove that

n $\in$ $\Re$

$$\int_{0}^{1}x^n\left({1\over \ln{x}}+{1\over 1-x}\right)dx=\color{red}{\gamma+\ln(1+n)-H_n}.\tag1$$

$$J=\int_{0}^{1}{x^n\over 1-x}dx=\sum_{k=0}^{\infty}(-1)^k\int_{0}^{1}x^{n+k}dx=\sum_{k=0}^{\infty}{(-1)^k\over n+k+1}\tag2$$

This integral seem difficult to evaluate, help needed. Thank!

$$\int_{0}^{1}{x^n\over \ln{x}}dx\tag3$$

• 30 questions later... will you write a list of all your formulas ? (note that your 4th question was $\int_{0}^{1}{x^n-1 \over \ln(x)}dx=\ln(n+1)$ so it is becoming kind of redundant...) – reuns Jul 6 '16 at 1:13


Why ?.

1. See the proof as Eq. $\pars{2}$ in one of my yesterday answers.
2. \begin{align} \int_{0}^{1}{1 - x^{n} \over \ln\pars{x}}\,\dd x & = -\int_{0}^{1}\pars{1 - x^{n}}\int_{0}^{\infty}x^{y}\,\dd y\,\dd x = \int_{0}^{\infty}\int_{0}^{1}\pars{x^{n + y} - x^{y}}\,\dd x\,\dd y \\[3mm] = &\ \int_{0}^{\infty}\pars{{1 \over y + n + 1} - {1 \over y + 1}}\,\dd y = \fbox{$\ds{\ -\ln\pars{n + 1}\ }$} \end{align}
3. \begin{align} \int_{0}^{1}{1 - x^{n} \over 1 - x} & =\int_{0}^{1}\sum_{k=1}^{n}x^{k - 1} \,\dd x = \sum_{k = 1}^{n}{1 \over k}\ \stackrel{\mathrm{def.}}{=}\ \fbox{$\ds{\ H_{n}\ }$}\quad n = 1,2,3,\ldots \end{align} Indeed, the integral defines/extends the Harmonic Number for $\ds{~\Re\pars{n} > -1~}$ and, in general, by means of the Digamma Function $\ds{\pars{~namely, H_{z} = \Psi\pars{z + 1} + \gamma~}}$.
• Well done! +1!! – Mark Viola Jul 6 '16 at 2:43
• @Dr.MV Thanks a lot. – Felix Marin Jul 6 '16 at 8:03

Hint. One may set $$f(s):=\int_{0}^{1}x^s\left({1\over \ln{x}}+{1\over 1-x}\right)dx, \quad s>-1, \tag1$$ then just differentiate getting $$f'(s)=\int_{0}^{1}x^s\left(1+{\ln x\over 1-x}\right)dx=\frac1{s+1}-\psi'\left(s+1\right), \quad s>-1, \tag2$$where we have used the standard integral representation of the digamma function $$\int_{0}^{1}{1 - x^{s - 1} \over 1 - x}\,dx \, = \psi (s)+ \gamma, \quad s>0.$$

Integrating $(2)$, observing that $f(0)=\gamma$, one gets

$$\int_{0}^{1}x^s\left({1\over \ln{x}}+{1\over 1-x}\right)dx=\log(s+1)-\psi\left(s+1\right), \quad s>-1, \tag3$$

from which you deduce the value of your initial integral by recalling that $$\psi(n+1)=H_n-\gamma.$$

• Well, isn't proving such integral representation of the digamma functions holds almost as involved as proving this more mundanely? – Pedro Tamaroff Jul 5 '16 at 23:51
• @PedroTamaroff Yes, almost. If you mean all these properties are equivalent, you are right. If one starts to define the $\Gamma$ function with the Weierstrass infinite product, then all these expressions are really equivalent. Maybe I could have used the standard series for $\psi$ instead. This answer is just a possible way to go, I hope to have spread a little light, not pretending more. – Olivier Oloa Jul 6 '16 at 6:09

Your approach cannot work, because the series $J$ that you derived is incorrect: the sum is not alternating, since $$\frac{x^n}{1-x} = \sum_{k=n}^\infty x^k,$$ which also reveals the more problematic issue that $J$ is not convergent and that the original integrand cannot be split in such a fashion.

Instead, write $$f_n(x) = x^n \left( \frac{1}{\log x} + \frac{1}{1-x} \right) = \frac{x^n-1}{\log x} + \frac{1}{\log x} + \frac{x^n}{1-x}.$$ Then consider $$g(n,x) = \int_{x=0}^1 \frac{x^n-1}{\log x} \, dx$$ and note $$\frac{dg}{dn} = \int_{x=0}^1 x^n \, dx = \frac{1}{1+n}$$ for (at least) $n \ge 0$. Then $$g(n,x) = \int \frac{1}{1+n} \, dn = \log (1+n) + C,$$ and the additional condition that $g(0,x) = 0$ gives $$g(n,x) = \log(1+n).$$ This gives the desired middle term. Now what remains is $$\int_{x=0}^1 f_n(x) \, dx = \log (1+n) + \int_{x=0}^1 h_n(x) \, dx,$$ for which the harmonic part can be removed simply by noting $$\frac{x^n}{1-x} = \frac{1}{1-x} - \sum_{k=0}^{n-1} x^k,$$ hence $$\int_{x=0}^1 h_n(x) \, dx = \int_{x=0}^1 h_0(x) \, dx - \sum_{k=0}^{n-1} \frac{1}{k+1} = \int_{x=0}^1 h_0(x) \, dx - H_n.$$ Then all that remains is to prove $$\gamma = \int_{x=0}^1 h_0(x) \, dx = \int_{x=0}^1 \frac{1}{\log x} + \frac{1}{1-x} \, dx,$$ which is actually claimed in the Wikipedia article for the Euler-Mascheroni constant but I have left it as an exercise.

Let me propose a complete elementary answer based on $\zeta(s)\Gamma(s)$ :

• since $$\zeta(s) = \lim_{N \to \infty}\sum_{n=1}^N n^{-s}$$ it is clear that

$$\lim_{s \to 1^+} \zeta(s) - \frac{1}{s-1} = \lim_{s \to 1^+} \lim_{N \to \infty}\sum_{n=1}^N n^{-s}- \int_1^N x^{-s}dx$$ $$= \lim_{N \to \infty}\lim_{s \to 1^+}\sum_{n=1}^N n^{-s}- \int_1^N x^{-s}dx = \lim_{N \to \infty} H_N - \ln N = \gamma$$

• then use $n^{-s} \Gamma(s) = \int_0^\infty x^{s-1} e^{-nx} dx$ (change of variable $y = nx$) so that $\Gamma(s) \sum_{n=1}^N n^{-s}= \int_0^\infty x^{s-1} \sum_{n=1}^N e^{-nx} dx = \int_0^\infty x^{s-1} \frac{1-e^{-(N+1)x}}{1-e^{-x}} dx$ and for $Re(s) > 1$ :

$$\Gamma(s) \zeta(s) = \lim_{N \to \infty} \int_0^\infty x^{s-1} \frac{1-e^{-(N+1)x}}{1-e^{-x}} dx = \int_0^\infty x^{s-1}\frac{e^{-x}}{1-e^{-x}}dx$$

and you get :

$$\gamma = \lim_{s \to 1^+} \Gamma(s) \left(\zeta(s) - \frac{1}{s-1}\right) = \lim_{s \to 1^+} \int_0^\infty x^{s-1}e^{-x}\left(\frac{1}{1-e^{-x}}-\frac{1}{x}\right)dx$$ $$= \int_0^\infty e^{-x}\left(\frac{1}{1-e^{-x}}-\frac{1}{x}\right)dx$$

• finally :

$$\int_0^1 x^n\left(\frac{1}{\ln x} + \frac{1}{1-x}\right)dx = \int_0^\infty e^{-(n+1)t}\left( \frac{1}{1-e^{-t}}-\frac{1}{t}\right)dt$$ $$= \lim_{s \to 1^+} \int_0^\infty t^{s-1}e^{-(n+1)t}\left( \frac{1}{1-e^{-t}}-\frac{1}{t}\right)dt$$ $$= \lim_{s \to 1^+} \Gamma(s) \sum_{n=N+1}^\infty n^{-s} - (n+1)^{-s}\Gamma(s-1)$$ $$= \lim_{s \to 1^+} \Gamma(s) (\zeta(s) - \sum_{n=1}^N n^{-s}) - (n+1)^{1-s}\Gamma(s-1)$$

and from $(n+1)^{1-s}\Gamma(s-1) = \Gamma(s)\frac{1+(1-s)\ln(n+1)+o(1-s)}{s-1}$ you get

$$\int_0^1 x^n\left(\frac{1}{\ln x} + \frac{1}{1-x}\right)dx = \lim_{s \to 1^+} \Gamma(s)\left(\zeta(s) - \sum_{n=1}^N n^{-s}-\frac{1+(1-s)\ln(n+1)+o(1-s)}{s-1}\right)$$ $$= \color{red}{\gamma-H_n+\ln(n+1)}$$

If $n\ge 0$ \begin{align} & \int_{0}^{n}{{{x}^{t}}}dt=\int_{0}^{n}{{{e}^{t\ln x}}}dt=\left. \frac{{{e}^{t\ln x}}}{\ln x} \right|_{0}^{n}=\frac{{{e}^{n\ln x}}-1}{\ln x}=\frac{{{x}^{n}}-1}{\ln x} \\ \\ & \int_{0}^{1}{\frac{{{x}^{n}}-1}{\ln x}}\,dx=\int_{0}^{1}{\int_{0}^{n}{{{x}^{t}}}dt}dx=\int_{0}^{n}{\int_{0}^{1}{{{x}^{t}}}dx}dt=\int_{0}^{n}{\frac{1}{t+1}}dt=\ln (n+1) \\ \end{align} Indeed we proved

$$\color{red}{\int_{0}^{1}{\frac{{{x}^{n}}-1}{\ln x}}\,dx=\ln(n+1)}\tag 1$$

$$\int_{0}^{1}\frac{1-x^n}{1-x}dx=\int_{0}^{1}{(1+x+x^2+x^3+\cdots+x^{n-1})}dx=\sum\limits_{j=1}^{n}{\frac{1}{j}}=\color{red}{{H}_{n}}$$ thus

$$\color{red}{\int_{0}^{1}\frac{x^n-1}{1-x}dx=-{{H}_{n}}}\tag 2$$

on the other hand, we know $$\color{red}{\int_{0}^{1}\left(\frac{1}{\ln x}+\frac{1}{1-x}\right)dx=\gamma }\tag 3$$ $(1) , (2)$ and $(3)$

$$I=\int_{0}^{1}x^n\left({1\over \ln{x}}+{1\over 1-x}\right)dx=\int_{0}^{1}\left({1\over \ln{x}}+{1\over 1-x}\right)dx+\int_{0}^{1}\frac{x^n-1}{\ln x} dx+\int_{0}^{1}\frac{x^n-1}{1-x}dx$$ therefore $$\color{red}{I=\gamma+\ln(n+1)-H_n}$$