<s>[INST] Evaluate $\int_{0}^{1}\frac{1+x+x^2}{1+x+x^2+x^3+x^4}dx$ Evaluate $$I=\int_{0}^{1}\frac{(1+x+x^2)}{1+x+x^2+x^3+x^4}dx$$
My try:
We have:
$$1+x+x^2=\frac{1-x^3}{1-x}$$
$$1+x+x^2+x^3+x^4=\frac{1-x^5}{1-x}$$
So we get:
$$I=\int_{0}^{1}\frac{1-x^3}{1-x^5}dx$$
$$I=1+\int_{0}^{1}\frac{x^3(x^2-1)}{x^5-1}dx$$
Any idea from here?
 [/INST] 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.
</s>