Compute the integral $\int_0^1 \frac{x^4}{\sqrt{x(1-x)}}dx$ using residue I'm trying to compute the following integral:
$$
\int_{0}^{1}\frac{x^{4}}{\,\sqrt{\,{x\left(\,{1-x}\,\right)}\,}\,}\,\mathrm{d}x
$$
So what I am try to do is using a dog bone contour, let me call D, so in the bottom part I have the negative sign, but the orientation is invert in consideration to the upper part, then because the only singularity that I have is on  x = $\infty$ I have that
$$
\!\!\int_{D}f(z)\,dz = \!2\!\int_{0}^{1}\!\!\!f(x)dx
+ \left(\int_{\gamma_1}\!\! +\!\!\int_{\gamma_2}\right)
\!\!f(\xi)d\xi = 2\pi i\, \mbox{Res}(f,\infty)
$$
and then calculating the residue at infinity I have found this $3 \pi/8$, but the answer is actually  $35 \pi/128$. Can someone help me figure what to do?

 A: Let $\sqrt{x(1-x)}=tx$, $\implies x = \frac{1}{t^2+1}, 2tdt=\frac {-1} {x^2} dx$
So the integral becomes $2*\int_{0}^{\infty} \frac{1}{(t^2+1)^5} dt = \frac{35π}{128}$.
The last integral can be evaluated by reduction formula.
A: Let us use Beta-integral in terms of Gamma functions. By lrtting $x=\sin^2 t$
WE ger $$I=2\int_{0}^{\pi/2} \sin^8 t ~dt= 2 \frac{ \Gamma(9/2) \Gamma(1/2)}{2\Gamma(5)}=\frac{35 \pi}{128}.$$
A: This integral may be done using complex analysis, but as you will see, there is no residue calculation needed in a strict sense.  This is because the singularities of the integrand are not poles but branch points.
The way to attack this integral via complex analysis is to define a contour about a branch cut such that the integrand is single-valued on the contour.  Then we can use Cauchy's theorem to evaluate.
In this case, we consider the following contour integral:
$$\oint_C dz \, \frac{z^4}{\sqrt{z (z-1)}} $$
where $C$ is the following contour:

The radius of the large arc is $R$ and the radii of the small arcs are $\epsilon$. Note that the integrand of the contour integral has a $z-1$ rather than a $1-z$ in the square root.  This is done to put the final, real integral in to the form we seek.
Along $C$, we parametrize the contour integral to express in terms of real integrals.  The contour integral is then equal to, as $\epsilon \to 0$,
$$e^{i \pi} \int_R^0 dx \, \frac{x^4}{e^{i \pi} \sqrt{x (x+1)}} + \int_0^1 dx \, \frac{x^4}{e^{i \pi/2} \sqrt{x (1-x)}} \\+ \int_1^0 dx \, \frac{x^4}{e^{-i \pi/2} \sqrt{x (1-x)}} + e^{-i \pi} \int_0^R dx \, \frac{x^4}{e^{-i \pi} \sqrt{x (x+1)}} \\ + i R \int_{-\pi}^{\pi} d\theta \, e^{i \theta} \, \frac{R^4 e^{i 4 \theta}}{\sqrt{R e^{i \theta} \left (R e^{i \theta}-1 \right )}} $$
(The integrals around the small arcs clearly vanish as $\epsilon \to 0$, so I did not include them.)
Now, it should be clear that the first and fourth integrals vanish.  Further, the second and third integrals combine, so we get, for the contour integral,
$$-i 2 \int_0^1 dx \, \frac{x^4}{\sqrt{x (1-x)}} + i R^4 \int_{-\pi}^{\pi} d\theta \, e^{i 4 \theta} \left (1-\frac1{R e^{i \theta}} \right )^{-1/2}$$
The latter integral interests us.  Obviously, the integral is independent of $R$.  The way to see this is to expand the integrand of the latter integral for large $R$.  You will note that, for each term of the expansion, the resulting integral will be zero, except for the term in $1/R^4$, for which the resulting integral is simply $2 \pi$.  Note that this is very similar to what you may understand as a residue, and as such is known as a "residue at infinity," although strictly speaking we did not have to go out to infinity, just sufficiently larger than unity.
So we just need to find the coefficient of $y^4$ in the expansion of $(1-y)^{-1/2}$, where $y=\frac1{R e^{i \theta}}$.  As you may know, we have a very nice expansion:
$$(1-y)^{-1/2} = \sum_{k=0}^{\infty} \frac1{2^{2 k}} \binom{2 k}{k} y^k$$
Thus, the coefficient of $y^4$ is $\frac1{256} \binom{8}{4} = \frac{35}{128}$.   Therefore the contour integral is simply
$$-i 2 \int_0^1 dx \, \frac{x^4}{\sqrt{x (1-x)}} + i 2 \pi \frac{35}{128}$$
By Cauchy's theorem, this contour integral is zero because the integrand has no poles within $C$.  Therefore,

$$\int_0^1 dx \, \frac{x^4}{\sqrt{x (1-x)}} = \frac{35}{128} \pi$$

