This refers back to $\int_{-\infty}^\infty \frac{\sin x}{x} \mathrm{d}x = \frac\pi2$ already posted.

How do I arrive at $\frac\pi2$ using the residue theorem?

I'm at the following point: $$\int \frac{e^{iz}}{z} - \int \frac{e^{iz}}{z},$$

and I would appreciate any help.

  • 251
  • 1
  • 2
  • 5
  • It's simpler to use $$\int_{-\infty}^\infty \frac{\sin x}{x}\,dx = \operatorname{Im} p.v. \int_{-\infty}^\infty \frac{e^{ix}}{x}\,dx.$$ – Daniel Fischer Dec 05 '13 at 21:26
  • Any hints/details on how to arrive at pi/2 using the residue theorem? – javier Dec 05 '13 at 21:48
  • 1
    You leave out a small interval $(-\varepsilon,\varepsilon)$ of the real line for the principal value. To apply the residue theorem, you close the hole with a semicircle of radius $\varepsilon$ (your choice whether you take the semicircle in the upper or lower half plane). And you close the entire contour by cutting off at $\pm R$ and adding a large semicircle in the upper half plane, or make it a rectangular contour, doesn't matter. The integral over the large semicircle or the three sides of the rectangle in the upper half plane tend to $0$ for $R\to\infty$ (and, for the rectangle, the height – Daniel Fischer Dec 05 '13 at 21:54
  • also tending to $\infty$). If you chose the small semicircle in the upper half plane, the integral over the closed contour is $0$, since it encloses no pole. So $\int_{\lvert x\rvert \geqslant \varepsilon} \frac{e^{ix}}{x}\,dx = \int_{\lvert z\rvert = \varepsilon, \operatorname{Im} z > 0} \frac{e^{iz}}{z}\,dz$. The latter integral tends, for $\varepsilon \to 0$ to $\pi i \operatorname{Res}\left(\frac{e^{iz}}{z};0\right) = \pi i$, which is the principal value of $\int_{-\infty}^\infty \frac{e^{ix}}{x}\,dx$. Taking the imaginary part, we get $\pi$. To get $\pi/2$, we restrict to $\int_0^\infty$. – Daniel Fischer Dec 05 '13 at 22:01
  • 1
    @DanielFischer: that sizable comment could be easily made into an answer. – robjohn Dec 05 '13 at 23:19
  • 5
    @robjohn "Easily" turned out to be inaccurate. – Daniel Fischer Dec 10 '13 at 21:47
  • https://math.stackexchange.com/questions/5248/evaluating-the-integral-int-0-infty-frac-sin-x-x-dx-frac-pi-2?noredirect=1&lq=1 – Guy Fsone Feb 04 '18 at 11:25

2 Answers2


Since $e^{iz}$ is small in the upper half plane but large in the lower, and $e^{-iz}$ is small in the lower half plane but large in the upper, you cannot handle both terms with the same contour, thus you must separate the two parts, and that means you get a pole in $z = 0$ for the integral. Thus you must treat the pole somehow. One way is to shift the contour of integration away from the real axis like robjohn did. Another way is to treat the integral as a principal value integral.

Since the integrand is real, we have

$$\begin{align} \int_{-\infty}^\infty \frac{\sin x}{x}\,dx &= \operatorname{Im} \operatorname{p.v.} \int_{-\infty}^\infty \frac{e^{ix}}{x}\,dx\\ &= \operatorname{Im} \lim_{\varepsilon\searrow 0} \int_{\lvert x\rvert \geqslant \varepsilon} \frac{e^{ix}}{x}\,dx\\ &= \operatorname{Im} \lim_{\substack{\varepsilon\searrow 0\\ R\nearrow\infty}} \int_{\varepsilon \leqslant \lvert x\rvert \leqslant R} \frac{e^{ix}}{x}\,dx, \end{align}$$

which allows us to consider only one exponential for the sine.

To compute the latter integral, we close the contour by adding a semicircle $C_\varepsilon$ of radius $\varepsilon$ around $0$ in the upper half plane, and either a semicircle of radius $R$ around $0$ in the upper half plane, or three straight line segments connecting $R,R+iR$, $R+iR,-R+iR$ and $-R+iR,-R$ respectively; call the latter contour $C_R$, whichever of the two you choose. Let $C$ be the closed contour obtained from joining the two intervals on the real axis, $C_\varepsilon$ and $C_R$. Since the integrand is holomorphic in a neighbourhood of the region bounded by $C$, Cauchy's integral theorem asserts

$$\int_C \frac{e^{iz}}{z}\,dz = 0,$$

and hence

$$\int_{-\infty}^\infty \frac{\sin x}{x}\,dx = -\operatorname{Im} \lim_{\substack{\varepsilon\searrow 0\\ R\nearrow\infty}} \left(\int_{C_R} \frac{e^{iz}}{z}\,dz + \int_{C_\varepsilon} \frac{e^{iz}}{z}\,dz\right).$$

By Jordan's lemma, or an elementary estimate if we chose the rectangular $C_R$, we have

$$\lim_{R\to\infty} \int_{C_R} \frac{e^{iz}}{z}\,dz = 0.$$

Parametrising $C_\varepsilon$ by $\varepsilon\cdot e^{i(\pi-t)}$, we see

$$\lim_{\varepsilon \searrow 0} \int_{C_\varepsilon} \frac{e^{iz}}{z}\,dz = -\pi ie^{i\cdot 0} = -\pi i,$$

and hence overall

$$\int_{-\infty}^\infty \frac{\sin x}{x}\,dx = \pi.$$

Daniel Fischer
  • 199,211
  • 18
  • 249
  • 374
  • 1
    It's a good proof whether it was easy to convert it. (+1) – robjohn Dec 10 '13 at 22:10
  • Hi @DanielFischer, how does the integration of $e^{\large i(\epsilon e^{i\theta})}$ work? I am stuck with computing the integration on the small semi-circular indent around the origin. Are you (or, can we?) use the Dominated Convergence Theorem, and take the limit inside? Then the integral evaluates to $-i\pi$. Also, how do get $\pi$ as your final answer? Shouldn't we keep the minus sign? The original parametrization, going counterclockwise, gives integration from $\pi \to 0$, so I negated the integral to switch the upper and lower limits. Thanks so much, – User001 Dec 20 '15 at 04:21
  • Oh, sorry, @DanielFischer - I see how you get $\pi$, by moving the $-i\pi$ term over to the R.H.S. in the equation gotten from Cauchy's Theorem. So I would just like to know how you carried out the integration. (I am hoping it is an application of the Dominated Convergence Theorem.) Thanks, – User001 Dec 20 '15 at 04:32
  • 1
    @User001 Yes, we can use the dominated convergence theorem, but that's a bigger thing than needed, the convergence $f_{\varepsilon}(\theta) = \exp(\varepsilon e^{i\theta}) \to 1$ as $\varepsilon \to 0$ is uniform, so it's also unproblematic for the Riemann integral. – Daniel Fischer Dec 20 '15 at 09:21
  • Hi @DanielFischer, thanks for confirming that the dominated convergence theorem is applicable here. However, out of curiosity, I am trying to show the uniform convergence, but can't seem to find an appropriate $\epsilon_0$ (that's possibly dependent on $\delta$), so that for any $\delta>0$, whenever $\epsilon < \epsilon_0$, we have that $|\large e^{i\epsilon e^{i\theta}} - 1| < \delta$. What do you think would be a good choice? Thanks, – User001 Dec 20 '15 at 19:09
  • 1
    @User001 We have $\lvert e^w - 1\rvert \leqslant e^{\lvert w\rvert} - 1$, so since $\lvert i\varepsilon e^{i\theta}\rvert = \varepsilon$, we can choose $\varepsilon_0 = \log (1+\delta)$. – Daniel Fischer Dec 20 '15 at 19:22
  • Ok, got it. Thanks so much, @DanielFischer - have a great day :-) – User001 Dec 20 '15 at 19:38
  • @DanielFischer can you explain me please why the inequality $|e^w-1|\leq e^{|w|}-1$ is true? – Marc Jan 27 '16 at 00:23
  • 2
    @Marc Expand $e^w-1$ into a power series, and apply the triangle inequality: $$\lvert e^w-1\rvert = \Biggl\lvert \sum_{k = 1}^{\infty} \frac{w^k}{k!}\Biggr\rvert \leqslant \sum_{k = 1}^{\infty} \frac{\lvert w\rvert^k}{k!} = e^{\lvert w\rvert} - 1.$$ – Daniel Fischer Jan 27 '16 at 00:26
  • Tried to fill the gap, and I'm stuck with that $\lim_{\varepsilon\searrow0}\int_{C_{\varepsilon}}\frac{e^{iz}}{z}\,dz=\lim_{\varepsilon\searrow0}\int_{0}^{2\pi}\frac{e^{i\varepsilon\cdot e^{i(\pi-t)}}}{\varepsilon\cdot e^{i(\pi-t)}}\,dt,$ I don't know how to integrate this. Tried to set the parameterization. – hash man Aug 02 '20 at 15:52
  • 1
    @hashman Minor point: The integral limit should be $\pi$, not $2\pi$. Major point: When you parametrise the contour via $\gamma(t)$, then you must replace $dz$ with $\gamma'(t)\,dt$. Here $\gamma'(t) = -i\cdot \gamma(t)$, so the denominator is cancelled. What remains is $-i\int_0^{\pi} e^{i\varepsilon \exp(i(\pi - t))}\,dt$, and while that isn't easy to integrate either, the limit as $\varepsilon \to 0$ is easy by uniform convergence. – Daniel Fischer Aug 02 '20 at 15:59
  • @DanielFischer How do we know that $\int_{-\infty}^{\infty} \frac{\sin x}{x} dx = Im( p.v. \int_{-\infty}^{\infty} \frac{e^{ix}}{x} dx)$? It is clear to me that the imaginary part leaves only the $sin(x)$. I am asking how we know that in this case the result is equal to the p.v. of the integral? Intuitively, I guess it makes sense, since the p.v. only ignores the origin, and we know that the origin shouldn't contribute since $sin z / z = 1$ at $z=0$. But is there a more legitimate justification? – doublefelix Apr 21 '21 at 02:13

Before we use $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$, we should move the contour so that it does not cross the origin. One way to do this is to use the contour $$ [-R,R]\cup\color{#C0C0C0}{[R,R-i]}\cup[R-i,-R-i]\cup\color{#C0C0C0}{[-R-i,-R]} $$ and notice that since $\frac{\sin(x)}{x}$ has no poles, the integral along the contour is $0$. Furthermore, the integral along the grayed out pieces tend to $0$ as the integrand is $\sim\frac1R$ along a length of $1$. This tells us that $$ \int_{-\infty}^\infty\frac{\sin(x)}{x}\,\mathrm{d}x =\int_{-\infty-i}^{\infty-i}\frac{\sin(x)}{x}\,\mathrm{d}x $$ Now, we can use $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$. We will use the contours $$ U=[-R-i,R-i]\cup Re^{[0,i\pi]}-i $$ and $$ L=[-R-i,R-i]\cup Re^{[0,-i\pi]}-i $$ Since the integrands vanish quickly on the circular parts, we get $$ \begin{align} \int_{-\infty}^\infty\frac{\sin(x)}{x}\,\mathrm{d}x &=\frac1{2i}\int_U\frac{e^{iz}}{z}\,\mathrm{d}z-\frac1{2i}\int_L\frac{e^{-iz}}{z}\,\mathrm{d}z\\ &=\frac1{2i}2\pi i-\frac1{2i}0\\[9pt] &=\pi \end{align} $$ Since $U$ circles the pole at $0$ with residue $1$ once counterclockwise, and $L$ contains no poles.

Since $\frac{\sin(x)}{x}$ is an even function, we get $$ \begin{align} \int_0^\infty\frac{\sin(x)}{x}\,\mathrm{d}x &=\frac12\int_{-\infty}^\infty\frac{\sin(x)}{x}\,\mathrm{d}x\\ &=\frac\pi2 \end{align} $$

  • 326,069
  • 34
  • 421
  • 800
  • An interesting case of a function which is not in $L^1(\mathbb R)$, but the improper Riemann integral is defined! – Yiorgos S. Smyrlis Dec 10 '13 at 21:49
  • Can you explain why we have $\int_{-\infty}^\infty\frac{\sin(x)}{x}\,\mathrm{d}x =\frac1{2i}\int_U\frac{e^{iz}}{z}\,\mathrm{d}z-\frac1{2i}\int_L\frac{e^{-iz}}{z}\,\mathrm{d}z$? – principal-ideal-domain Sep 02 '15 at 12:18
  • [Euler's Formula](https://en.wikipedia.org/wiki/Euler%27s_formula) implies $$\begin{align}\int_{-\infty-i}^{\infty-i}\frac{\sin(z)}z\,\mathrm{d}z &=\frac1{2i}\int_{-\infty-i}^{\infty-i}\frac{e^{iz}-e^{-iz}}z\,\mathrm{d}z\\ &=\frac1{2i}\int_{-\infty-i}^{\infty-i}\frac{e^{iz}}z\,\mathrm{d}z -\frac1{2i}\int_{-\infty-i}^{\infty-i}\frac{e^{-iz}}z\,\mathrm{d}z\end{align}$$ Then we include the large semicircular contours to close each contour; one in the upper half-plane for the first, since $e^{iz}$ decays quickly there, and the lower half-plane for the second, since $e^{-iz}$ decays quickly there. – robjohn Sep 02 '15 at 17:30
  • You say we should move the contour so that it does not cross the origin. But the contour you chose does cross the origin in the segment $[-R,R]$, doesn't it? – Breaking Mad Feb 24 '16 at 12:54
  • @M_a_t: no, the bottom of $U$ and the top of $L$ are the line $[-R-i,R-i]$. – robjohn Feb 24 '16 at 13:27
  • Why should it not cross origin – A plate of momos Aug 29 '20 at 14:43
  • @Buraian: Note that the integrand is split into two parts: $$\frac1{2i}\int_{-\infty-i}^{\infty-i}\frac{e^{iz}}z\,\mathrm{d}z -\frac1{2i}\int_{-\infty-i}^{\infty-i}\frac{e^{-iz}}z\,\mathrm{d}z$$ What happens if the contour crosses the origin? – robjohn Aug 29 '20 at 18:36