Help with the contour for this integral using residues $$ PV \int_0^\infty \frac{dx}{\sqrt{x}(x^2-1)} $$ 
A keyhole contour can't be used because we have a pole in the real positive axis, isn't it?
 A: Make the branch cut for $\sqrt{z}$ along the positive real axis.

The integral over the entire closed curve is $2\pi i$ times the residue at $z=-1$:
$$
\begin{align}
\oint\frac{\mathrm{d}z}{\sqrt{z}(z^2-1)}
&=\oint\frac1{2\sqrt{z}}\left(\frac1{z-1}-\frac1{z+1}\right)\,\mathrm{d}z\\
&=2\pi i\cdot\frac i2\\[9pt]
&=-\pi\tag{1}
\end{align}
$$
The integral along the grey circles vanishes as the small one shrinks and the large one grows.
As it shrinks, the integral along the upper red semicircle is $-\pi i$ times the residue in the upper half plane at $z=1$; that is, $\sqrt{1}=1$:
$$
-\pi i\cdot\frac12\tag{2}
$$
As it shrinks, the integral along the lower red semicircle is $-\pi i$ times the residue in the lower half plane at $z=1$; that is, $\sqrt{1}=-1$:
$$
-\pi i\cdot-\frac12\tag{3}
$$
Thus, the integral over the two red semicircles cancel.
The integral over the upper perforated line is
$$
\mathrm{PV}\int_0^\infty\frac{\mathrm{d}x}{\sqrt{x}(x^2-1)}\tag{4}
$$
The integral over the lower perforated line is in the opposite direction, but $\sqrt{z}=-\sqrt{x}$, so it is also.
$$
\mathrm{PV}\int_0^\infty\frac{\mathrm{d}x}{\sqrt{x}(x^2-1)}\tag{5}
$$
Combining these gives
$$
2\,\mathrm{PV}\int_0^\infty\frac{\mathrm{d}x}{\sqrt{x}(x^2-1)}=-\pi\tag{6}
$$
Therefore,
$$
\mathrm{PV}\int_0^\infty\frac{\mathrm{d}x}{\sqrt{x}(x^2-1)}=-\frac\pi2\tag{7}
$$
A: If we interpret the integral as the Principal Value integral
$$\begin{align}
I&=\text{PV}\int_0^{\infty}\frac{dx}{x^{1/2}(x^2-1)}\\\\
& =\lim_{\epsilon\to 0}\left(\int_0^{1-\epsilon}\frac{dx}{x^{1/2}(x^2-1)}+\int_{{1+\epsilon}}^{\infty}\frac{dx}{x^{1/2}(x^2-1)}\right)
\end{align}$$
then we may evaluate $I$ using contour integration.  

We will analyze the integral
$$\oint_C \frac{dz}{z^{1/2}(z^2-1)}$$
where $C$ is the "keyhole" contour comprised of $C_1$, $C_2$, $C_3$, $C_4$, $C_5, C_6$, and $C_7$ where
$C_1$ is the integral along the real axis from $(0,0)$ to $(1-\epsilon,0)$ above the branch cut on the real axis
$C_2$ is the integral along the semi-circle $z=1+\epsilon e^{i\theta}$, above the branch cut, where $\theta$ starts at $\pi$ and ends at $0$
$C_3$ is the integral along the real axis from $(1+\epsilon,0)$ to $(R,0)$ above the branch cut on the real axis
$C_4$ is the integral along the circle $|z|=R$ from $(R,0)$ just above the branch cut to $(R,0)$ just below the branch cut
$C_5$ is the integral along the real axis from $(R,0)$ to $(1+\epsilon,0)$ below the branch cut on the real axis
$C_6$ is the integral along the semi-circle $z=1+\epsilon e^{i\theta}$, below the branch cut, where $\theta$ starts at $0$ and ends at $-\pi$ 
$C_7$ is the integral along the real axis from $(1-\epsilon,0)$ to $(0,0)$ below the branch cut on the real axis

There is an eight component of the contour integral that surround the branch point, but inasmuch as this integral is trivially seen to contribute zero, we tacitly omitted it herein.


Note that the integral of interest $I$ is given by
$$I=\lim_{R\to \infty}\lim_{\epsilon\to 0}\int_{C_1+C_3}\frac{dz}{z^{1/2}(z^2-1)}$$
and
$$I=\lim_{R\to \infty}\lim_{\epsilon\to 0}\int_{C_5+C_7}\frac{dz}{z^{1/2}(z^2-1)}$$ 
since below the branch cut $\sqrt{z}=-\sqrt{x}$.

Further note that the integral over $C_4$ vanishes as $R\to \infty$.

We now evaluate the integrals over $C_2$ and $C_6$.  These are
$$\begin{align}
\int_{C_4}\frac{dz}{z^{1/2}(z^2-1)}&=\int_{\pi}^0\frac{i\epsilon e^{i\theta}}{(1+\epsilon e^{i\theta})^{1/2}(\epsilon e^{i\theta})(2+\epsilon e^{i\theta})}d\theta\\\\
&\to -i\pi/2 \,\,\text{as}\,\,\epsilon \to 0
\end{align}$$
and
$$\begin{align}
\int_{C_6}\frac{dz}{z^{1/2}(z^2-1)}&=\int_{0}^{-\pi}\frac{i\epsilon e^{i\theta}}{\left(e^{i2\pi}(1+\epsilon e^{i\theta})\right)^{1/2}(e^{i2\pi}\epsilon e^{i\theta})(1+e^{i2\pi}(1+\epsilon e^{i\theta}))}d\theta\\\\
&\to i\pi/2 \,\,\text{as}\,\,\epsilon \to 0
\end{align}$$
Therefore, 
$$\lim_{\epsilon\to 0}\int_{C_2+C_4}\frac{dz}{z^{1/2}(z^2-1)}=0$$

Thus, putting it all together we have 
$$\begin{align}
2I&=\lim_{R\to \infty}\lim_{\epsilon\to 0}\oint_C \frac{dz}{z^{1/2}(z^2-1)}\\\\
&=2\pi i \text{Res}\left(\frac{1}{z^{1/2}(z^2-1)}, z=-1\right) \\\\
&=2\pi i \frac{1}{-2i}\\\\
&=-\pi\\\\
I&=-\pi/2
\end{align}$$
A: You can use a deformed keyhole contour by providing a semicircular detour of radius $\epsilon$ along each branch.  Then consider
$$\oint_C dz \frac{z^{-1/2}}{z^2-1} $$
where $C$ is the deformed keyhole contour.  Thus, the contour integral is equal to
$$\int_{\epsilon}^{1-\epsilon} dx \frac{x^{-1/2}}{x^2-1} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{(1+\epsilon e^{i \phi})^{-1/2}}{(1+\epsilon e^{i \phi})^2-1}+\int_{1+\epsilon}^R dx \frac{x^{-1/2}}{x^2-1} \\ +i R \int_0^{2 \pi} d\theta \, e^{i \theta} \frac{(1+R e^{i \theta})^{-1/2}}{(1+R e^{i \theta})^2-1} + e^{-i \pi} \int_R^{1+\epsilon} dx \frac{x^{-1/2}}{x^2-1} \\ + i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{(e^{i 2 \pi}+\epsilon e^{i \phi})^{-1/2}}{(e^{i 2 \pi}+\epsilon e^{i \phi})^2-1} + e^{-i \pi} \int_{1-\epsilon}^{\epsilon} dx \frac{x^{-1/2}}{x^2-1} + i \epsilon \int_{2 \pi}^0 d\phi \, e^{i \phi} \frac{\epsilon^{-1/2} e^{-i \phi/2}}{\epsilon^2 e^{i 2 \phi}-1}$$
Note that there eight sections to the contour.  We take the limits as $R \to \infty$ and $\epsilon \to 0$.  As $R \to \infty$, the fourth integral vanishes.  As $\epsilon \to 0$, the eighth integral vanishes.  Also, the second integral is $-i \pi/2$ while the sixth integral is $i \pi/2$.  The first, third, fifth, and seventh integrals sum to twice the principal value of the original integral.  Thus, the contour integral is equal to, in these limits,
$$2 PV \int_0^{\infty} dx \frac{x^{-1/2}}{x^2-1} $$
The contour integral is also equal to $i 2 \pi$ times the residue of the integrand at the pole $z=e^{i \pi}$, so that
$$PV \int_0^{\infty} dx \frac{x^{-1/2}}{x^2-1} = i \pi \frac{e^{-i \pi/2}}{2 (-1)}= -\frac{\pi}{2}$$
A: If you set $y=\sqrt{x}$ you have:
$$\int_0^\infty\frac{2ydy}{y(y^4-1)}=2\int_0^\infty\frac{dy}{y^4-1}$$
Since you are integrating an even function you can write it as:
$$\int_{-\infty}^\infty\frac{dy}{y^4-1}=\int_{-\infty}^\infty\frac{dy}{(y-1)(y+1)(y-i)(y+i)}$$
Now you can easily use contour integration to get:
$$\int_{-\infty}^\infty\frac{dy}{y^4-1}=2i\pi \lim_{y\to i}\frac{y-i}{y^4-1}=-\frac{\pi}{2}$$
Using Sokhotsky-Plemelj theorem twice to get the principal value:
$$\int \frac{f(z)}{(z-z_0)+i\epsilon}dz+i\pi f(z_0)=P\int \frac{f(z)}{(z-z_0)}dz $$
where $z_0=\pm i$. So you should have:
$$\int_0^\infty\frac{dx}{\sqrt{x}(x^2-1)}=\frac{\pi}{2}+i\pi\left(-\frac{i}{4} + \frac{i}{4}\right) = \frac{\pi}{2}$$
Please tell me if I made some mistakes (likely)
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[5px,#ffd]{\mrm{P.V.}\int_{0}^{\infty}{\dd x \over
\root{x}\pars{x^{2} - 1}}} =
\Re\int_{0}^{\infty}{\dd x \over
\root{x}\pars{x - 1 + \ic 0^{+}}\pars{x + 1}}
\\[5mm] = &\
-\,\Re\int_{\infty}^{0}{\ic\,\dd y \over
\root{y}\expo{\ic\pi/4}\pars{\ic y - 1 + \ic 0^{+}}
\pars{\ic y + 1}}
\\[5mm] = &\
-\,\Re\int_{0}^{\infty}{\ic\expo{-\ic\pi/4}\, \over
\root{y}\pars{1 + y^{2}}}\,\dd y =
-\,{\root{2} \over 2}\int_{0}^{\infty}{y^{-1/2} \over
1 + y^{2}}\,\dd y
\\[5mm] = &\
-\,{\root{2} \over 4}\int_{0}^{\infty}{y^{\color{red}{1/4} - 1} \over
1 + y}\,\dd y
\end{align}
Note that $\ds{{1 \over 1 + y} =
\sum_{k = 0}^{\infty}\color{red}{\Gamma\pars{1 + k}}
\,{\pars{-y}^{k} \over k!}}$. With Ramanujan's MT:
\begin{align}
&\bbox[5px,#ffd]{\mrm{P.V.}\int_{0}^{\infty}{\dd x \over
\root{x}\pars{x^{2} - 1}}} =
-\,{\root{2} \over 4}\Gamma\pars{\color{red}{1 \over 4}}
\Gamma\pars{1 - \color{red}{1 \over 4}}
\\[5mm] = &\
-\,{\root{2} \over 4}\,{\pi \over \sin\pars{\pi/4}} =
\bbx{-\,{\pi \over 2}} \\ &
\end{align}
