Residues at singularities I have the following question:  Show that the integral
$$\int_{-\infty}^{+\infty}\frac{\cos\pi x}{2x-1}dx = -\frac\pi2$$
Clearly there is a singularity at $z=1/2$ but I think this is a removable singularity so it has $0$ residue. Is this right or have I missed another singularity? If I am right, could someone help me to proceed with this question please because I'm not sure how to.
Thanks

You are correct that $\frac{\cos(\pi x)}{2x-1}$ is entire (i.e. has no singularities). However, if you try to use this function with the Residue Theorem on either of the usual arbitrarily large "D" shaped contours, you will see that $\frac{\cos(\pi x)}{2x-1}$ blows up on the semi-circular part of the contour.
We can over come this problem as follows. First note that by using the contour
$$
[-R,R]\cup\color{#C0C0C0}{[R,R{-}i]}\cup[R{-}i,-R{-}i]\cup\color{#C0C0C0}{[-R{-}i,-R]}
$$
we get
$$
\int_{-\infty}^\infty\frac{\cos(\pi x)}{2x-1}\,\mathrm{d}x
=\int_{-i-\infty}^{-i+\infty}\frac{\cos(\pi x)}{2x-1}\,\mathrm{d}x
$$
since the integrand vanishes on the gray portions of the contour as $R\to\infty$.
Next, break up $\cos(x)$ and use the contours
$$
\begin{align}
U&=[-R{-}i,R{-}i]\cup Re^{[0,\pi i]}{-}i\\
L&=[-R{-}i,R{-}i]\cup Re^{[0,-\pi i]}{-}i
\end{align}
$$
to get
$$
\begin{align}
\int_{-i-\infty}^{-i+\infty}\frac{\cos(\pi x)}{2x-1}\,\mathrm{d}x
&=\frac12\int_{-i-\infty}^{-i+\infty}\frac{e^{i\pi x}+e^{-i\pi x}}{2x-1}\,\mathrm{d}x\\
&=\frac12\int_U\frac{e^{i\pi x}}{2x-1}\,\mathrm{d}x
+\frac12\int_L\frac{e^{-i\pi x}}{2x-1}\,\mathrm{d}x\\
&=\frac12(2\pi i)\frac i2+0\\
&=-\frac\pi2
\end{align}
$$
since $\frac{e^{i\pi x}}{2x-1}$ has a pole at $x=\frac12$ with residue $\frac i2$ inside $U$ and $\frac{e^{-i\pi x}}{2x-1}$ has no pole inside $L$.
Note that $\frac{e^{i\pi x}}{2x-1}$ vanishes quickly on the circular part of $U$ and $\frac{e^{-i\pi x}}{2x-1}$ vanishes quickly on the circular part of $L$.
