# Prove $\int_0^1\frac{x^{2n}}{1+x}dx=\ln2+H_n-H_{2n}$

How to prove

$$\int_0^1\frac{x^{2n}}{1+x}dx=\ln2+H_n-H_{2n}$$

I used this identity to solve some advanced harmonic series but I didn't provide a proof so I see that it's worth a post so that we can use it as a reference for future solutions if needed. Here is my approach and would like to see alternative ones.

\begin{align} \int_0^1\frac{x^{2n}}{1+x}dx&=\ln2-2n\int_0^1x^{2n-1}\ln(1+x)dx\tag1\\ &=\ln2-2n\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k}\int_0^1 x^{2n+k-1}dx\tag2\\ &=\ln2+2n\sum_{k=1}^\infty\frac{(-1)^{k}}{k(k+2n)}\tag3\\ &=\ln2+4n\sum_{k=1}^\infty\frac{1}{2k(2k+2n)}-2n\sum_{k=1}^\infty\frac{1}{k(k+2n)}\tag4\\ &=\ln2+\sum_{k=1}^\infty\frac{n}{k(k+n)}-\sum_{k=1}^\infty\frac{2n}{k(k+2n)}\tag5\\ &=\ln2+H_n-H_{2n}\tag6 \end{align}

Explanation:

1) Apply integration by parts

2) Write $$\ln(1+x)=\sum_{k=1}^\infty \frac{(-1)^{k-1}}{k}x^{k}$$

3) Use the rule $$\int_0^1 x^ndx=\frac1{n+1}$$

4) $$\sum_{k=1}^\infty (-1)^k f(k)=2\sum_{k=1}^\infty f(2k)-\sum_{k=1}^\infty f(k)$$

5) Simplify

6) Use $$H_n=\sum_{k=1}^n \frac1k=\sum_{k=1}^\infty\frac{n}{k(k+n)}$$

A good application for this identity is the following problem proposed by Cornel:

$$\zeta(3)=\frac43\sum_{n=1}^\infty\frac{(2H_{2n}-H_n)(H_n-H_{2n}+\ln2)}{n}$$

If we multiply both sides of our identity by $$\frac{2H_{2n}-H_n}{n}$$ then sum up from $$n= 1$$ to $$\infty$$ we get

$$\sum_{n=1}^\infty\frac{(2H_{2n}-H_n)(H_n-H_{2n}+\ln2)}{n}=\int_0^1\frac1{1+x}\sum_{n=1}^\infty\frac{x^{2n}}{n}(2H_{2n}-H_n)dx\\=\frac12\int_0^1\frac{1}{1+x}\ln^2\left(\frac{1-x}{1+x}\right)dx=\frac12\int_0^1\frac{\ln^2x}{1+x}dx=\frac34\zeta(3)$$

where the identity $$\ln^2\left(\frac{1-x}{1+x}\right)=2\sum_{n=1}^\infty \frac{x^{2n}}{n}(2H_{2n}-H_n)$$ was used in our calculations.

Another application is calculating $$\sum_{n=1}^\infty \frac{(-1)^nH_{n/2}}{n^3}$$:

From our proof above, we can see that

$$\int_0^1 x^{2n-1}\ln(1+x)dx=\frac{H_{2n}-H_n}{2n}$$

Replace $$2n$$ by $$n$$ then multiply both sides by $$\frac{(-1)^n}{n^2}$$ and sum up we get

$$\sum_{n=1}^\infty \frac{(-1)^nH_n}{n^3}-\sum_{n=1}^\infty \frac{(-1)^nH_{n/2}}{n^3}=\int_0^1\frac{\ln(1+x)}{x}\sum_{n=1}^\infty \frac{(-x)^n}{n^2}dx\\=\int_0^1\frac{\ln(1+x)\operatorname{Li}_2(-x)}{x}dx=-\frac12\operatorname{Li}_2^2(-1)=-\frac12\left(-\frac12\zeta(2)\right)^2=-\frac5{16}\zeta(4)$$

I managed here to prove

$$\sum_{n=1}^\infty \frac{(-1)^nH_n}{n^3}=2\operatorname{Li_4}\left(\frac12\right)-\frac{11}4\zeta(4)+\frac74\ln2\zeta(3)-\frac12\ln^22\zeta(2)+\frac{1}{12}\ln^42$$

Thus

$$\sum_{n=1}^\infty \frac{(-1)^nH_{n/2}}{n^3}=2\operatorname{Li_4}\left(\frac12\right)-\frac{39}{16}\zeta(4)+\frac74\ln2\zeta(3)-\frac12\ln^22\zeta(2)+\frac{1}{12}\ln^42$$

\begin{align} \int_0^1\frac{x^{2n}}{1+x}\mathrm{d}x &=\int_0^1x^{2n}\sum_{k=0}^\infty(-x)^k\mathrm{d}x\\ &=\sum_{k=0}^\infty(-1)^k\int_0^1x^{2n+k}\mathrm{d}x\\ &=\sum_{k=0}^\infty\frac{(-1)^k}{2n+k+1}\\ &=\sum_{j=2n+1}^\infty\frac{(-1)^{j+1}}{j}\\ &=\sum_{j=1}^\infty\frac{(-1)^{j+1}}j-\sum_{j=1}^{2n}\frac{(-1)^{j+1}}j\\ &=\ln{(2)}+H_n-H_{2n}\\ \end{align}

• Very nice series manipulation Nov 8, 2019 at 23:40
• In fact the same method provides us with$$\int_0^1\frac{x^n}{1+x}\mathrm{d}x=(-1)^n(\ln{(2)}+H_{\lfloor n/2\rfloor}-H_n)$$ Nov 8, 2019 at 23:46

We have using only integration of rational functions: \begin{aligned} \int_0^1 \frac{x^{2n}}{x+1}\; dx &= \int_0^1 \frac{x^{2n}+x}{x+1}\; dx - \int_0^1 \frac{x}{x+1}\; dx \\ &= \int_0^1 \Big(x^{2n-1}-x^{2n-2}+\dots- x^4 + x^3 - x^2 + x\Big)\; dx - \int_0^1 \frac{x}{x+1}\; dx \\ &= \left(\frac 1{2n}-\frac 1{2n-1}+\dots -\frac 15+\frac 14-\frac 13+\frac 12\right)-1+\log 2 \\ &= \log 2 - H_{2n}+2\left( \frac 12+\frac 14+\dots+\frac 1{2n}\right) \\ &= \log 2 - H_{2n}+H_n\ . \end{aligned}

• interesting solution.. thank you (+1). Nov 9, 2019 at 1:16

A common proof:

\begin{align}\int_0^1 \frac{x^{2n}}{1+x}\,dx-H_n+H_{2n}&=\int_0^1 \frac{x^{2n}}{1+x}\,dx-\int_0^1 \frac{1-x^n}{1-x}\,dx+\int_0^1 \frac{1-x^{2n}}{1-x}\,dx\\ &=\int_0^1 \frac{1}{1+x}dx+\int_0^1 \frac{x^{2n}-1}{1+x}dx-\int_0^1 \frac{1-x^n}{1-x}dx+\\ &\int_0^1 \frac{1-x^{2n}}{1-x}dx\\ &=\int_0^1 \frac{1}{1+x}\,dx-\int_0^1 \frac{1-x^n}{1-x}\,dx+\int_0^1 \frac{2x(1-x^{2n})}{1-x^2}\,dx\\ \end{align}In the last integral perform the change of variable $$y=x^2$$, \begin{align}\int_0^1 \frac{x^{2n}}{1+x}\,dx-H_n+H_{2n}&=\int_0^1 \frac{1}{1+x}\,dx-\int_0^1 \frac{1-x^n}{1-x}\,dx+\int_0^1 \frac{1-x^n}{1-x}\,dx\\ &=\int_0^1 \frac{1}{1+x}\,dx\\ &=\ln 2 \end{align}

NB: For $$n\geq 1$$, integer, \begin{align}H_n=\int_0^1 \frac{1-x^n}{1-x}\,dx\end{align} Proof by induction: \begin{align}\int_0^1 \frac{1-x}{1-x}\,dx&=1\\ &=H_1\\ \int_0^1 \frac{1-x^{n+1}}{1-x}dx&=\int_0^1 \frac{1-x^n}{1-x}dx+\int_0^1 \frac{x^n-x^{n+1}}{1-x}dx \\ &=H_n+\int_0^1 \frac{x^n(1-x)}{1-x}\,dx\\ &H_n+\int_0^1 x^n\,dx\\ &=H_n+\frac{1}{n+1}\\ &=H_{n+1} \end{align}

• nice solution (+1) thank you Nov 10, 2019 at 19:59
• You're welcome !
– FDP
Nov 10, 2019 at 20:01

A magical solution by Cornel as usual:

\begin{align} \int_0^1\frac{x^{2n}}{1+x}dx&=\ln2-2n\int_0^1x^{2n-1}\ln(1+x)dx\tag1\\ &=\ln2-2n\int_0^1x^{2n-1}\ln(1-x^2)dx+2n\int_0^1x^{2n-1}\ln(1-x)dx\tag2\\ &=\ln2-n\int_0^1y^{n-1}\ln(1-y)dy+2n\int_0^1x^{2n-1}\ln(1-x)dx\tag3\\ &=\ln2-n\left(-\frac{H_n}{n}\right)+2n\left(-\frac{H_{2n}}{2n}\right)\tag4\\ &=\ln2+H_n-H_{2n} \end{align}

Explanation:

1) Apply integration by parts

2) Write $$\ln(1+x)=\ln(1-x^2)-\ln(1-x)$$

3) Set $$x^2=y$$ for the first integral

4) Use $$\int_0^1 x^{n-1}\ln(1-x)dx=-\frac{H_n}{n}$$

$$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\left\vert\,{#1}\,\right\vert}$$ $$\ds{\bbox[10px,#ffd]{\int_{0}^{1}{x^{2n} \over 1 + x}\,\dd x = \ln\pars{2} + H_{n} - H_{2n}}:\ {\Large ?}}$$.

\begin{align} &\bbox[10px,#ffd]{\int_{0}^{1}{x^{2n} \over 1 + x}\,\dd x} = \int_{0}^{1}{x^{2n} - x^{2n + 1}\over 1 - x^{2}}\,\dd x = \int_{0}^{1}{x^{n} - x^{n + 1/2}\over 1 - x} \pars{{1 \over 2}\,x^{-1/2}}\dd x \\[5mm] = &\ {1 \over 2}\pars{\int_{0}^{1}{1 - x^{n} \over 1 - x}\,\dd x - \int_{0}^{1}{1 - x^{n - 1/2} \over 1 - x}\,\dd x} = {1 \over 2}\pars{H_{n} - H_{n - 1/2}} \end{align}

where I used the Harmonic Number Euler Integral representation.

With the Harmonic Number Multiplication Theorem: \begin{align} &\bbox[10px,#ffd]{\int_{0}^{1}{x^{2n} \over 1 + x}\,\dd x} = {1 \over 2}\braces{\vphantom{\Large A}H_{n} - \bracks{\vphantom{\large A}2H_{2n} - H_{n} - 2\ln\pars{2}}} \\[5mm] = & \bbx{\ln\pars{2} + H_{n} - H_{2n}} \end{align}

• Nice solution Felix (+1). Jul 29, 2020 at 7:03