TITLE: Complex integration to solve real integral $\int_{0}^{2}\frac{\sqrt{x\left(2-x\right)}}{\left(x+1\right)^{2}\left(3-x\right)}dx.$
QUESTION [6 upvotes]: I have to solve this integral
$$\int_{0}^{2}\frac{\sqrt{x\left(2-x\right)}}{\left(x+1\right)^{2}\left(3-x\right)}dx.$$
Thus, I formed the following contour:

By Chauchy theorem I have
$$I=\int_{C_{R}}f\left(z\right)dz+\int_{C_{r1}}f\left(z\right)dz+\int_{k_{\epsilon}}f\left(z\right)dz+\int_{z_{1}}f\left(z\right)dz+\int_{k_{\rho}}f\left(z\right)dz+\int_{C_{r2}}f\left(z\right)dz+\int_{z_{2}}f\left(z\right)dz=0$$
Now I use Jordan's lemma to calculate the values over small circles. I have
$$\lim_{z\rightarrow0}z\cdot\frac{\sqrt{z\left(2-z\right)}}{\left(z+1\right)^{2}\left(3-x\right)}=0\,\,\Rightarrow\,\,\lim_{r\rightarrow0}\int_{k_{\rho}}f\left(z\right)dz=0$$
$$\lim_{z\rightarrow3}\left(z-3\right)\cdot\frac{\sqrt{z\left(2-x\right)}}{\left(z+1\right)^{2}\left(3-z\right)}=0 \Rightarrow\,\,\lim_{r\rightarrow0}\int_{C_{r1}}f\left(z\right)dz=0$$
Now I have the problem with term $(x+1)^2$ because I cannot apply Jordan's lemma because I cannot find the limit.
$$\lim_{z\rightarrow-1}\left(z+1\right)\cdot\frac{\sqrt{z\left(2-z\right)}}{\left(z+1\right)^{2}\left(3-z\right)}=?$$
Does anyone have idea how to solve this? I think lemma cannot be applied here but I don't know the other way.
I also found the function is regular in infinity thus integral over $C_{R}$ is zero.

REPLY [2 votes]: Probably it would be much easier to consider a "dogbone" contour around the branch cut from 0 to 2 only:

It is trivial to see that the integrals over the circles at the end points vanish when their radius is taken to 0. Let's call the full contour $\gamma$.
When we move from a point on the upper edge (let's call it $x + i0$) to the corresponding point on the other side of the branch cut, $x - i0$, the argument of $f(z)$ increases by $-\pi$, so the function value is multiplied by $e^{-i\pi} = -1$, in other words $f(x + i0) = -f(x - i0)$, and since these edges are integrated in opposite directions, we get
$$\int_{0}^{2}f(x)dx = \frac12\oint_\gamma f(z)dz$$
This curve circles the branch cut in the clockwise direction, so its interior consists of all points outside of it, including $\infty$ where we'll get the contribution of the residue at $\infty$.
The residue theorem now tells us that
$$\oint_\gamma f(z)dz = 2\pi i\left(\operatorname{Res}(f,-1) + \operatorname{Res}(f,3) + \operatorname{Res}(f,\infty)\right)$$
It is not hard to compute these residues to be $-\frac{5\sqrt3 i}{48}$, $\frac{\sqrt3 i}{16}$ and $0$, except possibly for the sign: you can obtain this by noting that when going from $x_0 + i0$ to $x\in\mathbb R$ with $x > 2$, the argument of $x(2 - x)$ increases by $-\pi$, while for $x < 0$ it increases by $\pi$. We obtain a final result of
$$\int_{0}^{2}f(x)dx = \frac12\oint_\gamma f(z)dz = \frac{\sqrt3 \pi}{24}.$$