I am trying to show $\int^\infty_0\frac{\sin(x)}{x}dx=\frac{\pi}{2}$ I am trying to show $\int^\infty_0\frac{\sin(x)}{x}dx=\frac{\pi}{2}$
It was an exercise from a book about complex analysis, so I've gone through the complex plane to do it!
Consider a semi-circle where |z|=R and $0<\arg(z)<\pi$.
consider another, the exact same definition but swap R for $\epsilon$, I want to integrate from -R to $-\epsilon$ over the semi-circle that starts at $-\epsilon$ to $\epsilon$ then along the straight line to R, then from R anti-clockwise back to -R.
I've been given the hint that the integral in the anticlockwise direction is zero, but the clockwise direction (for the $\epsilon$) is -j$\pi$
Here's the problem, my function is: $f(z)=\frac{e^{jz}}{z}$
I've established that f(z)dz = $je^{jz}$ but no amount of playing around has made this expression tolerable.
Because I am considering the integral from 0 to infinity, if I can bound it above somehow by zero I can "sandwich" it between 0 and something that tends to zero.
So far no luck.
 A: Since the integrand is even function, then you can consider
$$ \int^\infty_0\frac{\sin(x)}{x}dx = \frac{1}{2}\int_{-\infty}^\infty \frac{\sin(x)}{x}dx .$$
A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$


*
*
\begin{align}\color{#0000ff}{\large%
\int_{-\infty}^{\infty}{\sin\pars{x} \over x}\,\dd x}
&=
\int_{-\infty}^{\infty}\pars{\half\int_{-1}^{1}\expo{\ic k x}\,\dd k}\,\dd x
\\[5mm] & =
\pi\int_{-1}^{1}\pars{\int_{-\infty}^{\infty}\expo{\ic k x}\,{\dd x \over 2\pi}}
\,\dd k
=
\pi\int_{-1}^{1}\delta\pars{k} = \color{#0000ff}{\Large\pi}
\end{align}

*
\begin{align}
0& =\int_{-R}^{-\epsilon}{\expo{\ic x} \over x}\,\dd x
+
\int_{\pi}^{0}{\expo{\ic\epsilon\expo{\ic\theta}} \over \epsilon\expo{\ic\theta}}\,
\epsilon\expo{\ic\theta}\ic\,\dd\theta 
+
\int_{\epsilon}^{R}{\expo{\ic x} \over x}\,\dd x
+
\int_{0}^{\pi}{\expo{\ic R\expo{\ic\theta}} \over R\expo{\ic\theta}}\,
R\expo{\ic\theta}\ic\,\dd\theta 
\end{align}
With the limit $\epsilon \to 0^{+}$:
\begin{align}
0& =\lim_{\epsilon \to 0^{+}}\pars{\int_{-R}^{-\epsilon}{\expo{\ic x} \over x}\,\dd x
+
\int_{-\epsilon}^{-R}{\expo{-\ic x} \over x}\,\dd x}
-
\ic\pi
\\[2mm] & + \ic\int_{0}^{\pi}\expo{\ic R\expo{\ic\theta}}\,\dd\theta 
\\[3mm]&=
-2\ic\int_{0}^{R}{\sin\pars{x} \over x}\,\dd x -\ic\pi
+
\ic\int_{0}^{\pi}\expo{\ic R\expo{\ic\theta}}\,\dd\theta
\\[5mm]
\color{#0000ff}{\large%
\int_{0}^{\infty}{\sin\pars{x} \over x}\,\dd x} &=
\color{#0000ff}{\large{\pi \over 2}}
+
{1 \over 2}\overbrace{\lim_{R \to \infty}
\int_{0}^{\pi}\expo{\ic R\cos\pars{\theta}}\expo{-R\sin\pars{\theta}}\,\dd\theta}
^{\ds{=\ 0}}
\end{align}
A: Though this is not what you asked for originally, let me offer a a very elegant real variable approach, for a change. I actually wrote an extensive blog post on this, with a few nice graphs, a while ago, so here I'll just give you the bare bones sketch. The argument comes from Introduction to Calculus and Analysis, vol. I, by Richard Courant and Fritz John, Interscience Publishers (1965), reprinted by  Springer (1989).
Note first that $\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\sum_{k=0}^\infty a_k$, where $\displaystyle a_k=\int_{\pi k}^{\pi(k+1)}\frac{\sin x}x\,dx=\int_0^\pi\frac{(-1)^k\sin t}{\pi k +t}\,dt$. This shows that the integral converges, by Leibniz criterion.
Second, note that $\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\lim_{\rho\to\infty}\int_0^{\pi\rho}\frac{\sin x}{x}\,dx=\lim_{\rho\to\infty}\int_0^\pi\frac{\sin(\rho t)}{t}\,dt$.
Third, and this is the key, $\displaystyle \lim_{k\to\infty}\int_0^\pi\sin\left(\left(k+\frac12\right)t\right)\left(\frac1t-\frac1{2\sin(t/2)}\right)\,dt=0$. To see this, let $\displaystyle f(t)=\frac1t-\frac1{2\sin(t/2)}$. Check that $\lim_{t\to0^+}f(t)=0$ and, defining $f(0)=0$, we have that $f'(0)$ exists and equals $-1/24=\lim_{t\to0^+}f'(t)$. It follows that $f$ is continuously differentiable on $[0,\pi]$ so we can integrate by parts to get 
 $$  \int_0^\pi\sin((k+1/2)t)f(t)\,dt=\frac1{k+1/2}\int_0^\pi\cos((k+1/2)t)f'(t)\,dt\to_{k\to\infty}0. $$
It follows that $\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\lim_{k\to\infty}\int_0^\pi\frac{\sin(k+\frac12)x}{2\sin(x/2)}\,dx$.
Fourth, recall the identity $\displaystyle f_k(t)=\frac{\sin(k+\frac12)t}{2\sin(t/2)}$, where  $$ f_k(t)=\frac12+\cos t+\cos(2t)+\dots+\cos(kt). $$ It follows that $\displaystyle \int_0^\pi\frac{\sin(k+\frac12)t}{2\sin(t/2)}\,dt=\int_0^\pi f_k(t)\,dt= \frac{\pi}2$, and we are done.
A: Lastly using the hint above, we finish by saying, $\int_{-\infty}^{\infty}\frac{e^iz}{z-0}dz=Im(2i\pi(Res_{z=0}f(z)))=Im(2i\pi(e^{iz}|_{z=0})) = Im(2i\pi*1)= 2\pi \Rightarrow \int_{0}^{\infty}\frac{e^iz}{z-0}dz=\pi$
We want imaginary since we are  looking at $\sin$. I skipped some detail but I leave it to you to fill in the rest. :)
Specifically: Jordan's lemma to deduce $\int_{c_R}\frac{e^{iz}}{z} dz = 0$
