Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering whether the following integral

$\int_{-\infty}^{\infty} \exp( - a x^2 ) sin( bx ) / x$

exists in closed form. I would like to use it for numerical calculation and find an efficient way to evaluate it. If analytical form does not exist, I really appreciate any alternative means for evaluating the integral. One method would be numerical quadrature including Gaussian quadrature, but it may be inefficient when the parameters a and b are very different in scale.

thanks in advance

share|cite|improve this question
Oops, I meant the integral to be \int_{-\infty}^{\infty} \exp( - a (x - x0) ^2 ) sin( bx ) / x, where a, b, and x0 are constant parameters. But the integral in the above post is also helpful to me. Thanks! – jaian Oct 6 '12 at 15:36
Have you considered Fourier transforms? This is a convolution in physical space which is multiplication in Fourier space. – tpg2114 Oct 6 '12 at 15:46
Following your comment, I have just tried Fourier transform and it looks like the integral can be written as a sum of error functions having complex arguments. My (very very) tentative result is like the integral = const x { erf( ( b - 2*iax0 ) / 2\sqrt{a} ) - similar term }. So, if I can find a reliable math library routine for complex error function, I may be able to evaluate it efficiently.. I'll try along this line. Thanks :D – jaian Oct 6 '12 at 16:28

We assume $a,b>0$. Then $$\begin{eqnarray*} \int_{-\infty}^\infty dx\, e^{-a x^2}\frac{\sin b x}{x} &=& \int_0^b d\beta \, \int_{-\infty}^\infty dx\, e^{-a x^2} \cos \beta x \\ &=& \int_0^b d\beta \, \mathrm{Re} \int_{-\infty}^\infty dx\, e^{-a x^2+i \beta x} \\ &=& \int_0^b d\beta \, \mathrm{Re}\, \sqrt{\frac{\pi}{a}} e^{-{\beta}^2/(4a)} \\ &=& \pi \, \mathrm{erf}\left(\frac{b}{2\sqrt{a}}\right). \end{eqnarray*}$$ This approach can be generalized to $x_0\ne0$.

share|cite|improve this answer
Hmm.. I see. beautiful.. thanks :) – jaian Oct 6 '12 at 17:36
@jaian: You're welcome. Glad to help. – user26872 Oct 6 '12 at 18:05

We can consider the general type of integral, means


Case 1. If $b=0$, the function identically 0, so the integral converges and equals to 0.

Remark. The function is an odd function of $b$ (we consider $b$ as a variable), so we can only consider cases of $b>0$ in the following.

Case 2. If $a<0$, the integral divergent and didn't exist.

Case 3. If $a>0$, we can calculate as following:

$$\begin{align*} \int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}\frac{\sin(bx)}{x}dx &=\int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}(\int_{0}^{b}\cos(xy)dy)dx\\ &=\int_{0}^{b}(\int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}\cos(xy)dx)dy \end{align*}$$

$$\begin{align*} \int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}\cos(xy)dx &=\int_{-\infty}^{\infty}e^{-ax^{2}}\cos((x+x_{0})y)dx\\ &=\cos(x_{0}y)\int_{-\infty}^{\infty}e^{-ax^{2}}\cos(xy)dx -\sin(x_{0}y)\int_{-\infty}^{\infty}e^{-ax^{2}}\sin(xy)dx\\ &=\cos(x_{0}y)\int_{-\infty}^{\infty}e^{-ax^{2}}\cos(xy)dx \end{align*}$$

We denote $\int_{-\infty}^{\infty}e^{-ax^{2}}\cos(xy)dx$ by $F(y)$, then

$$\begin{align*} F^{\prime}(y)&=-\int_{-\infty}^{\infty}xe^{-ax^{2}}\sin(xy)dx =\frac{1}{2a}\int_{-\infty}^{\infty}\sin(xy)de^{-ax^{2}}\\ &=-\frac{y}{2a}\int_{-\infty}^{\infty}e^{-ax^{2}}\cos(xy)dx =-\frac{y}{2a}F(y) \end{align*}$$

By calculation, we can obtain that $F(0)=\int_{-\infty}^{\infty}e^{-ax^{2}}dx =2\int_{0}^{\infty}e^{-ax^{2}}dx =\frac{1}{\sqrt{a}}\Gamma(\frac{1}{2}) =\frac{\sqrt{\pi}}{\sqrt{a}}$.

Then solve the ordinary differential equation with initial value, we can get:



$$\begin{align*} \int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}\frac{\sin(bx)}{x}dx &=\int_{0}^{b}\cos(x_{0}y)F(y)dy\\ &=\frac{\sqrt{\pi}}{\sqrt{a}}\int_{0}^{b}e^{-\frac{y^{2}}{4a}}\cos(x_{0}y)dy\\ &=\sqrt{\pi}\int_{0}^{\frac{b}{\sqrt{a}}}e^{-\frac{t^{2}}{4}}\cos(\sqrt{a}x_{0}t)dt \end{align*}$$

Case 4. If $a=0$, then the integral becomes $\int_{-\infty}^{\infty}\frac{\sin(bx)}{x}dx$, by the criterion of sigular integral, we know that the integral converges.

In particular,

$$\int_{-\infty}^{\infty}\frac{\sin(bx)}{x}dx =\lim_{a\rightarrow0^{+}}\int_{-\infty}^{\infty}e^{-a(x-x_{0})^{2}}\frac{\sin(bx)}{x}dx$$

Set $a\rightarrow0^{+}$ in case 3, we can obtain that $$\int_{-\infty}^{\infty}\frac{\sin(bx)}{x}dx =\sqrt{\pi}\int_{0}^{\infty}e^{-\frac{t^{2}}{4}}dt =\sqrt{\pi}\Gamma(\frac{1}{2})=\pi$$

share|cite|improve this answer
I guess sin(bx)/x is an even function of x, so the integral should probably be nonzero. I was interested particularly in the case where x0 != 0 (which should be definitely nonzero), but I posted a wrong one..sry. – jaian Oct 6 '12 at 17:40
@jaian: Oh, I'm so sorry! I'm so careless and made a mistake! What did you mean about "where xo!=o"? – Alfred Chern Oct 6 '12 at 17:49
I mean, x_0 \ne 0 (I am not sure whether it is displayed correctly here). What I wanted to do is to evaluate the overlap integral between a shifted Gaussian, \exp[ -a (x - x_0)^2 ], with a sinc function, i.e. sin(bx)/x. This appears in my problem at hand. Thanks anyway:) – jaian Oct 6 '12 at 18:34

Thanks very much for your comments, and the following result was obtained including the case for $x_0 \ne 0$: $$ \int_{-\infty}^{\infty} dx \exp[-a(x-x_0)^2] \frac{ \sin(bx) }{ x } = \pi \exp(-a x_0^2) \mathrm{Re}\left(\mathrm{erf}\left[\frac{b+2iax_0}{2\sqrt{a}}\right]\right) $$ where $a\gt0, b, x_0$ are assumed to be all real. (note: coefficients etc may be still wrong...)

This integral appears in a type of electronic structure calculation based on a grid representation (sinc-function basis). I believe the above result should be definitely useful.

Thanks much!! --jaian

share|cite|improve this answer
Note that your raw $\TeX$ code is being displayed. To get it formatted, you need to enclose it in dollar signs; single dollar signs for inline formulas and double dollar signs for displayed equations. – joriki Feb 20 '13 at 7:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.