Using residue theory to evaluate $ \int_0^\infty \frac{ \sin \pi x}{x(1-x^2)} \;\text{ dx}$ I'm on the last question of my homework and it's involving using the residue theory, which I dont really understand, so could somebody lend me a hand?
I have to evaluate the real convergent improper integral below using residue theory:
$$ \int_0^\infty \frac{ \sin\left(\pi x\right)}{x\left(1-x^2\right)} \; \textrm{d}x$$
 A: Note that the integrand is an even function of $x$, so we will compute the integral of half the integrand over the whole real line.
Using partial fractions, we get
$$
\frac{1/2}{x(1-x^2)}=\frac{1/2}{x}+\frac{1/4}{1-x}-\frac{1/4}{1+x}
$$
Since the singularities are removable, we can use the contour $\gamma$ from $-\infty-i\epsilon$ to $+\infty-i\epsilon$ instead of $\mathbb{R}$. The key step is to break up the integral into two along two closed contours


*

*$\gamma_+$ which goes from $-N-\frac iN$ to $+N-\frac iN$ then counterclockwise around the semicircle centered at $-\frac iN$ from $+N-\frac iN$ back to $-N-\frac iN$

*$\gamma_-$ which goes from $-N-\frac iN$ to $+N-\frac iN$ then clockwise around the semicircle centered at $-\frac iN$ from $+N-\frac iN$ back to $-N-\frac iN$
$$
\frac{1}{2i}\oint_{\gamma_+}\left(\frac{1/2}{z}+\frac{1/4}{1-z}-\frac{1/4}{1+z}\right)e^{i\pi z}\mathrm{d}z-\frac{1}{2i}\oint_{\gamma_-}\left(\frac{1/2}{z}+\frac{1/4}{1-z}-\frac{1/4}{1+z}\right)e^{-i\pi z}\mathrm{d}z
$$
As $N\to\infty$, the contribution from the semi-circular parts vanishes and we are left with the integral along $\gamma$ of $\frac{1/2}{x(1-x^2)}\sin(\pi x)=\frac{1/2}{x(1-x^2)}\dfrac{e^{i\pi x}-e^{-i\pi x}}{2i}$.
There are no singularities inside $\gamma_-$, so that integral is $0$. Thus, the whole integral boils down to
$$
\frac{1}{2i}\oint_{\gamma_+}\left(\frac{1/2}{z}+\frac{1/4}{1-z}-\frac{1/4}{1+z}\right)e^{i\pi z}\mathrm{d}z
$$
Summing up the residues at $-1,0,\text{and }1$ yields $\dfrac{1}{4i}2\pi i+\dfrac{1}{8i}2\pi i+\dfrac{1}{8i}2\pi i=\pi$.
Thus,
$$
\int_0^\infty\frac{\sin(\pi x)}{x(1-x^2)}\mathrm{d}x=\pi
$$
A: This approach doesn't uses residue theory, but may be it will fit your needs. Since $f(x)=\frac{\sin\pi x}{x(1-x^2)}$ is even then 
$$
\int\limits_{\mathbb{R}_+}f(x)dx=
\frac{1}{2}\int\limits_{\mathbb{R}}f(x)dx=
\frac{1}{2}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x(1-x^2)}dx=
$$
$$
\frac{1}{2}\int\limits_{\mathbb{R}}\sin\pi x\left(\frac{1}{x}-\frac{1}{2(x-1)}-\frac{1}{2(x+1)}\right)dx=
$$
$$
\frac{1}{2}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx-
\frac{1}{4}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x-1}dx-
\frac{1}{4}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x+1}dx=
$$
Note that
$$
\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x-1}dx=\{t=x-1\}=
\int\limits_{\mathbb{R}}\frac{\sin\pi (t+1)}{t}dt=
-\int\limits_{\mathbb{R}}\frac{\sin\pi t}{t}dt=
-\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx
$$
Similarly,
$$
\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x+1}dx=
\{t=x+1\}=
\int\limits_{\mathbb{R}}\frac{\sin\pi (t-1)}{t}dt=
-\int\limits_{\mathbb{R}}\frac{\sin\pi t}{t}dt=
-\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx
$$
Thus, we have
$$
\int\limits_{\mathbb{R}_+}f(x)dx=
\frac{1}{2}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx-
\frac{1}{4}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x-1}dx-
\frac{1}{4}\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x+1}dx=
\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx
$$
The last integral reduces to so called Dirichlet integral
$$
\int\limits_{\mathbb{R}}\frac{\sin\pi x}{x}dx=
\{t=\pi x\}=
\int\limits_{\mathbb{R}}\frac{\sin t}{t}dt=\pi
$$
A: $$f(z) = \frac{e^{\pi iz}}{z(1-z^2)}$$
Integrating along $C$, a large semicicle in the half plane, indented around $0$ and $\pm 1$, we have
$$0=\oint_C f(z)\, dz = P.V.\int_{-\infty}^\infty f(z)\, dz-i \pi\operatorname*{Res}_{z=0}f-i \pi\operatorname*{Res}_{z=1}f-i \pi\operatorname*{Res}_{z=-1}f\tag{1}$$
Trivially,
$$\operatorname*{Res}_{z=0}f = 1$$
$$\operatorname*{Res}_{z=-1}f = \frac 12$$
$$\operatorname*{Res}_{z=1}f = \frac 1 2$$
thus, taking the real part of $(1)$ and dividing by 2:
$$\int_0^\infty \frac{\sin (\pi x)}{x(1-x^2)}\,dx=\pi$$
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{\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]{\int_{0}^{\infty}{\sin\pars{\pi x} \over x\pars{1 -x^{2}}}\,\dd x}
\\[5mm] = &\
{1 \over 2}\int_{0}^{\infty}{\sin\pars{\pi x} \over
x\pars{1 - x}}\,\dd x +
{1 \over 2}\int_{0}^{\infty}{\sin\pars{\pi x} \over
x\pars{1 + x}}\,\dd x
\end{align}
Sets $\ds{x \mapsto -x}$ in the RHS second integral:
\begin{align}
&\bbox[5px,#ffd]{\int_{0}^{\infty}{\sin\pars{\pi x} \over x\pars{1 -x^{2}}}\,\dd x} =
{1 \over 2}\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
x\pars{1 - x}}\,\dd x
\\[5mm] = &\
{1 \over 2}\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
x}\,\dd x +
{1 \over 2}\
\underbrace{\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
1 - x}\,\dd x}_{\ds{x \mapsto x + 1}}
\\[5mm] = &\
{1 \over 2}\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
x}\,\dd x +
{1 \over 2}\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
x}\,\dd x
\\[5mm] = &\
\int_{-\infty}^{\infty}{\sin\pars{\pi x} \over
x}\,\dd x  = \int_{-\infty}^{\infty}{\sin\pars{x} \over
x}\,\dd x = \bbx{\pi} \approx 3.1416 \\ &
\end{align}
