I want to solve the integral $$ \int_0^1 \frac{1 - x^n}{(1 - x)(1 + x)^n} \, dx $$ but I don't know how to solve it. This got shared on a math group. This is what I tried \begin{align*} & \int_0^1 \frac{1 - x^n}{(1 - x)(1 + x)^n} \, dx \\ & \overset{\text{IBP}}{=} \frac{1 - n 2^{1 - n}}{n - 1} + \frac{1}{n - 1} \int_0^1 \frac{1}{(1 - x)(1 + x)^{n - 1}} \left( \frac{1 - x^n}{1 - x} - n x^{n - 1} \right) \, dx \end{align*} I don't know how to move forward with this. I also tried $$\int_0^1 \frac{1 - x^n}{(1 - x)(1 + x)^n} \, dx = 2 \int_0^{\pi/4} \frac{1 - \tan^{2n}(\theta)}{\cos(2\theta) \sec^{2n}(\theta)} \tan(\theta) \, d\theta $$$$ \int_0^1 \frac{1 - x^n}{(1 - x)(1 + x)^n} \, dx = \int_{1/2}^1 \frac{1 - \left( \frac{1 - y}{y} \right)^n}{2y - 1} y^{n - 1} \, dy $$ I would appreciate any help
-
The one with $y$ is clever, and like it's almost ready to just cancel some terms and evaluate. Except for leaving a $y$ in the denominator, a sum over integrals might work for that version. – abiessu Sep 08 '25 at 04:56
-
3Write as $$\int_0^1 \frac{1 + x + x^2 + x^3 +... + x^{n-1}}{(1 + x)^n},\mathrm{d}x$$ then use the substitution $u = 1 + x$. – Azlif Sep 08 '25 at 05:24
-
2If we denote the integral as $I(n)$ then the recurrence relation for $n\ge3$ is : $$2I(n)-3I(n-1)+I(n-2)=\frac{4-2^n}{2^n(n-1)(n-2)}$$ where $I(1)=I(2)=\ln(2)$. – OnTheWay Sep 08 '25 at 05:36
6 Answers
A generating function approach
Let $I_n=\int_0^1\frac{1-x^n}{(1-x)(1+x)^n}\,\mathrm dx$, then for $|t|<1$ we have $$\sum_{n=0}^{\infty}I_nt^n=\int_0^1\frac{1}{1-x}\sum_{n=0}^{\infty}\frac{t^n-(tx)^n}{(1+x)^n}\,\mathrm dx=\int_0^1\frac1{1-x}\left(\frac1{1-t/(1+x)}-\frac1{1-tx/(1+x)}\right)\,\mathrm dx$$ Which is justified by the non-negativity of the integrand of $I_n$ and Tonelli's theorem, this integral is easy to evaluate, it is $t\left(\frac{\ln(2-t)}{1-t}-\frac{\ln(1-t)}{2-t}\right)$. Now we use the following identities: $$\ln(2-t)=\ln2-\sum_{n=1}^{\infty}\frac{t^n}{n2^n},\frac t{1-t}=\sum_{n=1}^{\infty}t^n,\ln(1-t)=-\sum_{n=1}^{\infty}\frac{t^n}n,\frac t{2-t}=\sum_{n=1}^{\infty}\frac{t^n}{2^n}$$ Valid for $|t|<1$, to get $$\sum_{n=0}^{\infty}I_nt^n=\sum_{n=1}^{\infty}\ln2\ t^n+\sum_{n=2}^{\infty}t^n\sum_{\substack{i+j=n\\i,j\ge 1}}\frac1{i2^j}-\frac1{i2^i}$$ Therefore $$I_0=0,I_1=\ln2,I_n=\ln2+\sum_{\substack{i+j=n\\i,j\ge 1}}\frac1{i2^j}-\frac1{i2^i}=\ln2+\sum_{i=1}^{n-1}\frac{2^i}{i2^n}-\frac1{i2^i}\,\forall\,n\ge 2$$
Consider $n\notin\mathbb{N}$ (this can be easily modified to show the formula above for $n\in\mathbb{N}$): $$\int_0^1\frac{1-x^n}{(1-x)(1+x)^n}\,\mathrm dx\\ \overset{x=(1-t)/(1+t)}=\frac1{2^n}\int_0^1\frac{(1+t)^n-(1-t)^n}{t(t+1)}\,\mathrm dt\\ =\frac1{2^n}\int_0^1\frac{(1+t)^n\color{red}{-1}}t-\frac{(1-t)^n\color{red}{-1}}t-(1+t)^{n-1}+\frac{(1-t)^n}{t+1}\,\mathrm dt\\ =\frac1{2^n}\left(\int_1^2\frac{t^n-1}{t-1}\,\mathrm dt+\int_0^1\frac{t^n-1}{t-1}\,\mathrm dt-\frac{2^n-1}n+\int_0^1\frac{t^n}{2-t}\,\mathrm dt\right)\\ =\frac1{n2^n}-\frac1n+\frac1{2^n}\left(\sum_{k=0}^{\infty}\int_1^2t^{n-k-1}-t^{-k-1}\,\mathrm dt-\int_0^1t^{n+k}-t^k-\frac{t^{n+k}}{2^{k+1}}\,\mathrm dt\right)\\ =\frac1{n2^n}-\frac1n+\frac1{2^n}\left(\frac{2^n-1}n-\ln2+\sum_{k=1}^{\infty}\left(\frac{2^{n-k}-1}{n-k}+\frac{2^{-k}-1}k\right)-\sum_{k=0}^{\infty}\left(\frac1{n+k+1}-\frac1{k+1}-\frac1{2^{k+1}(n+k+1)}\right)\right)\\ =\frac1{2^n}\left(-\ln2+\sum_{k=1}^{\infty}\frac{2^{n-k}-1}{n-k}+\frac{2^{-k}-1}k-\frac1{n+k}+\frac1k+\frac1{2^k(n+k)}\right)\\ =\frac1{2^n}\left(\frac1n-\pi\cot\pi n+\sum_{k=1}^{\infty}\frac{2^{n-k}}{n-k}+\frac1{2^k(n+k)}\right)\,\forall\,n>-1,n\notin\mathbb{N}$$
- 10,088
-
4You can use Lerch function for the summation. Very nice answer ! – Claude Leibovici Sep 08 '25 at 08:06
-
3
-
@Thin Dinh 1+ I like your formula. It is valid even for $n>=1$ – Dr. Wolfgang Hintze Sep 11 '25 at 17:23
-
It is interesting to watch the math AI gpai.app struggle with this integral before arriving at a purported solution. – John Wayland Bales Sep 11 '25 at 19:57
-
lol i thought of asking because you claimed to be from Vietnam but anyways – Chicori Sep 17 '25 at 23:02
-
1@Ani I'm actually from Vietnam, chỉ là không đến từ thành phố Hà Nội, cheers :-) – Thinh Dinh Sep 17 '25 at 23:21
While not as tidy as @ThinhDinh's answer,we can use the recurrence relation given by @OnTheWay
\begin{align} 2I(n)-3I(n-1)+I(n-2)=\frac{4-2^n}{(n-1)(n-2)2^n};\quad n\geq2,\ I(1)=I(2)=\log 2, \end{align} to arrive at the answer.
Denote $J(n)=I(n)-\frac12 I(n-1)$, which satisfies \begin{align} J(n)-J(n-1)=\frac{4-2^n}{2^{n+1}(n-1)(n-2)};\quad n\geq3,\ J(2)=\frac12\log2. \end{align} Summing yields \begin{align} J(n)=\frac12\log2+\frac12\sum_{m=3}^n\frac{4-2^m}{2^m(m-1)(m-2)}=\frac12\log2+\frac14\sum_{m=0}^{n-3}\frac{1-2^{m+1}}{2^m(m+1)(m+2)}, \end{align} and in terms of $I(n)$ \begin{align} I(n)-\frac12I(n-1)=\frac12\log2+\frac14\sum_{m=0}^{n-3}\frac{1-2^{m+1}}{2^m(m+1)(m+2)}. \end{align} Using the summation factor $2^n$ we have \begin{align} I(n)=\log2+2^{1-n}\sum_{k=0}^{n-3}2^k\sum_{m=0}^k\frac{1-2^{m+1}}{2^m(m+1)(m+2)}. \end{align} In terms of the Lerch transcendent the inner sum comes out as \begin{align} I(n)&=\log2+2^{1-n}\sum_{k=0}^{n-3}2^k\left[\frac{2}{k+2}-2\log2+\frac{\Phi\{1/2,1,k+3\}-\Phi\{1/2,1,k+2\}}{2^{1+k}}\right]\\\\ &=2^{2-n}\sum_{k=0}^{n-3}\frac{2^k}{k+2}+2^{-n}\left[\Phi\{1/2,1,n\}+2\right]. \end{align} In terms of finite sums we have that \begin{align} I(n)=\log2+2^{2-n}+2^{2-n}\sum_{k=1}^{n-3}\frac{2^k}{k+2}-\sum_{k=1}^{n-1}\frac{2^{-k}}{k}, \end{align} which reduces to the sum given by ThinDinh: \begin{align} I(n)=\log 2+\sum_{k=1}^{n-1}\frac{2^{k-n}-2^{-k}}{k};\quad n\geq2. \end{align} In terms of the Lerch transcendent we have \begin{align} I(n)=2^{-n}\Phi\{1/2,1,n\}-\Phi\{2,1,n\}-2^{-n}i\pi. \end{align}
A note for anyone following along: \begin{align} \Phi\{z,1,n\}=\sum_{k\geq0}\frac{z^k}{k+n}=z^{-n}\sum_{k\geq n}\frac{z^k}{k}=z^{-n}\left(\log z-\sum_{k=1}^{n-1}\frac{z^k}{k}\right) \end{align}
- 2,669
-
2@ Eli Bartlett I like your formula with the finite sums. For completeness you might mention that it is valid for $n>=2$. – Dr. Wolfgang Hintze Sep 11 '25 at 15:32
-
Let us assume that, $y = \dfrac{x}{1+x}$, hence $dx = \dfrac{1}{(1-y)^2}dy$.
So, $ \int_0^1 \frac{x^m}{(1 + x)^n} \, dx \\= \int_{0}^{1/2} \frac{y^m (1-y)^n}{(1 - y)^m(1 - y)^2} \, dy \\= \int_0^{1/2} y^m(1-y)^{n-m-2} \, dy, \text{where} ~m < n \\= B_{1/2}(m+1, n-m-1) $
Also observe that,$$ \int_0^1 \frac{1 - x^n}{(1 - x)(1 + x)^n} \, dx = \int_0^1 \frac{1 + x + x^2 + \cdots + x^{n-1}}{(1 + x)^n} \, dx = \displaystyle \sum_{m=0}^{n-1}B_{1/2}(m+1, n-m-1)$$
For the antiderivative, we can write
$$\frac{1 - x^n}{(1 - x)(1 + x)^n}=\frac 1{(1-x) (1+x)^n }-\frac {1}{1-x}\left(\frac{x}{1+x}\right)^n$$ For the first $$\int \frac {dx}{(1-x) (1+x)^n }=2^{-n} B_{\frac{x+1}{2}}(1-n,0)$$
For the second $$x=\frac t{1-t} \quad \implies \quad \int \frac {1}{1-x}\left(\frac{x}{1+x}\right)^n\,dx=\int \frac{t^n}{(t-1) (2 t-1)}\,dt$$ Using partial fraction decomposition $$\frac{t^n}{(t-1) (2 t-1)}=\frac{t^n}{t-1}-\frac{2 t^n}{2 t-1}$$
$$\int\frac{t^n}{t-1} \,dt=-\frac{t^{n+1} }{n+1}\,\, _2F_1(1,n+1;n+2;t)$$
$$\int\frac{2 t^n}{2 t-1} \,dt=-\frac{2 t^{n+1}}{n+1}\,\, _2F_1(1,n+1;n+2;2 t)$$
Back to $x$ and the bounds, the result already given in other answers.
- 299,370
$$ \begin{aligned} I_n=&\int_0^1 \frac{1-x^n}{(1-x)(1+x)^n} d x \\ = & \int_0^1 \frac{1+x+x^2+\cdots+x^{n-1}}{(1+x)^n} d x \\ = & \sum_{k=0}^{n-1} \int_0^1 \frac{x^k}{(1+x)^n} d x \end{aligned} $$ For any $k\ne n-1$, putting $x+1\to x$ yields $$ \begin{aligned} \int_0^1 \frac{x^k}{(1+x)^n} d x& =\int_1^2 \frac{(x-1)^{k}}{x^n} d x \\ & =\sum_{j=0}^k (-1)^{k-j}\binom{k}{j} \int_1^2 x^{j-n} d x \\ & =\sum_{j=0}^k (-1)^{k-j}\binom{k}{j}\left[\frac{x^{j-n+1}}{j-n+1}\right]_1^2 \\ & =\sum_{j=0}^k (-1)^{k-j}\binom{k}{j} \frac{2^{j-n+1}-1}{j-n+1} \end{aligned} $$ For $k=n-1$,
$$ \begin{aligned} \int_0^1 \frac{x^{n-1}}{(1+x)^n} d x = & \int_1^2 \frac{(x-1)^{n-1}}{x^n} d x \\ = & \sum_{j=0}^{n-1}(-1)^{n-1-j}\binom{n-1}{j} \int_1^2 x^{j-n} d x \\ = & \sum_{j=0}^{n-2}(-1)^{n-1-j}\binom{n-1}{j} \frac{2^{j-n+1}-1}{j-n+1}+\ln 2 \end{aligned} $$
Plugging back yields $$\boxed{I_n= \sum_{k=0}^{n-2} \sum_{j=0}^k(-1)^{k-j}\binom{k}{j} \frac{2^{j-n+1}-1}{j-n+1} +\sum_{j=0}^{n-2}(-1)^{n-1-j}\binom{n-1}{j} \frac{2^{j-n+1}-1}{j-n+1}+\ln 2} $$
- 33,510
-
If you compute the inner sum, you have two gaussian hypergeometric functions. – Claude Leibovici Sep 10 '25 at 06:44
-
-1, This answer is wrong: there is a $(−1)^{k−j}$ missing in this sum. See https://math.stackexchange.com/a/5095399. @ThinhDinh This makes the Hockey-stick identity useless. – Anne Bauval Sep 10 '25 at 18:35
-
@AnneBauval oh well, I should've read the answer more carefully before making that comment – Thinh Dinh Sep 10 '25 at 22:37
-
@AnneBauval, thank you very much for your comments on my mistakes which were just fixed. – Lai Sep 11 '25 at 09:59
-
-
@ Lai Sorry, it was wrong, because of a typo in the integrand and has been deleted. – Dr. Wolfgang Hintze Sep 11 '25 at 15:23
This is a long winded comment.
This is not an answer.
The following idea, which would be my first try, might not be viable. Use recursion.
First of all, you have that
$$\frac{1 - x^n}{1-x} = \sum_{k=0}^{n-1} x^k.$$
Now employ integration by parts on the indefinite integral
$$\int x^k \times (1+x)^{-n}. \tag1 $$
u = x^k v = [ -1/(n-1) ] times (1+x)^{-(n-1)}
du = k \times x^{k-1} dx dv = (1+x)^{-n} dx
So, you have the following formula: the expression in (1) above equals
$$- \frac{x^k \times (1+x)^{-(n-1)}}{n-1} + \frac{k}{n-1} \times \int x^{k-1} \times (1+x)^{n-1}, \tag2 $$
where $~k < n.$
You can then recursively apply the formula in (2) above $~(k)~$ times to obtain a set of closed form anti-derivative terms, plus something that looks like the following:
$$C \times \int \frac{1}{(1+x)^{n-k}} ~dx \\= C \times \left[ ~\frac{-1}{n-(k-1)} \times (1+x)^{-[n-(k-1)]} ~\right]. \tag3 $$
The formula in (3) above is good when $~k < n-1.~$
For $~k = n-1,~$ you end up with
$$C \times \int \frac{1}{1+x} ~dx = C \times \log(1+x). \tag4 $$
- 43,148
- 3
- 23
- 47