## 175 -The sine integral

The integral $\displaystyle\int_0^\infty\frac{\sin x}x\,dx$ is an example of an improper integral: The integrand is not defined at $0$, and the interval of integration is unbounded. The issue at $0$ is not really serious, since

$\lim_{x\to 0}\sin(x)/x=1.$

Since the interval is unbounded, this integral is actually defined as a limit,

$\displaystyle \int_0^\infty\frac{\sin x}x\,dx=\lim_{t\to\infty}\int_0^t\frac{\sin x}x\,dx.$

In this post I want to show how to evaluate this limit. The problem is that the sine integral

$\displaystyle {\rm Si}(t)=\int_0^t \frac{\sin x}x\,dx$

does not admit an elementary expression, i.e., it cannot be expressed in terms of $t$ by composing exponentials, logarithms, trigonometric functions, their inverses, and polynomials.

(To get a sense of the difficulty in finding an expression for ${\rm Si}(x)$, it may be useful to play a little trying integration by parts or similar tricks.)

${\rm Si}(t)$

This is a classical integral and appears in applications with some frequency, so there are several standard methods for computing its value. Usually, these methods involve techniques from complex analysis (either the Fourier transform or contour integrals), although there are some elementary approaches as well, such as the one I illustrate here. “Elementary” is to be taken with a grain of salt; although the argument below is easy to follow with some patience, it is difficult to come up with. There are good references where the integral is computed, but it usually takes me a while to remember where to look, so I decided to write this post and to provide a reference here as well.

An excellent book where the computation can be found more or less in complete detail (except for what I call Claims 1 and 2 below) is Introduction to Calculus and Analysis, vol. I, by Richard Courant and Fritz John, Interscience Publishers (1965), reprinted by  Springer (1989). The argument I present here is essentially the same they use, although I have arranged some of the details in a different way.

I will show that

$\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\frac{\pi}2.$

Let’s begin by showing that the integral converges. Although we do not need this, I’ll also show that the convergence is conditional but not absolute, i.e., the integral $\displaystyle\int_0^\infty\left|\frac{\sin x}x\right|\,dx$ diverges.

Fact 1. $\displaystyle\int_0^\infty\frac{\sin x}x\,dx$ converges.

Proof. Let $\displaystyle a_k=\int_{\pi k}^{\pi(k+1)}\frac{\sin x}x\,dx$. Notice that $\displaystyle |a_k|=\int_{\pi k}^{\pi(k+1)}\frac{|\sin x|}x\,dx$.

Notice also that $\lim_{k\to\infty}|a_k|=0$, since (as $k\to\infty$)

$\displaystyle \int_{\pi k}^{\pi(k+1)} \frac {|\sin x|}x\,dx \le \int_{\pi k} ^{\pi(k+1)} \frac{dx}x \le \frac1{\pi k} \to 0.$

This proves that $\displaystyle\lim_{t\to\infty}\int_0^t\frac{\sin x}x\,dx=\lim_{k\to\infty}\int_0^{\pi k}\frac{\sin x}x\,dx$ as any $t$ is in ${}[k\pi,(k+1)\pi)$ for a unique $k$, and

$\displaystyle\left|\int_{k\pi}^t\frac{\sin x}x\,dx\right|\le\int_{k\pi}^t\frac{|\sin x|}x\,dx\le\int_{k\pi}^{(k+1)\pi}\frac{|\sin x|}x\,dx\to 0.$

So $\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\sum_{k=0}^\infty a_k$.

Now observe that $|a_k|>|a_{k+1}|$ for all $k$, since $|\sin((k+1)\pi+t)|=|\sin(k\pi+t)|$ for any $t\in(0,\pi)$, and therefore

$\displaystyle\frac{|\sin((k+1)\pi+t)|}{(k+1)\pi+t}<\displaystyle\frac{|\sin(k\pi+t)|}{k\pi+t},$

so $\displaystyle |a_{k+1}|=\int_{\pi(k+1)}^{\pi(k+2)}\frac{|\sin x|}x\,dx=\int_0^\pi\frac{|\sin((k+1)\pi+t)|}{(k+1)\pi+t}\,dt$ $\displaystyle < \int_0^\pi \frac {|\sin(k\pi+t)|} {k\pi+t}\,dt = \int_{\pi k}^{\pi(k+1)} \frac {|\sin x|}x\,dx =|a_k|.$

Also, the $a_k$ alternate in sign (being positive for even values of $k$ and negative for odd values). It follows (by Leibniz’s test) that $\displaystyle\sum_{k=0}^\infty a_k$ converges, and therefore $\displaystyle\int_0^\infty\frac{\sin x}x\,dx$ converges as well. ${\sf QED}$

Continuing with the argument just shown, we also see that, since the terms $a_k$ alternate, then (for any $n$)

$\displaystyle\left|\int_0^\infty\frac{\sin x}x\,dx-\sum_{k=0}^n a_k\right|<|a_{n+1}|<\frac1{\pi(n+1)},$

showing that the integral converges relatively fast, which helps explain the shape of the graph displayed above.

Fact 2. $\displaystyle\int_0^\infty\frac{|\sin x|}x\,dx$ diverges.

Proof. It suffices to see that $\displaystyle\sum_{k=0}^\infty|a_k|$ diverges. For this we now look for an estimate bounding $|a_k|$ from below, which we obtain by noting that $\displaystyle \frac1x\ge\frac1{\pi(k+1)}$ for all $x\in[\pi k,\pi(k+1)]$, so

$\displaystyle |a_k|\ge\int_{k\pi}^{(k+1)\pi} \frac{|\sin x|}{\pi(k+1)}\,dx$ $\displaystyle =\frac1{\pi(k+1)}\left| \int_{k\pi}^{(k+1)\pi}\sin x\,dx\right|=\frac{2/\pi}{k+1},$

and $\displaystyle\sum_{k\ge0}|a_k|\ge\frac2{\pi}\sum_{k\ge0}\frac1{k+1}$, which diverges. ${\sf QED}$

From the argument above, we also have that for any $n$,

$\displaystyle\frac2{\pi}\sum_{k=0}^n\frac1{k+1}\le\sum_{k=0}^n |a_k|\le a_0+\frac1\pi\sum_{k=1}^n\frac1k,$

so, although divergent, the function $\displaystyle{\rm ASi}(t)=\int_0^t\frac{|\sin x|}x\,dx$ grows as $t\to\infty$ at a similar speed as the harmonic series (which grows very slowly).

${\rm ASi}(t)$

Having established both the convergence of the integral and found a bound for how quickly it converges, we now proceed to find its value.

For this, note that for any constant $\rho$, the change of variables $t=x/\rho$ shows that

$\displaystyle\int_0^{\pi\rho}\frac{\sin x}x\,dx=\int_0^\pi\frac{\sin(\rho t)}{\rho t}\rho\,dt=\int_0^\pi\frac{\sin(\rho t)}t\,dt.$

The key trick that allows us to compute the integral is the observation that

$\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.$

This is not particularly hard, but the algebra is a tad messy, so I will postpone its proof until the end.

Let’s assume for now that this is the case, so $\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\lim_{k\to\infty}\int_0^\pi\frac{\sin \left(k+\frac12\right)x}{2\sin(x/2)}\,dx.$

To compute this limit, we make use of a nice trigonometric identity:

Fact 3. Let $\displaystyle f_n(t)=\frac12+\cos(t)+\cos(2t)+\dots+\cos(nt)$. Then

$\displaystyle f_n(t)=\frac{\sin((n+\frac12)t)}{2\sin(\frac12 t)}$

for $0\le t\le\pi$, where for $t=0$ the right hand side of the displayed equation is understood as its limit as $t\to0$.

Proof. Let’s begin by verifying that the result holds for $t=0$. In this case, the definition of $f_n(t)$ gives $\displaystyle f_n(0)=n+\frac12$. Also, using  l’Hôpital’s rule,

$\displaystyle\lim_{t\to0}\frac{\sin((n+\frac12)t)}{2\sin(\frac12 t)}=\lim_{t\to0}\frac{(n+\frac12)\cos((n+\frac12)t)}{\cos(\frac12t)}=n+\frac12,$

as required. Let’s now argue that the result also holds for $0.

When $n=0$, the right hand side equals $\displaystyle\frac12=f_0(t)$, so the result holds. We argue by induction, showing that if $f_n(t)$ is as stated, then the corresponding formula also holds for $f_{n+1}(t)$.

First, notice that $\sin((n+\frac12)t)=\sin((n+1-\frac12)t)$ which (upon expanding) equals $\sin((n+1)t)\cos(\frac12 t)-\cos((n+1)t)\sin(\frac12t)$, so

$\sin((n+\frac12)t) + \cos((n+1)t)\sin(\frac12t)$ $=\sin((n+1)t)\cos(\frac12t).$ (1)

Also, $\sin((n+1+\frac12)t)=\sin(\frac12 t)\cos((n+1)t)+\cos(\frac12 t)\sin((n+1)t),$ or

$\cos((n+1)t)\sin(\frac12t)$ $=\sin((n+1+\frac12)t)-\sin((n+1)t)\cos(\frac12t).$ (2)

Adding (1) and (2) we get

$\sin((n+\frac12)t)+2\cos((n+1)t)\sin(\frac12t)=\sin((n+1+\frac12)t),$

that (dividing both sides by $2\sin(\frac12 t)$) gives us

$\displaystyle \frac{\sin((n+\frac12)t)}{2\sin(\frac12 t)} +\cos((n+1)t) = \frac{\sin((n+1+\frac12)t)}{2\sin(\frac12 t)},$

which, by the assumption that the result holds for $n$, gives us that $f_{n+1}$ satisfies the desired relation as well. ${\sf QED}$

Remark. For $t\ne0$ there is a much more natural proof of Fact 3 using complex numbers: Simply notice that $\cos(kt)=\Re(e^{ikt})$, where $i=\sqrt{-1}$ and $\Re(z)$ denotes the real part of the complex number $z.$ Hence,

$\displaystyle\frac12+f_n(t)=\Re(1+e^{it}+e^{2it}+\dots+e^{nit})$ $\displaystyle=\Re\left(\frac{e^{i(n+1)t}-1}{e^{it}-1}\right),$

since the expression being added is a (finite) geometric series. Now: $e^{it}-1=e^{it/2}(e^{it/2}-e^{-it/2})=e^{it/2}(2i\sin(t/2))$, so

$\displaystyle\frac{e^{i(n+1)t}-1}{e^{it}-1}=\frac{-ie^{-it/2}(e^{i(n+1)t}-1)}{2\sin(t/2)}.$

Also, $-ie^{-it/2}(e^{i(n+1)t}-1)=-i(e^{i(n+\frac12)t}-e^{-it/2})$ which we can expand as $=(\sin((n+1/2)t)+\sin(t/2))+i(\cos(t/2)-\cos((n+1/2)t))$, so

$\displaystyle \Re\left(\frac{e^{i(n+1)t}-1}{e^{it}-1}\right)=\frac{\sin(t/2)+\sin((n+1/2)t)}{2\sin(t/2)}$ $\displaystyle=\frac12+\frac{\sin((n+1/2)t)}{2\sin(t/2)},$

and the result follows. $\square$

It follows from Fact 3 that

$\displaystyle\int_0^\pi\frac{\sin(k+\frac12)x}{2\sin(x/2)}\,dx=\int_0^\pi f_k(x)\,dx$ $\displaystyle=\int_0^\pi\left(\frac12+\sum_{n=1}^k\cos(nx)\right)\,dx=\frac{\pi}2,$

since for all $n>0$ we have

$\displaystyle\int_0^\pi\cos(nx)\,dx=\left.\frac1n\sin(nx)\right|_0^\pi=0.$

With this computation, we can finally conclude that

$\displaystyle\int_0^\infty\frac{\sin x}x\,dx=\lim_{k\to\infty}\frac{\pi}2=\frac{\pi}2.$

All that remains is to verify the following:

Fact 4. $\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$.

Proof. Let $\displaystyle f(t)=\frac1t-\frac1{2\sin(t/2)}$ for $0. I first argue that $f(t)$ can be defined at $t=0$ in a way that makes it continuous at this point (and therefore it is continuous in the whole interval ${}[0,\pi]$). I then argue that (extending $f$ this way) $f'(t)$ is also defined and continuous. I use this to find an expression for the integral by means of integration by parts, and the limit of this expression is easy to compute, giving the desired result.

Claim 1. With $f(t)$ as above,

1. $\lim_{t\to0^+}f(t)=0$, so if we set $f(0)=0$, the new function is continuous in all of ${}[0,\pi]$.
2. $f'(0)$ exists and equals $-1/24$.

Proof. We use  l’Hôpital’s rule (repeatedly), and to keep the argument readable, write $g(t)\sim h(t)$ to indicate that $\lim_{t\to0}g(t)=\lim_{t\to0}h(t)$.

We could prove items 1 and 2 separately, but for brevity’s sake I will prove both of them at the same time. It suffices to show that $\lim_{t\to0^+}f(t)/t=-1/24$, because (in particular) this limit can only exist if $\lim_{t\to0^+}f(t)=0$, which proves 1, but it also proves 2, since then the limit can be rewritten (by writing $h$ instead of $t$) as

$\displaystyle\lim_{h\to0^+}\frac{f(h)-f(0)}h,$

which is precisely the definition of $f'(0)$.

Now,

$\displaystyle\frac{f(t)}t=\frac1{t^2}-\frac1{2t\sin(t/2)}=\frac{2\sin(t/2)-t}{2t^2\sin(t/2)}$ $\displaystyle \sim \frac{\cos(t/2)-1}{4t\sin(t/2)+t^2\cos(t/2)}$ $\displaystyle \sim\frac{-\frac12\sin(t/2)}{4\sin(t/2)+4t\cos(t/2)-(t^2/2)\sin(t/2)}$ $\displaystyle \sim\frac{-\frac14\cos(t/2)}{6\cos(t/2)-3t\sin(t/2)-(t^2/4)\cos(t/2)}$ $\displaystyle\sim\frac{-1/4}6=-\frac1{24}.$

This completes the proof of Claim 1. ${\sf QED}$

There are of course other ways of proving Claim 1. For example, one could compare the power series expansions about $0$ of $2\sin(t/2)-t$ and $2t^2\sin(t/2)$.

Claim 2. $\displaystyle\lim_{t\to0^+}f'(t)=-\frac1{24}$, so $f'$ is continuous in all of ${}[0,\pi]$.

Proof. For $t>0$, $\displaystyle f'(t)=-\frac1{t^2}+\frac{\cos(t/2)}{4\sin^2(t/2)}=\frac{t^2\cos(t/2)-4\sin^2(t/2)}{4t^2\sin^2(t/2)}.$ Using the $\sim$ notation as in the previous claim, we see that

$\displaystyle \frac{t^2\cos(t/2)-4\sin^2(t/2)}{4t^2\sin^2(t/2)}$ $\displaystyle \sim\frac{2t\cos(t/2)-\frac12 t^2\sin(t/2)-4\sin(t/2)\cos(t/2)}{8t\sin^2(t/2)+4t^2\sin(t/2)\cos(t/2)}$ $\displaystyle =\frac{2t\cos(t/2)-\frac12 t^2\sin(t/2)-2\sin t}{8t\sin^2(t/2)+2t^2\sin t}$ $\displaystyle \sim\frac{2\cos(t/2)-2t\sin(t/2)-\frac14 t^2\cos(t/2)-2\cos t}{8\sin^2(t/2)+8t\sin t+2t^2\cos t}$ $\displaystyle\sim\frac{-3\sin(t/2)-\frac32 t\cos(t/2)+\frac18 t^2\sin(t/2)+2\sin t}{12\sin t+12 t\cos t-2t^2\sin t}$ $\displaystyle\sim\frac{-3\cos(t/2)+t\sin(t/2)+\frac1{16}t^2\cos(t/2)+2\cos t}{24\cos t-16 t\sin t-2t^2\cos t}$ $\displaystyle\sim\frac{-3+2}{24}=-\frac1{24}.$

This completes the proof of Claim 2. ${\sf QED}$

(As with Claim 1, we could have argued here by considering power series expansions.)

The point of Claims 1 and 2 is twofold: They allow us to use integration by parts to find an expression for

$\displaystyle \int_0^\pi \sin\left(\left( k+\frac12\right) t\right) \left(\frac 1t- \frac1{2\sin(t/2)}\right)\,dt$ $\displaystyle =\int_0^\pi\sin\left(\left(k+\frac12\right)t\right)f(t)\,dt,$

and they allow us to show easily that the limit of this expression (as $k\to\infty$) is $0$ as required.

Since both $f(t)$ and $f'(t)$ are continuous on ${}[0,\pi]$, we can integrate by parts the expression above, setting $u=f(t)$ and $dv=\sin((k+1/2)t)\,dt$, obtaining $\displaystyle \int_0^\pi\sin\left(\left(k+\frac12\right)t\right)f(t)\,dt=\left.\frac{-f(t)\cos((k+1/2)t)}{k+1/2}\right|_0^\pi$ $\displaystyle +\frac1{k+1/2}\int_0^\pi \cos((k+1/2)t)f'(t)\,dt$ $\displaystyle=\frac1{k+1/2}\int_0^\pi \cos((k+1/2)t)f'(t)\,dt,$ because $\cos((k+1/2)\pi)=f(0)=0$.

Now: Since $f'(t)$ is continuous on ${}[0,\pi]$, $|f'(t)|$ is bounded by some constant $M$, so $\displaystyle \left |\int_0^\pi \cos((k+1/2)t)f'(t)\,dt\right| \le \int_0^\pi |\cos((k+1/2)t)||f'(t)|\,dt$ $\displaystyle \le\int_0^\pi M\,dt=M\pi,$ and therefore

$\displaystyle \left|\frac1{k+1/2}\int_0^\pi\cos((k+1/2)t)f'(t)\,dt\right|\le\frac{M\pi}{k+1/2}\to 0$

as $k\to\infty$, as wanted.

This completes the proof of Fact 4. ${\sf QED}$

And with this, we are done.

$f_2,f_3,f_4$