Is there a nice finite sum expression for $\frac{x^{2n}(1-x)^{2n}}{1+x^2}$? I am currently investigating the integral $$\int_{0}^{1} \frac{x^{2n}(1-x)^{2n}}{1+x^2}dx$$ where $n \in \mathbb{N}$. which seems to be a generator for rational approximations of $\pi$ or $\ln 2$ depending on whether $n$ is even or odd.
But to investigate the rational component, I need to find an explicit sum for the integrand. The numerator is easily expressed as a sum with binomial coefficients, but the denominator is problematic. Currently, I cannot see a way of doing this as polynomial long division seems impractical here. 
Is there anything I can do to get a finite sum for the integrand that I can integrate term-by-term?
 A: In the numerator, substituting $x=i$ and $x=-i$ (roots of $x^2+1=0$)  give $(i+1)^{2n}$ and $(1-i)^{2n}$ respectively. Since a higher order polynomial divided by a quadratic function would remain a linear function at most, denote that by $L(x)$, then we know:
$$L(i)=ai+b=(i+1)^{2n}=(\sqrt 2)^{2n}e^{\frac{i\pi n}2}$$
$$L(-i)=-ai+b=(1-i)^{2n}=(\sqrt 2)^{2n}e^{-\frac{i\pi n}2}$$
Solving it:
$a=2^n \sin({\frac{\pi n}2})$
$b=2^n \cos(\frac{\pi n}2)$

We first find the integral of $\frac{L(x)}{1+x^2}$
$$2^n \int_0^1 \frac{ \sin(\frac{\pi n}2)x+\cos(\frac{\pi n}2)}{1+x^2}dx$$
Let $\tan \theta =x$
$$=2^n \int_0^{\pi/4} \left(\sin(\frac{\pi n}2)\tan \theta + \cos(\frac{\pi n}2) \right)d\theta$$
Using $(\ln|\sec \theta |)'=\tan \theta$,
$$=2^{n-1} ( \ln 2 \sin(\frac{\pi n}2) +\frac{\pi}2 \cos(\frac{\pi n}2) )$$

Now we need to expand it to find the quotient, first rewrite it as
$$(1+x^2)^{2n-1} * \left(\frac{x-x^2}{x^2+1}\right)^{2n}=(1+x^2)^{2n-1}\left( \frac{x+1}{x^2+1}-1\right)^{2n}$$
$$=(1+x^2)^{2n-1} \sum_{k=0}^{2n}\binom{2n}k (-1)^k \left(\frac {x+1}{x^2+1}\right)^{2n-k}$$
$$=\sum_{k=0}^{2n}\binom{2n}k (-1)^k (x+1)^{2n-k} (x^2+1)^{k-1}$$
The $k=0$ term matches with our remainder in the beginning, so the quotient (which would be a polynomial) is:
$$\sum_{k=1}^{2n}\binom{2n}k (-1)^k (x+1)^{2n-k} (x^2+1)^{k-1}$$
Expanding the expansion:
$$\sum_{k=1}^{2n}\left[ \binom{2n}k (-1)^k \left(\sum_{j=0}^{2n-k} \binom{2n-k}j x^j \right) \left(\sum_{l=0}^{k-1}\binom{k-1}l x^{2l}\right)\right]$$
Merging the product of sums into one:
$$\sum_{k=1}^{2n}\left[ \binom{2n}k (-1)^k \sum_{j=0}^{2n-k} \sum_{l=0}^{k-1} \binom{2n-k}j \binom{k-1}l x^{j+2l} \right]$$
Finally integrating:
$$\sum_{k=1}^{2n}\binom{2n}k (-1)^{2n-k} \left[\sum_{j=0}^{2n-k} \sum_{l=0}^{k-1} \binom{2n-k}j \binom{k-1}l \int_0^1x^{j+2l} dx\right]$$
Answer:


$$\sum_{k=1}^{2n}\left[\binom{2n}k (-1)^{2n-k} \sum_{j=0}^{2n-k} \sum_{l=0}^{k-1} \left(\binom{2n-k}j \binom{k-1}l \frac 1{j+2l+1}\right) \right]+ 2^{n-1}( \sin(\frac{\pi n}2) \ln2 +\frac{\pi}2 \cos(\frac{\pi n}2) ) $$


Observe that the integral is very close to $0$ if we pick larger $n$ because the value of $x^{2n}(1-x)^{2n}$ between $[0,1]$ would be very small. With the above expression, it shows why we can get rational approximation of the $\ln 2$ and $\pi$ for odd or even $n$.
A: Let $I_m = \displaystyle\int_0^1 \dfrac{x^{m}}{1+x^2}dx$. We then have
$$I_{m+1} + I_{m-1} = \int_0^1 x^{m-1}dx = \dfrac1{m}$$
We have $I_0 = \dfrac{\pi}4$ and $I_1 = \dfrac{\ln(2)}2$.
Hence, we have
\begin{align}
I_m & = \dfrac1{m-1} - \dfrac1{m-3} + \dfrac1{m-5} - \dfrac1{m-7} \pm \cdots +(-1)^{\lfloor m/2 \rfloor} I_{m\%2}\\
& = (-1)^{\lfloor m/2 \rfloor} I_{m\%2} + \sum_{k=1}^{\lfloor m/2 \rfloor} \dfrac{(-1)^{k-1}}{m-2k+1}
\end{align}
Your integral is
$$I_n = \int_0^1 \dfrac{x^{2n}(1-x)^{2n}}{1+x^2}dx = \sum_{k=0}^{2n} (-1)^k\dbinom{2n}k \int_0^1 \dfrac{x^{2n+k}}{1+x^2}dx = \sum_{k=0}^{2n} (-1)^k\dbinom{2n}k I_{2n+k}$$
From this is where you obtain your $\pi/4$ and $\ln(2)/2$
