TITLE: Calculating value of $\pi$ independently using integrals.
QUESTION [8 upvotes]: Recently I noticed this integral:

$$\int_0^1\frac{x^4(1-x)^4}{1+x^2}dx=\frac{22}7-\pi\approx0$$

Which is a very interesting result which gives us the value of $\pi\approx\frac{22}7\approx3.142857142$ with 2 decimal places correct.
Note that actual value of $\pi\approx$3.14159265359

I suppose this happens because as $0<x<1$. So $\displaystyle \frac{x^4(1-x)^4}{1+x^2}\ll1$, so integral must approximately be zero.
Integrating this by hand:
$$\int_0^1\frac{x^4(1-x)^4}{1+x^2}dx=\int_0^1\left(x^6-4x^5+5x^4-4x^2+4-\frac{4}{x^2+1}\right)dx$$
which can be easily calculated, and  the $(x^2+1)^{-1}$ term will make an $\arctan$ term which will generate $\pi$.
Taking this to the next level I calculated these which all can be done by hand:


$$\int_0^1\frac{x^8(1-x)^8}{1+x^2}dx=4\pi-\frac{188684}{150115}\approx0\quad:\pi\approx\frac{188684}{4\times150115}=\frac{47171}{15015}\approx3.141591741$$


5 decimal places correct.


$$\int_0^1\frac{x^{12}(1-x)^{12}}{1+x^2}dx=\frac{431302721}{8580495}-16\pi\approx0\quad:\pi\approx\frac{431302721}{16\times8580495}=\frac{431302721}{137287920}\approx3.14159265433$$


8 decimal places correct.
With such an effort(probably using some software) we can go to these:


$$\int_0^1\frac{x^{8n}(1-x)^{8n}}{1+x^2}dx=A(n)-B(n)\pi\tag{1}$$
  $$\int_0^1\frac{x^{8n+4}(1-x)^{8n+4}}{1+x^2}dx=C(n)\pi-D(n)\tag{2}$$
  where $n={0,1,2,3,\ldots}$ and $A,B,C,D$ are functions of n, all of which are always positive.


And with $n\to\infty$ we'll probably reach exact value of $\pi$

Results:

This type of integrals $(1)$ and $(2)$
are very close to zero and help finding values of $\pi$
The no. of correct  decimal places from an AP: $2,5,8,\ldots$
The coefficient of $\pi$ term alternate as $(-1)^{n/4}4^n$
Other similar results and any of yours, if you observed.

Real question:

Can anyone put more insight to this as to explain the results?Isn't there any circular reasoning involved?

REPLY [2 votes]: This integral has a series equivalent
$$\frac{22}{7}-\pi=\sum_{k=1}^\infty \frac{240}{(4k+1)(4k+2)(4k+3)(4k+5)(4k+6)(4k+7)}$$
More generally,
$$\sum_{k=m}^\infty \frac{240}{(4k+1)(4k+2)(4k+3)(4k+5)(4k+6)(4k+7)}=\int_0^1 \frac{x^{4m}(1-x)^4}{1+x^2}dx$$
which gives closer rational approximations to $\pi$ by adding more terms of the summation.
https://math.stackexchange.com/a/1657416/134791
A similar result is obtained changing the denominator to $\frac{1-x^8}{1-x^2}=1+x^2+x^4+x^6$.
$$ \frac{2\sqrt{2}}{3} \int_0^1 \frac{x^4 (1-x)^4} {1+x^2+x^4+x^6} dx = \frac{20 \sqrt{2}}{9}-\pi$$
Other interesting denominators are $1+x+x^2$, $\frac{1-x^6}{1-x^2}$ and $\frac{1-x^{12}}{1-x^2}$, which lead to approximations involving $\sqrt{3}$ and different exponents in the numerator.