How to solve the following integral $\int_0^1 \dfrac{x^4}{\sqrt{x(1-x)}}dx$ (residue theorem) How to solve the following integral $\int_0^1 \dfrac{x^4}{\sqrt{x(1-x)}}dx$ (although we may use normal real integral to solve, I wonder if contour analysis can also help?) The question offers a hint like canine-friendly methods, however, I do not know what it is and can't find any reliable introduction about it... (I know by using substitution, this can be easily solved... But is there anyone can guess what is the meaning of canine-friendly?)
 A: Let $I$ be given by
$$I=\int_0^1\frac{x^4}{\sqrt{x(1-x)}}\,dx$$
Next, let $C$ be the classical dog bone contour around $[0,1]$ in the complex plane.  It is straightforward to show that
$$\oint_C \frac{z^4}{\sqrt{z(1-z)}}\,dz=-2I \tag1$$
since $C$ is traversed in the counter-clockwise direction.

In the following analysis, we cut the plane with branch cuts along the real axis from the branch points at $0$ and $1$ to $-\infty$.  These two branch cut coalesce as a branch cut from $0$ to $1$.  We ensure that the chosen branches are taken such that on the real axis above the branch cut $[0,1]$, we have $\sqrt{x(1-x)}\ge 0$.  Thus, we must have $\sqrt{x(1-x)}=-i\sqrt{x(x-1)}$.

Using the Residue Theorem, the integral in $(1)$ implicates only the Residue at Infinity.   Hence, we can write
$$\begin{align}
\oint_C \frac{z^4}{\sqrt{z(1-z)}}\,dz&=-2\pi i \text{Res}\left(\frac{z^4}{\sqrt{z(1-z)}}, z=\infty\right)\\\\
&\overbrace{=}^{w=1/z}2\pi i \text{Res}\left(\frac{1}{w^2}\frac{1/w^4}{\sqrt{(1/w)(1-1/w)}}, w=0\right)\\\\
&=2\pi i \lim_{w\to 0}\frac1{4!}\frac{d^4}{dw^4}\left(\frac{1}{\sqrt{w-1}}\right)\\\\
&=2\pi i \frac1{4!}\left(i\frac{105}{16}\right)\\\\
&=-\frac{35\pi}{64}\tag2
\end{align}$$
Dividing $(2)$ by $-2$ and substituting into $(1)$ yields the coveted result
$$I=\frac{35\pi}{128}$$
And we are done!

ALTERNATIVE METHODOLGY TO EVALUATE $(1)$
Using Cauchy's Integral Theorem, we can write for $R>1$,
$$\begin{align}
\oint_C \frac{z^4}{\sqrt{z(1-z)}}\,dz&=\oint_{|z|=R}\frac{z^4}{\sqrt{z(1-z)}}\,dz\\\\
&=-\int_0^{2\pi}\frac{R^4e^{i4\phi}}{\sqrt{1-\frac1{Re^{i\phi}}}}\,d\phi
\end{align}$$
Now, expand $\left(1-\frac1{Re^{i\phi}}\right)^{-1/2}$ in a power series of $\frac1{Re^{i\phi}}$ and note that the only non-zero contribution to the value of the integral comes from the fourth order term.  The coefficient on that term is $\frac{1}{4!}\frac{7!!}{2^4}=\frac{35}{128}$.
The rest is left to the reader to complete.
A: Not a complex analysis solution, but if you use $x=\sin^2 u$, then
$$\begin{split}\int_0^1 \dfrac{x^4}{\sqrt{x(1-x)}}dx&=\int_0^{\frac \pi 2} 2\sin^8(u)du\\
&= \int_0^{\frac \pi 2}\frac{35 - 56\cos(2u)+28\cos(4u)-8\cos(6u)+\cos(8u)}{64}du\\
&=\frac{35\pi}{128}
\end{split}$$
