Evaluate $\int_{0}^{1}\frac{1+x+x^2}{1+x+x^2+x^3+x^4}dx$

This integral appeared on AoPS a while ago, it might be that it was on MSE too. Anyway I will quote what I did on AoPS.

$$I=\int_{0}^{1}\frac{(1+x+x^2)}{1+x+x^2+x^3+x^4}dx=\int_0^1 \frac{1-x^3 }{1-x^5}dx$$ Recall the geometric series: $\displaystyle{\frac{1}{1-x^z}=\sum_{n=0}^\infty x^{nz}, \, |x|<1 } $. Applying it here: $$I=\int_0^1 (1-x^3) \left(\sum_{n=0}^\infty x^{5n}\right)dx=\sum_{n=0}^\infty \int_0^1 \left(x^{5n}-x^{5n+3}\right)dx$$ I don't know how to show that we can swap the sum and the integral here. $$I=\left(\frac{x^{5n+1}} {5n+1} - \frac{x^{5n+4}} {5n+4}\right) \bigg|_0^1 =\sum_{n=0}^\infty\left(\frac{1} {5n+1} - \frac{1 } {5n+4}\right) =\frac15 \sum_{n=0}^\infty\left(\frac{1} {n+\frac15} - \frac{1 } {n+\frac45}\right) $$ We have by the series formula of digamma function that: $$\psi(z)-\psi(s)=\left(-\gamma-1+\sum_{n=1}^\infty\frac{1}{n}-\frac{1}{z+n}\right)-\left(-\gamma-1+\sum_{n=1}^\infty\frac{1}{n}-\frac{1}{s+n}\right)=\sum_{n=1}^\infty\left(\frac{1}{s+n}-\frac{1}{z+n}\right) $$ So $\displaystyle{ I=\frac15\left(\psi\left(\frac45\right) - \psi\left(\frac15\right)\right) } $. Also using the reflection formula:$$\psi(1-z)-\psi(z)=\pi\cot(\pi z)$$ We have: $$I=\frac{\pi} {5}\cot\left(\frac{\pi}{5}\right)=\frac{\pi} {5}\sqrt{1 +\frac{2} {\sqrt 5}}$$ see also: https://en.m.wikipedia.org/wiki/Digamma_function and http://mathworld.wolfram.com/TrigonometryAnglesPi5.html


New solution and quite elementary. Let: $$x=\frac{1-t}{1+t}\rightarrow dx=-\frac{2}{(1+t)^2}dt$$ $$\Rightarrow I=2\int_0^1 \frac{x^2+3}{x^4+10x^2+5}dx$$ And by performing partial fractions we get: $$I=\frac{\sqrt 5+1}{\sqrt 5}\int_0^1 \frac{dx}{x^2+2\sqrt 5+5}+\frac{\sqrt 5-1}{\sqrt 5}\int_0^1 \frac{dx}{x^2-2\sqrt 5+5}$$ And now there are two simple integrals left and some algebra.


The reduced form you gave in the end is a good starting point. Since we are within the interval $[0,1]$ we may expand the denominator as its corresponding geometric series, followed by changing the order of summation and integration and finally by termwise integration. Overall this leads us to

$$I=\int_0^1\frac{1-x^3}{1-x^5}\mathrm dx=\int_0^1\sum_{n=0}^\infty x^{5n}(1-x^3)\mathrm dx=\sum_{n=0}^\infty\int_0^1x^{5n}-x^{5n+3}\mathrm dx\\=\sum_{n=0}^\infty\left[\frac{x^{5n+1}}{5n+1}-\frac{x^{5n+4}}{5n+4}\right]_0^1 =\sum_{n=0}^\infty\left[\frac{1}{5n+1}-\frac{1}{5n+4}\right]$$

The difficult task is to find a closed-form for this sum. Of course, one could invoke the Digamma Function as Zacky quoted, but we can also note the following due the absolute convergence of the series

$$I=\sum_{n=0}^\infty\left[\frac{1}{5n+1}-\frac{1}{5n+4}\right]=1-\frac14+\frac16-\frac19+\cdots=1+\sum_{n=1}^\infty\left[\frac{1}{5n+1}-\frac{1}{5n-1}\right]$$

The latter sum falls down quite easy by considering a well-known series expansion of the cotangent function

$$\pi\cot(\pi z)~=~\frac1z+\sum_{n=1}^{\infty}\frac{2z}{z^2-n^2} $$

Thus, we rewrite the original sum as

\begin{align} 1+\sum_{n=1}^\infty\left[\frac{1}{5n+1}-\frac{1}{5n-1}\right]&=1-\sum_{n=1}^\infty\frac2{25n^2-1}\\ &=1+\frac15\left[\sum_{n=1}^\infty\frac{2\frac15}{\left(\frac15\right)^2-n^2}\right]\\ &=1+\frac15\left[\pi\cot\left(\frac\pi5\right)-5\right]\\ &=\frac\pi5\cot\left(\frac\pi5\right) \end{align}

$$\therefore~I=\int_0^1\frac{1+x+x^2}{1+x+x^2+x^3+x^4}\mathrm dx=\sum_{n=0}^\infty\left[\frac{1}{5n+1}-\frac{1}{5n+4}\right]=\frac\pi5\sqrt{1+\frac2{\sqrt 5}}$$


Hint:

As the roots of the denominator are the complex fifth roots of unity, you find the factorization to be

$$1+x+x^2+x^3+x^4=\left(x^2+\frac{1+\sqrt5}2x+1\right)\left(x^2+\frac{1-\sqrt5}2x+1\right).$$

Then we can find a linear combination to obtain a quadratic polynomial with equal coefficients,

$$\left(\sqrt5+1\right)\left(x^2+\frac{1-\sqrt5}2x+1\right)+\left(\sqrt5-1\right)\left(x^2+\frac{1+\sqrt5}2x+1\right)=2\sqrt5(x^2+x+1)$$ which leads us to the decomposition in simple fractions.

Now,

$$\int_0^1\frac{dx}{x^2+2ax+1}=\int_0^1\frac{dx}{(x+a)^2+1-a^2}=\left.\frac1{\sqrt{1-a^2}}\arctan\frac{x+a}{\sqrt{1-a^2}}\right|_0^1.$$