# Solving the integral $\int_{0}^{\infty} \frac{\sin{x}}{x} \ dx = \frac{\pi}{2}$?

A famous exercise which one encounters while doing Complex Analysis (Residue theory) is to prove that the given integral: $$\int_{0}^{\infty} \frac{\sin{x}}{x} \ dx = \frac{\pi}{2}$$

Well, can anyone prove this without using Residue theory. I actually thought of doing this: $$\int_{0}^{\infty} \frac{\sin{x}}{x} \ dx = \lim_{t \to \infty} \int_{0}^{t} \frac{1}{t} \Bigl( t - \frac{t^3}{3!} + \frac{t^5}{5!} + \cdots \Bigr) \ dt$$ but I don't see how $\pi$ comes here, since we need the answer to be equal to $\frac{\pi}{2}$.

-
Shouldn't it be $\mathrm{d}t$ in the last integral? – Dario Sep 22 '10 at 19:58
yup edited thanks for pointing out – anonymous Sep 22 '10 at 20:12
note that from $\int\limits_0^\infty \frac{\sin(x)}{x}dx=\frac{\pi}{2}$, we can get $\int_0^\infty\frac{\sin(x^n)}{x}dx=\frac{\pi}{2n}$ by a simple change of variables – user49084 Nov 12 '12 at 2:04

Here's another way of finishing off Derek's argument. He proves $$\int_0^{\pi/2}\frac{\sin(2n+1)x}{\sin x}dx=\frac\pi2.$$ Let $$I_n=\int_0^{\pi/2}\frac{\sin(2n+1)x}{x}dx= \int_0^{(2n+1)\pi/2}\frac{\sin x}{x}dx.$$ Let $$D_n=\frac\pi2-I_n=\int_0^{\pi/2}f(x)\sin(2n+1)x\ dx$$ where $$f(x)=\frac1{\sin x}-\frac1x.$$ We need the fact that if we define $f(0)=0$ then $f$ has a continuous derivative on the interval $[0,\pi/2]$. Integration by parts yields $$D_n=\frac1{2n+1}\int_0^{\pi/2}f'(x)\cos(2n+1)x\ dx=O(1/n).$$ Hence $I_n\to\pi/2$ and we conclude that $$\int_0^\infty\frac{\sin x}{x}dx=\lim_{n\to\infty}I_n=\frac\pi2.$$

-
 That was quick! I got tired of typing. – Derek Jennings Sep 23 '10 at 18:22

I believe this can also be solved using double integrals.

It is possible (if I remember correctly) to justify switching the order of integration to give the equality:

$$\int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dy \Bigg)\, dx = \int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dx \Bigg)\,dy$$ Notice that $$\int_{0}^{\infty} e^{-xy} \sin x\,dy = \frac{\sin x}{x}$$

$$\int_{0}^{\infty} \Big(\frac{\sin x}{x} \Big) \,dx = \int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dx \Bigg)\,dy$$ Now the right hand side can be found easily, using integration by parts.

\begin{align*} I &= \int e^{-xy} \sin x \,dx = -e^{-xy}{\cos x} - y \int e^{-xy} \cos x \, dx\\ &= -e^{-xy}{\cos x} - y \Big(e^{-xy}\sin x + y \int e^{-xy} \sin x \,dx \Big)\\ &= \frac{ye^{-xy}\sin x - e^{-xy}\cos x}{1+y^2}. \end{align*} Thus $$\int_{0}^{\infty} e^{-xy} \sin x \,dx = \frac{1}{1+y^2}$$ Thus $$\int_{0}^{\infty} \Big(\frac{\sin x}{x} \Big) \,dx = \int_{0}^{\infty}\frac{1}{1+y^2}\,dy = \frac{\pi}{2}.$$

-
+1 for this solution unknown to me. – Américo Tavares Sep 23 '10 at 16:16
@Americo: I heard of this one a long time back from one of my teachers. I thought this will be well known, but I guess I could be mistaken about that. – Aryabhata Sep 23 '10 at 16:26
I believe this idea shows up in Melzak's Companion to Concrete Mathematics; I know he has a small stack of 'clever' ideas for integrals and I'm pretty sure this is one of them. – Steven Stadnicki Sep 24 '10 at 21:57
This is also the technique used in R. Durrett (2005), Probability theory and examples, 3rd ed., Duxbury, p. 470. It is Exercise 6.6 on that page. The justification of exchanging the order of integration actually comes from considering the strip $(0,a) \times (0,\infty)$ and observing that $\int_0^a \int_0^\infty |e^{-xy} \sin x| \,\mathrm{d} y\,\mathrm{d} x \leq a$, from whence Fubini's theorem can be applied. To get the result, we take $a \to \infty$. – cardinal Sep 18 '11 at 12:09
this methods is elegant,and I computer the integral $\int e^{-xy}\sin x \text{dx}$: \begin{align*} I &= \int e^{-xy} \sin x \,dx = -e^{-xy}{\cos x} - y \int e^{-xy} \cos x \, dx\\ &= -e^{-xy}{\cos x} - y \Big(e^{-xy}\sin x + y \int e^{-xy} \sin x \,dx \Big) \end{align*} – Vincent Gilmore Feb 4 at 8:30

Here is a sketch of another elementary solution based on a proof in Bromwich's Theory of Infinite Series.

Using $\sin(2k+1)x-\sin(2k-1)x = 2\cos2kx\sin x$ and summing from k=1 to k=n we have $$\sin(2n+1)x = \sin x \left( 1+ 2 \sum_{k=1}^n \cos 2kx \right),$$

and hence $$\int_0^{\pi/2} {\sin(2n+1)x \over \sin x} dx = \pi/2. \qquad (1)$$

Let $y=(2n+1)x$ and this becomes $$\int_0^{(2n+1)\pi/2} {\sin y \over (2n+1) \sin (y/(2n+1))} dy = \pi/2.$$

and since $\lim_{n \to \infty} (2n+1) \sin { y \over 2n+1} = y$ it suggests that there is a proof lurking in there somewhere.

So let's put \begin{align} I_n &= \int_0^{n\pi/(2n+1)} {\sin(2n+1)x \over \sin x} dx \ &= \sum_{k=0}^{n-1} \int_{k\pi/(2n+1)}^{(k+1)\pi/(2n+1)} {\sin(2n+1)x \over \sin x} dx. \end{align}

Hence we have $I_n = u_0 – u_1 + u_2 \cdots + (-1)^{n-1}u_{n-1},$ where $u_k$ is a decreasing sequence of positive terms. We can see this from the shape of the curve $y = \sin(2n+1)x / \sin x,$ which crosses the x-axis at $\pi/(2n+1), 2\pi/(2n+1),\ldots,n\pi/(2n+1).$ (I said that this is just a sketch, you have to check the details.)

Hence the sequence $I_n$ converges, and by (1) it converges to $\pi/2.$

Now if we make the substitution $y=(2n+1)x$ we see that $$u_k = \int_{k\pi}^{(k+1)\pi} {\sin y \over (2n+1) \sin (y/(2n+1))} dy,$$

and since $I_n$ can be written as an alternating sequence of decreasing positive terms we can truncate the sequence wherever we like and the value of $I_n$ lies between two successive partial summations. Hence

$$\int_{0}^{2m\pi} {\sin y \over (2n+1) \sin (y/(2n+1))} dy < I_n < \int_{0}^{(2m+1)\pi} {\sin y \over (2n+1) \sin (y/(2n+1))} dy. \qquad (2)$$

for any m such that $2m+1 \le n.$ (Take $m=[\sqrt{n}],$ say, $n \ge 6.$)

Now $$\left| { \sin y \over y} - {\sin y \over (2n+1) \sin(y/(2n+1))} \right| < { \pi^2(2m+1)^2 \over 3(2n+1)^2}$$ and so this difference tends to zero uniformly in the interval $0 \le y \le (2m+1)\pi$ and so by taking the $\lim_{n \to \infty}$ in (2) we obtain $$\int_0^{\infty} { \sin x \over x } dx = { \pi \over 2}.$$

-

Here's one more, just for the fun of it. For $\theta$ not an integer multiple of $2 \pi$, we have $$\sum \frac{e^{i n \theta}}{n} = -\log(1-e^{i \theta}).$$ Taking imaginary parts, for $0 < \theta < \pi$, we have $$\sum \frac{\sin (n \theta)}{n} = -\mathrm{arg}(1-e^{i \theta}) = \pi/2-\frac{\theta}{2}.$$ Draw the isosceles triangle with vertices at $0$, $1$ and $e^{i \theta}$ to see the second equality.

So $\displaystyle \sum \theta \cdot \frac{\sin (n \theta)}{n \theta} = \pi/2+\frac{\theta}{2}$. The right hand side is a right-hand Riemann sum for $\int \frac{\sin t}{t} dt$, with intervals of width $\theta$. So, taking the limit as $\theta \to 0$, we get $$\int\limits_0^\infty \frac{\sin t}{t} dt=\frac{\pi}{2}$$.

-

Maybe I'm flogging a dead horse, but nobody has mentioned the standard suspiciously circular (see the comments) Fourier analytic proof yet:

Let $f(t)=1$ for $|t|<1$ and 0 otherwise. Then the Fourier transform is $$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-i\omega t} dt = \int_{-1}^{1} e^{-i\omega t} dt = \frac{e^{-i\omega} - e^{i\omega}}{-i\omega} = \frac{2\sin\omega}{\omega}.$$

Fourier's inversion formula states that $$f(t) = \frac{1}{2\pi} \int_{-\infty}^{\infty} F(\omega) e^{i\omega t} d\omega$$ if $f$ is (say) differentiable at $t$. In our case, we get in particular that $$1 = f(0) = \frac{1}{2\pi} \int_{-\infty}^{\infty} F(\omega) d\omega = \frac{1}{2\pi} \int_{-\infty}^{\infty} \frac{2\sin\omega}{\omega} d\omega = \frac{2}{\pi} \int_{0}^{\infty} \frac{\sin\omega}{\omega} d\omega.$$

(EDIT: Even if this is not really a proof, it's still a good thing to be aware of, since one can use similar ideas to integrate powers of $\sin\omega/\omega$, or integrals like these.)

-
Often proofs of the Fourier inversion theorem use the value of the sine integral. Certainly the one I learned as an undergraduate did. To me this is reminiscent of the argument that $\lim_{x\to0}(\sin x)/x=1$ by L'Hopital's rule :-( – Robin Chapman Oct 13 '10 at 10:14
@Robin Chapman: Hmm, that's true. Very good point. Maybe that's why nobody gave this answer! PS. You need to get rid of the reflex to hit the Return key before you're done writing your comments. :) – Hans Lundmark Oct 13 '10 at 10:33
+1, because posts like these make me want to properly learn fourier analysis as soon as possible. Ps. the proof of the inversion formula in Rudin's book doesn't get anywhere near of making use of the value in this integral, as far as I can remeber. – Sam Apr 22 '11 at 14:00
@Sam: Thanks. So Rudin saves my bacon, then! :) – Hans Lundmark Apr 22 '11 at 17:14

See http://en.wikipedia.org/wiki/Dirichlet_integral for a proof using differentiation under the integral sign.

-
 en.wikipedia.org/wiki/Trigonometric_integral#Expansion is also interesting. – Rasmus Sep 22 '10 at 19:20

Let's consider the integrals
$$I_1(t)=\int_t^{\infty}\frac{\sin(x-t)}{x}dx\qquad\mbox{ and }\qquad I_2(t)=\int_0^{\infty}\frac{e^{-tx}}{1+x^2}dx,\qquad t\geq 0.$$ A direct calculation shows that $I_1(t)$ and $I_2(t)$ satisfy the ordinary differential equation $$y''+y=\frac{1}{t},\qquad t>0.$$ Therefore, the difference $I(t)=I_1(t)-I_2(t)$ satisfy the homogeneous differential equation $$y''+y=0,\qquad t>0,$$ hence it should be of the form $$I(t)=A\sin (t+B)$$ with some constants $A$, $B$. But $I_1(t)$ and $I_2(t)$ both converge to $0$ as $t\to\infty$. This implies that $A=0$ and $I_1(t)=I_2(t)$ for all $t\geq 0$. Finally, we have that $$\int_0^{\infty}\frac{\sin x}{x}dx=\int_{0}^{\infty}\frac{1}{1+x^2}dx=\arctan(\infty)-\arctan(0)=\frac{\pi}{2}.$$

-
 Where does $I_2$ come from? – Ｊ. M. Oct 30 '10 at 14:09 @ J.M.: I think one could arrive at the idea by inspecting the integral $I$ which appears in Moron's solution. – Andrey Rekalo Oct 30 '10 at 14:30

In my Advanced Calculus book (Angus Taylor) it is shown that, if $a\gt 0$,

$\displaystyle\int_0^{\infty}\dfrac{e^{-at}\sin xt}{t}dt=\arctan\dfrac{x}{a}\qquad (1)$

If $x>0$,

$\displaystyle\int_0^{\infty}\dfrac{\sin xt}{t}dt=\dfrac{\pi}{2}\qquad (2)$

follows from $(1)$, observing that the integrand is $G(0)$ for

$G(a)=\displaystyle\int_0^{\infty}\dfrac{e^{-at}\sin xt}{t}dt\qquad (3)$,

$G$ is uniformly convergent when $a\ge 0$, and $G(a)$ approaches $G(0)$ as $a$ tends to $0^+$.

Answer to Qiaochu: $(1)$ is proved as an application of the following theorem to $F(x)=\displaystyle\int_0^{\infty}\dfrac{e^{-at}\sin xt}{t}dt$:

"Let $F(x)=\displaystyle\int_c^{\infty}f(t,x)dt$

be convergent when $a\le x\le b$. Let $\dfrac{\partial f}{\partial x}$ be continuous in $t,x$ for $c\lt t$,$a\lt x\lt b$, and let $\displaystyle\int_c^{\infty}\dfrac{\partial f}{\partial x}dt$ converge uniformly on $[a,b]$. Then $F'(x)=\displaystyle\int_c^{\infty}\dfrac{\partial f}{\partial x}dt$".

PS. It was a surprise to me to see the evaluation of $F(x)=\displaystyle\int_0^{\infty}\dfrac{e^{-at}\sin xt}{t}dt$:

$F(x)=\dfrac{\pi}{2}\qquad$ if $x>0$,

$F(x)=-\dfrac{\pi}{2}\qquad$ if $x<0$,

$F(x)=0\qquad\qquad$ if $x=0$.

-
Yes, but how is 1) proven? – Qiaochu Yuan Sep 22 '10 at 20:15
@Qiaochu Yuan: Agree, but it is contained in en.wikipedia.org/wiki/Dirichlet_integral too. :) – AD. Sep 22 '10 at 20:34
@Qiaochu Yuan: I deleted my original comment due to some errors and incorporated it in my answer. – Américo Tavares Sep 22 '10 at 20:42
yes, that is the same method Rasmus describes. – Qiaochu Yuan Sep 22 '10 at 20:52
@Qiaochu Yuan: OK. – Américo Tavares Sep 22 '10 at 21:00

These proofs looked very intriguing the multiple ways to go about the same problem. I looked up toward the ceiling and then it dawned on me that there was another way to do this with this particular function as follows:

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$The method of attack of use would be Laplace Transforms

$$f(t)=\dfrac{\sin(t)}{t}$$

$$\lim_{t \to 0} ~ \dfrac{f(t)}{t} ~;~ \text{exist and is a finite number.}$$

$~~~~~\cal{L} \left\{ \dfrac{\sin(t)}{t} \right\}=\displaystyle\int_0^{\infty} \! \cal{L} \left\{ \sin(t) \right\} ~ \mathrm{d} \sigma=\int_0^{\infty}\! \dfrac{1}{\sigma^{2}+1} \mathrm{d} \sigma=\tan^{-1}(\sigma) ~ {\LARGE|_{\sigma=0}^{\sigma=\infty}}=\frac{\pi}{2}-$ arctan($0$)

So we see that we get the result of: $\dfrac{\pi}{2}~~~$ $\Big(\because~$arctan($0)=0 ~\Big)$.

-

This one I found in The American Mathematical Monthly from 1951 in the article 'A simple evaluation of an improper integral' written by Waclaw Kozakiewicz.

Theorem (Riemann). If $f(x)$ is Riemann integrable in the interval $a \leq x \leq b$, then: $$\lim_{k \to +\infty} \int_a^b f(x) \sin kx \; dx = 0 \;.$$

Next, notice that: $$\int_0^\pi \frac{\sin \left(n+\frac{1}{2}\right)\pi}{2 \sin \frac{x}{2}}\; dx = \frac{\pi}{2} \; ,n = 0,1,2,\ldots \quad (1)$$ and let: $$\phi(x) = \begin{cases} 0 & , \;x = 0 \\ \frac{1}{x} - \frac{1}{2 \sin \frac{x}{2}} =\frac{2 \sin \frac{x}{2} - x}{2x \sin \frac{x}{2}} & ,\; 0 < x \leq \pi \; . \end{cases}$$ Then $\phi(x)$ is continuous and satisfies Riemann theorem, so choosing $k = n + \frac{1}{2}$ we write: $$\lim_{n \to +\infty}\int_0^{\pi} \left(\frac{1}{x} - \frac{1}{2 \sin \frac{x}{2}} \right) \sin \left(n+\frac{1}{2}\right)x \; dx = 0 \;.$$ But taking $(1)$ into account we have: $$\lim_{n \to +\infty} \int_0^\pi \frac{\sin \left(n+\frac{1}{2}\right)x}{x} \; dx = \frac{\pi}{2}\;.$$ Using substitution $u = \left(n+\frac{1}{2}\right)x$ and knowing that $\int_0^{+\infty} \frac{\sin x}{x} \; dx$ converges we finally have:

$$\int_0^{+\infty} \frac{\sin x}{x} \; dx = \lim_{n \to +\infty} \int_0^{\left(n+\frac{1}{2}\right)\pi}\frac{\sin u}{u} \; du = \frac{\pi}{2}\;.$$

-
 This is also as an exercise in Stein and Shakarchi. – BenjaLim Aug 27 '12 at 13:36

Another iteration of this question came up, and I have an answer that isn't currently here. So I present yet another solution.

We want to show that $\int_{0} ^{\infty} \frac{\sin x }{x} \mathrm{d}x = \pi/2.$

First, let's show that it converges. We let $I_{ab} = \int_a^b \frac{\sin x}{x}$, and consider the limits $a \to 0, b \to \infty$. $a \to 0$ is easy, so we don't worry about it. $\frac{\sin x}{x}$ is continuous on this domain, so all we really want is for the upper limit to behave nicely.

Note that $I_{ab} = \int \frac{\sin x}{x} = \int \frac{1}{x} \frac{\mathrm{d} (1 - \cos x)}{\mathrm{d} x}$, and so we can use integration by parts. We then get

$$I_{ab} = \frac{1 - \cos b}{b} - \frac{1 - \cos a}{a} + \int_a^b \frac{1 - \cos x}{x^2}$$

This clearly converges. In fact, one can see that both $\cos$ terms disappear in the limit. It's more important to simply note that the integral converges.

Knowing that, we continue the trend of the other answers and show that $\displaystyle \int_0^{\pi/2}\frac{\sin(2n+1)x}{\sin x}dx=\frac\pi2$

We show the following: $$1 + 2 \cos 2t + 2 \cos 4t + \ldots + 2 \cos 2nt = \frac{\sin(2n + 1)t}{\sin t}$$

We do this with $\sin a - \sin b = 2 \sin(\frac{a-b}{2}) \cos(\frac{a + b}{2})$, so that we also get $\sin(2k + 1)t - \sin(2k -1)t = 2\sin(t) \cos (2kt)$. Thus $1 + 2 \cos 2t + \ldots + 2 \cos 2nt = 1 + \frac{1}{\sin t} \left[ \sum \sin(2k+1)t - \sin(sk-1)t \right]$

$\phantom{1 + 2 \cos 2t + \ldots + 2 \cos 2nt} = 1 + \frac{1}{\sin t} [\sin(2n + 1)t - \sin t]$

$\phantom{1 + 2 \cos 2t + \ldots + 2 \cos 2nt} = \frac{\sin(2n + 1)t}{\sin t}$

We did this just so that we could then say that

$$\int_0^{\pi/2} \frac{\sin (2n + 1)t}{\sin t} = \int_0 ^{\pi /2} (1 + 2 \cos 2t + 2 \cos 4t + \ldots + 2 \cos 2nt) =$$

$$\phantom{\frac{\sin (2n + 1)t}{\sin t}} = \frac{\pi}{2} + \left[ \sin 2t + \frac{\sin 4t}{2} + \ldots + \frac{\sin 2nt }{n}\right]_0^{\pi/2} = \frac{\pi}{2}$$

And thus we have it.

-
You really helped me with this. I'm a math freshman and currently have only studied basic academic math courses. This really helped me proof this for my homework. :) – Ory Band May 5 '12 at 16:02

I'd add here the Feynman way, a very powerful, elegant and fast method to work out such things. You find here the example from $-\infty$ to $\infty$, but since the integrand is even, by dividing the result by 2 we get our required result.

-

We can decompose interval $[0,+\infty)$ into intervals of length $\frac{\pi}{2}$. Then we'll have:

$$I = \int_0^{+\infty} \frac{\sin x}{x} \,dx = \sum_{n=0}^{+\infty} \int_{n\pi / 2}^{(n+1)\pi / 2} \frac{\sin x}{x} \,dx$$ Now consider the case when $n$ is even i.e. $n=2k$ and substitute $x = k\pi + t$:

$$\int_{2k\pi /2}^{(2k+1)\pi / 2} \frac{\sin x}{x} \,dx = (-1)^k \int_0^{\pi/ 2} \frac{\sin t}{k\pi + t} \, dt$$

and for odd $n$ we have $n=2k-1$ and we use substitution $x = k\pi-t$:

$$\int_{(2k-1)\pi /2}^{2k \pi / 2} \frac{\sin x}{x} \,dx = (-1)^{k-1} \int_0^{\pi/ 2} \frac{\sin t}{k\pi - t} \, dt$$

Hence we obtain:

$$I = \int_0^{\frac{\pi}{2}} \sin t \cdot \left[ \frac{1}{t} + \sum_{k = 1}^{+\infty} (-1)^k \left( \frac{1}{t+k\pi} + \frac{1}{t-k\pi} \right) \right] \, dt$$ But in square bracket we have expansion of $\frac{1}{\sin x}$ into partial fractions, hence the result follows: $$I = \int_0^{\frac{\pi}{2}} dt = \frac{\pi}{2}$$

-

One easiest way to get this integral is to evaluate the following improper integral with parameter $a$: $$I(a)=\int_0^\infty e^{-ax}\frac{\sin x}{x}dx, a\ge 0.$$ It is easy to see $$I'(a)=-\int_0^\infty e^{-ax}\sin xdx=\frac{e^{-ax}}{a^2+1}(a\sin x+\cos x)\big|_0^\infty=-\frac{1}{a^2+1}.$$ Thus $$I(\infty)-I(0)=-\int_0^\infty\frac{1}{a^2+1}da=-\frac{\pi}{2}.$$ Note $I(\infty)=0$ and hence $I(0)=\frac{\pi}{2}$.

-