How to integrate $\int_0^1\frac{dx}{1+x+x^2+\cdots+x^n}$ I am interested in finding a solution to the integral
$$I_n=\int_0^1\frac{dx}{\sum_{k=0}^nx^k}$$
Since the denominator is a geometric series with $a=1$ and $r=x$ and it is within the radius of convergence, we should be able to say
$$\sum_{k=0}^nx^k=\frac{1-x^{n+1}}{1-x}=\frac{x^{n+1}-1}{x-1}$$
and
$$I_n=\int_0^1\frac{x-1}{x^{n+1}-1}dx$$
It makes sense to me that, for all values of $n$, $I_n$ is convergent since the bottom of the function is always above zero and the integral exists for $n\to\infty$ however I cannot seem to find a nice closed form for this.
One thought I did have was using:
$$\sum\ln(x_i)=\ln\left(\prod x_i\right)$$
but I cannot seem to make it work. Does anyone have any hints for this type of problem as I would like to try and complete it myself. Thanks :)
 A: $$I_n=\int_{0}^{1}\frac{dx}{1+x+x^2+\ldots+x^n}=\underbrace{\int_{0}^{1}\frac{1-x}{1-x^{n+1}}dx}_{x\rightarrow y^{\frac{1}{n+1}}}=\frac{1}{n+1}\int_{0}^{1}\frac{y^\frac{1}{n+1}-y^\frac{2}{n+1}}{y(1-y)}dy$$
$$=\frac{1}{n+1}\int_{0}^{1}\left(\frac{y^\frac{1}{n+1}-y^\frac{2}{n+1}}{y}+\frac{y^\frac{1}{n+1}-y^\frac{2}{n+1}}{1-y}\right)dy$$
$$1-\frac{n+1}{2(n+2)}+\frac{1}{n+1}\int_{0}^{1}\left(\frac{y^{\frac{1}{n+1}-1}\log{\left(1-y\right)}}{n+1}-\frac{y^{\frac{2}{n+1}-1}\log{\left(1-y\right)}}{n+2}\right)dy$$
$$=\frac{n+3}{2(n+2)}+\frac{1}{n+1}\left[\frac{\mathfrak{B}\left(\frac{1}{n+1},1\right)\left(\psi^{\left(0\right)}\left(1\right)-\psi^{\left(0\right)}\left(1+\frac{1}{n+1}\right)\right)}{n+1}-\frac{\mathfrak{B}\left(\frac{2}{n+1},1\right)\left(\psi^{\left(0\right)}\left(1\right)-\psi^{\left(0\right)}\left(1+\frac{2}{n+1}\right)\right)}{n+2}\right]$$
$$=\frac{n+3}{2(n+2)}+\frac{\psi^{\left(0\right)}\left(1+\frac{2}{n+1}\right)-\psi^{\left(0\right)}\left(1+\frac{1}{n+1}\right)}{n+1}=\frac{1}{2\left(n+2\right)}+\frac{\psi^{\left(0\right)}\left(\frac{2}{n+1}\right)-\psi^{\left(0\right)}\left(\frac{1}{n+1}\right)}{n+1}$$
Therefore:
$$I_n=\int_{0}^{1}\frac{dx}{1+x+x^2+\ldots+x^n}=\frac{1}{2\left(n+2\right)}+\frac{\psi^{\left(0\right)}\left(\frac{2}{n+1}\right)-\psi^{\left(0\right)}\left(\frac{1}{n+1}\right)}{n+1}$$
Notes:
$\mathfrak{B}(x,y)$ stands for the Beta Function and $\psi^{(0)}(z)$ stands for the Digamma Function.
A: Decompose the integrand as
$$\frac{1}{1+x+x^2+...+x^n}=\sum_{k=1}^{n}\frac{a_k}{x-x_k},\>\>\>\>\> a_k=\frac{x_k(x_k-1)}{n+1}
$$
where $x_k= e^{i \frac{2\pi k}{n+1}},\> k=1,2...n$. Then
\begin{align}
I_n&=\int_0^1\frac{dx}{1+x+x^2+...+x^n}\\
&=\int_0^1 \sum_{k=1}^{n}\frac{a_k}{x-x_k}dx
=\frac1{n+1}\sum_{k=1}^{n} x_k(x_k-1)\ln\left(1-\frac1{x_k}\right)
\end{align}
Substitute $x_k= e^{i \frac{2\pi k}{n+1}}$ into above summation to derive the close-form
$$\color{blue}{I_n = \frac\pi{2(n+1)} \csc\frac{2\pi}{n+1}-\frac4{n+1}\sum_{k=1}^{[\frac n2]}
\sin\frac{\pi k}{n+1}\sin\frac{3\pi k}{n+1}\ln\left(\sin\frac{\pi k}{n+1}\right)}
$$
Listed below are some sample results
\begin{align}
I_2 &= \frac{\pi}{3\sqrt3}\\
I_3 &= \frac\pi8 +\frac14\ln2\\
I_4 &= \frac\pi{10}\csc\frac{2\pi}{5}+\frac1{\sqrt5}\ln\left(2\cos\frac\pi5\right)\\
 I_5 &= \frac{\pi}{6\sqrt3}+\frac13\ln2\\
 I_7 &= \frac{\pi}{8\sqrt2}+\frac18\ln2 + \frac{1}{8\sqrt2}\ln \frac{\sqrt2+1}{\sqrt2-1}\\
 I_9 &= \frac\pi{20}\csc\frac{\pi}{5}+\frac15\ln2
+\frac1{2\sqrt5}\ln\left(2\cos\frac\pi5\right)\\
\end{align}
\begin{align}
I_6
&=\frac\pi{14}\csc\frac{2\pi}{7}-\frac1{2\sqrt7}\bigg( \frac{\ln\sin\frac\pi7}{\sin\frac{2\pi}7}
 +\frac{\ln\sin\frac{2\pi}7}{\sin\frac{3\pi}7}-\frac{\ln\sin\frac{3\pi}7}{\sin\frac{\pi}7}\bigg)
\\
\end{align}
\begin{align}
I_8 &= \frac\pi{18}\csc\frac{2\pi}{9}+\frac{2}{3\sqrt3} \bigg(\frac{\ln\csc\frac\pi9}{\csc\frac{\pi}9}
 +\frac{\ln\csc\frac{2\pi}9}{\csc\frac{2\pi}9}-\frac{\ln\csc\frac{4\pi}9}{\csc\frac{4\pi}9}\bigg)
\\
\end{align}
A: Computing the Integral
$$
\begin{align}
&\int_0^1\frac{1-x}{1-x^{n+1}}\,\mathrm{d}x\\
&=\int_0^1\sum_{k=0}^\infty\left[x^{(n+1)k}-x^{(n+1)k+1}\right]\tag1\\
&=\sum_{k=0}^\infty\left(\frac1{(n+1)k+1}-\frac1{(n+1)k+2}\right)\tag2\\
&=\frac12+\sum_{k=1}^\infty\left(\frac1{(n+1)k+1}-\frac1{(n+1)k+2}\right)\tag3\\
&=\frac12+\frac1{n+1}\sum_{k=1}^\infty{\scriptsize\left(\frac1k-\frac1{k+\frac2{n+1}}\right)}-\frac1{n+1}\sum_{k=1}^\infty{\scriptsize\left(\frac1k-\frac1{k+\frac1{n+1}}\right)}\tag4\\[3pt]
&=\frac12+\frac1{n+1}\left(H\!\left(\frac2{n+1}\right)-H\!\left(\frac1{n+1}\right)\right)\tag5\\[3pt]
&=\frac1{n+1}\sum_{k=1}^n\log\left(2\sin\left(\frac{\pi k}{n+1}\right)\right)\left(\cos\left(\frac{4\pi k}{n+1}\right)-\cos\left(\frac{2\pi k}{n+1}\right)\right)\\
&+\frac1{n+1}\sum_{k=1}^n\left(\frac{\pi}2-\frac{\pi k}{n+1}\right)\left(\sin\left(\frac{2\pi k}{n+1}\right)-\sin\left(\frac{4\pi k}{n+1}\right)\right)\tag6
\end{align}
$$
Explanation:
$(1)$: expand the Taylor series
$(2)$: integrate
$(3)$: pull the $k=0$ term out front
$(4)$: rearrange into two series
$(5)$: Write as extended Harmonic numbers
$(6)$: apply $(7)$ from this answer
Although $(5)$ is always valid, since $(7)$ from this answer requires $p\le q$, $(6)$ is only valid for $n\gt0$. For $n=0$, the integral is $1$.

Mathematica Implementation
Here is a Mathematica implementation of $(6)$:
how[n_]:=1/(n + 1)Sum[
    Log[2 Sin[Pi k/(n+1)]](Cos[4 Pi k/(n+1)]-Cos[2 Pi k/(n+1)])
    + (Pi/2-Pi k/(n+1))(Sin[2 Pi k/(n+1)]-Sin[4 Pi k/(n+1)]),
    {k,1,n}]

A: Making the problem more general
$$I_n=\int_0^t \frac {dx}{\sum_{k=0}^n x^k}=\int_0^t \frac {1-x}{1-x^{n+1}}\,dx$$
$$x=y^{\frac{1}{n+1}} \quad \implies \quad I_n=\frac 1{n+1}\int_0^{t^{n+1}} \frac{y^{-\frac{n}{n+1}}-y^{-\frac{n-1}{n+1}}} {1-y} \,dy$$ Using
$$\int \frac {y^a}{1-y}\,dy=\frac{y^{a+1} }{a+1}\,\, _2F_1(1,a+1;a+2;y)$$
$$\int_0^s \frac {y^a}{1-y}\,dy=B_s(a+1,0) \qquad \text{if} \qquad s<1\land a>-1$$
$$I_n=\frac 1{n+1}\Bigg[B_{t^{n+1}}\left(\frac{1}{n+1},0\right)-B_{t^{n+1}}\left(\frac{2}{n+1},0\right) \Bigg]$$
For the specific case where $t=1$,
$$I_n=\frac{\psi \left(\frac{2}{n+1}\right)-\psi \left(\frac{1}{n+1}\right)}{n+1}=\frac{H_{-\frac{n-1}{n+1}}-H_{-\frac{n}{n+1}}}{n+1}$$ If $n$ is large
$$I_n=\frac{1}{2}+\frac{\pi ^2}{6 n^2}-\frac{9 \zeta (3)+\pi^2
   }{3n^3}+\frac{810 \zeta (3)+45 \pi ^2+7 \pi ^4}{90 n^4}+O\left(\frac{1}{n^5}\right)$$
