TITLE: Calculus Question: $\int_0^1\frac{(x-x^2)^4}{1+x^2}dx$
QUESTION [6 upvotes]: I have no idea how to find this integral:
$$\int_0^1\frac{(x-x^2)^4}{1+x^2}\ dx\ ?$$
Any help would be appreciated. Thanks in advance.

REPLY [4 votes]: HINT :
$$
\begin{align}
\int_0^1\frac{(x-x^2)^4}{1+x^2}\ dx&=\int_0^1\frac{x^4-4x^5+6x^6-4x^7+x^8}{1+x^2}\ dx\tag1\\
&=\int_0^1\left(x^6-4x^5+5x^4-4x^2+4-\frac4{1+x^2}\right)\ dx.\tag2\\
\end{align}
$$
See binomial theorem for $(1)$ and polynomial long division for $(2)$. Also
$$
\begin{align}
\int_0^1\frac1{1+x^2}\ dx=\frac\pi4
\end{align}
$$
by letting $x=\tan\theta$. The answer is $\ \color{blue}{\dfrac{22}7-\pi}$.