# Compute an integral about error function $\int_{-\infty}^{\infty} \frac{e^{-k^2}}{1-k} \mathrm{d}k$

There is an integral $$\mathcal{P}\int_{-\infty}^{\infty} \frac{e^{-k^2}}{1-k} \mathrm{d}k$$ where $$\mathcal{P}$$ means Cauchy principal value.

Mathematica gives the result (as the screent shot shows) $$\mathcal{P}\int_{-\infty}^{\infty} \frac{e^{-k^2}}{1-k} \mathrm{d}k = \frac{\pi}{e}\mathrm{erfi}(1) = \frac{\pi}{e}\cdot \frac{2}{\sqrt{\pi}} \int_0^1 e^{u^2}\mathrm{d}u$$ Mathematica screen shot

where $$\mathrm{erfi}(x)$$ is imaginary error function define as $$\mathrm{erfi}(z) = -\mathrm{i}\cdot\mathrm{erf}(\mathrm{i}z)$$ $$\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^{x} e^{-t^2}\mathrm{d}t$$ How can we get the right hand side from left hand side?

• Start by defining $f(\alpha)=\int_{-\infty}^{\infty}\frac{\exp(-\alpha k^2)}{1-k}dk$. Differentiate to obtain the diff. eq $\frac{d f(\alpha)}{d\alpha}+f=\int_{-\infty}^{\infty}\exp(-\alpha k^2)dk$. – vnd May 30 at 8:44
• One may use $\frac{1}{1-k}=\int_{0}^{\infty} e^{-(1-k)t} dt.$ – Dr Zafar Ahmed DSc May 30 at 8:50
• @DrZafarAhmedDSc I have tried it, but this formula is true only when $k<1$ . If I calculate $[-\infty ,1],[1,\infty]$ separately, it will be diverge at $k=1$ . – ZQW May 30 at 8:56
• @vnd Yes, I can prove that the right hand side and left hand side satisfy the same diff. eq by this way. But if I don't know the right hand side, what should I do to get it? – ZQW May 30 at 9:05
• @ZQW The Gaussian integral $\int_{-\infty}^{\infty}\exp(-\alpha k^2)dk=\sqrt{\frac{\pi}{\alpha}}$. Then one has a differential equation that can be solved with aid of an integrating factor. Of course you will need the fact that f(0)=0 – vnd May 30 at 20:26

For $$a \in \mathbb{R}$$ define \begin{align} f(a) &\equiv \mathrm{e}^{a^2} \mathcal{P} \int \limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-k^2}}{a-k} \, \mathrm{d} k = \mathrm{e}^{a^2} \mathcal{P} \int \limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-(x-a)^2}}{x} \, \mathrm{d} x= \lim_{\varepsilon \to 0^+} \left[\int \limits_{-\infty}^{-\varepsilon} \frac{\mathrm{e}^{-x^2 + 2 a x}}{x} \, \mathrm{d} x + \int \limits_\varepsilon^\infty \frac{\mathrm{e}^{-x^2 + 2 a x}}{x} \, \mathrm{d} x\right] \\ &= \lim_{\varepsilon \to 0^+} \int \limits_\varepsilon^\infty \frac{\mathrm{e}^{-x^2 + 2 a x} - \mathrm{e}^{-x^2 - 2 a x}}{x} \, \mathrm{d} x = \int \limits_0^\infty \frac{\mathrm{e}^{-x^2 + 2 a x} - \mathrm{e}^{-x^2 - 2 a x}}{x} \, \mathrm{d} x \, . \end{align} In the last step we have used that the integrand is in fact an analytic function (with value $$4a$$ at the origin). The usual arguments show that $$f$$ is analytic as well and we can differentiate under the integral sign to obtain $$f'(a) = 2 \int \limits_0^\infty \left[\mathrm{e}^{-x^2 + 2 a x} + \mathrm{e}^{-x^2 - 2 a x}\right]\, \mathrm{d} x = 2 \int \limits_{-\infty}^\infty \mathrm{e}^{-x^2 + 2 a x}\, \mathrm{d} x = 2 \sqrt{\pi} \, \mathrm{e}^{a^2} \, , \, a \in \mathbb{R} \, .$$ Since $$f(0) = 0$$, $$f(a) = 2 \sqrt{\pi} \int \limits_0^a \mathrm{e}^{t^2} \, \mathrm{d} t = \pi \operatorname{erfi}(a)$$ follows for $$a \in \mathbb{R}$$. This implies $$\mathcal{P} \int \limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-k^2}}{a-k} \, \mathrm{d} k = \pi \mathrm{e}^{-a^2} \operatorname{erfi}(a) \, , \, a \in \mathbb{R} \, .$$

An approach via Fourier transform

The definition that will be used here is $$\mathcal{F}f(\xi) = \int_{-\infty}^{\infty} f(x) \, e^{-i \xi x} \, dx, \quad f(x) = \frac{1}{2\pi} \int_{-\infty}^{\infty} \mathcal{F}f(\xi) \, e^{i \xi x} \, d\xi .$$

The integral $$I(x) := \mathcal{P}\int_{-\infty}^{\infty} \frac{e^{-y^2}}{x-y} \mathrm{d}y$$ can be seen as the convolution of the tempered distribution $$u(x) = \mathcal{P}\frac{1}{x}$$ with the Schwartz function $$\varphi(x) = e^{-x^2}$$, i.e. $$I = u * \varphi.$$

Taking the Fourier transform we then have $$\mathcal{F}I = \mathcal{F}(u*\varphi) = \mathcal{F}u \, \mathcal{F}\varphi .$$

Now, $$\mathcal{F}u(\xi) = -i\pi \operatorname{sign}(\xi)$$ 1 and $$\mathcal{F}\varphi(\xi) = \sqrt{\pi} e^{-\xi^2/4}$$, so $$\mathcal{F}I(\xi) = -i\pi^{3/2} \operatorname{sign}(\xi) \, e^{-\xi^2/4}$$.

Thus, \begin{align} I(x) &= \frac{1}{2\pi} \int_{-\infty}^{\infty} -i\pi^{3/2} \operatorname{sign}(\xi) \, e^{-\xi^2/4} e^{i \xi x} \, d\xi \\ &= \frac{\sqrt{\pi}}{2i} \int_{-\infty}^{\infty} \operatorname{sign}(\xi) \, e^{-\xi^2/4} e^{i \xi x} \, d\xi \\ &= \sqrt{\pi} \int_{0}^{\infty} e^{-\xi^2/4} \sin\xi x \, d\xi . \\ \end{align}

Taking the derivative gives \begin{align} I'(x) &= \sqrt{\pi} \int_{0}^{\infty} e^{-\xi^2/4} \xi \cos\xi x \, d\xi \\ &= \sqrt{\pi} \left( \left[(-2 e^{-\xi^2/4}) \cos\xi x \right]_{0}^{\infty} - \int_{0}^{\infty} (-2 e^{-\xi^2/4}) \, (-x \sin\xi x) \, d\xi \right) \\ &= \sqrt{\pi} \left( 2 - 2 x \int_{0}^{\infty} e^{-\xi^2/4} \sin\xi x \, d\xi \right) \\ &= 2 \sqrt{\pi} - 2 x I(x), \\ \end{align} which is easily solved using integrating factor, giving $$I(x) = 2 \sqrt{\pi} \, e^{-x^2} \int_0^x e^{t^2} \, dt = \pi \, e^{-x^2} \operatorname{erfi}(x).$$

$$first\ we\ know\ that:\\ \\ pv\int_{-\infty }^{\infty }\frac{cos(2bx)}{1-x}dx=pv\int_{-\infty }^{\infty }\frac{cos(2b)cos(2by)+sin(2b)sin(2by)}{y}dy\\ \\ =cos(2b). \ pv\int_{-\infty }^{\infty }\frac{cos(2by)}{y}dy+sin(2b). pv\int_{-\infty }^{\infty }\frac{sin(2by)}{y}dy\\ \\ \\ \therefore \ \ \ pv\int_{-\infty }^{\infty }\frac{cos(2bx)}{1-x}dx=\pi sin(2b)\ \ \ \ \ \ for\ b>0\\ \\ \\ \therefore pv\int_{-\infty }^{\infty }\frac{e^{-b^2}.cos(2bx)}{1-x}dx=\pi e^{-b^2}sin(2b)\\ \\ \\ \therefore pv\int_{-\infty }^{\infty }\frac{1}{1-x}\int_{0}^{\infty }e^{-b^2}cos(2bx)db dx=\pi \int_{0}^{\infty }e^{-b^2}sin(2b)db$$

$$\therefore \frac{\sqrt{\pi }}{2}pv\int_{-\infty }^{\infty }\frac{e^{-x^2}}{1-x}dx=\pi \int_{0}^{\infty }e^{-x^2}.sin(2b)db\\ \\ \\ \therefore pv.\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=-2\sqrt{\pi }\int_{0}^{\infty }e^{-x^2}sin(2x)dx\\ \\ \\ let\ x=-y\ \ \ , \therefore pv\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=pv.\int_{-\infty }^{\infty }\frac{-e^{-x^2}}{x+1}dx\\ \\ \\ \therefore 2pv\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=2pv\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x^2-1}dx\\ \\ \\ \therefore pv\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=2pv\int_{0}^{\infty }\frac{e^{-x^2}}{x^2-1}dx$$

                               now let


$$F(b)=2pv\int_{0}^{\infty }\frac{e^{-(x^2-1)b^2}}{x^2-1}dx\ \ \Rightarrow F(0)=0\\ \\ \\ \therefore F'(b)=-4b.pv\int_{0}^{\infty }e^{-(x^2-1)b^2}dx=-4b.e^{b^2}\int_{0}^{\infty }e^{-x^2b^2}dx\\ \\ \\ \therefore F'(b)=-2\sqrt{\pi }e^{b^2}\ \ \ \ \ , since\ \ F(0)=0\ \Rightarrow F(1)=\int_{0}^{1}F'(b)db\\ \\ \\ \therefore F(1)=-2\sqrt{\pi }\int_{0}^{1}e^{x^2}dx\\ \\ \\ \therefore 2pv\int_{0}^{\infty }\frac{e^{-(x^2-1)}}{x^2-1}dx=2e.pv.\int_{0}^{\infty }\frac{e^{-x^2}}{x^2-1}dx\\ \\ \\ \therefore pv.\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=\frac{-2\sqrt{\pi }}{e}\int_{0}^{1}e^{x^2}dx\\ \\ \\ \therefore pv.\int_{-\infty }^{\infty }\frac{e^{-x^2}}{1-x}dx=\frac{\pi }{e}erfi(1)$$

Another approach:

$$I=-pv.\int_{-\infty }^{\infty }\frac{e^{-x^2}}{x-1}dx=-\sum_{n=1}^{\infty }\Gamma (\frac{1-2n}{2})\\ \\ \\ =-\sum_{n=1}^{\infty }(-1)^n\frac{2^n.\sqrt{\pi }}{\prod_{n=1}^{\infty }(2m-1)}=-\sum_{n=1}^{\infty }(-1)^n\frac{2^n\sqrt{\pi }}{\frac{2^n.\Gamma (n+\frac{1}{2})}{\sqrt{\pi }}}\\ \\ \\ \therefore I=-\sum_{n=1}^{\infty }(-1)^n\frac{\pi }{\Gamma (n+\frac{1}{2})}=-\sqrt{\pi }\sum_{n=1}^{\infty }(-1)^n\frac{\Gamma (n).\Gamma (\frac{1}{2})}{\Gamma (n)\Gamma (n+\frac{1}{2})}\\ \\ \\ =-\sqrt{\pi }\sum_{n=1}^{\infty }(-1)^n\int_{0}^{1}\frac{(1-x)^{n-1}}{\sqrt{x}(n-1)!}dx\\ \\ \\ \therefore I=-\frac{\pi }{e}.ierf(i)=\frac{\pi }{e}erfi(1$$