# Integral over exponential involving reciprocial

I want to show $$I := \int_{-\infty}^\infty \exp \left(-\left(x-\frac p x \right)^2\right) \, dx = \sqrt{\pi}$$ for any non-negative $p\geq 0$. I tried to prove $I^2=\pi$ using Fubini's theorem, but had no success.

The key is to essentially make the substitution $u = x - p/x$. The problem is that this isn't an invertible function--it has a positive and a negative root for $x$. To fix, this we divide the integral into a positive and negative side and make the substitutions \begin{eqnarray} x(u) &=& \frac{1}{2}\left(u \pm \sqrt{4p+u^2}\right) \\ dx &=& \frac{1}{2}\left(1 \pm \frac{u}{\sqrt{4p+u^2}}\right) \end{eqnarray} This gives \begin{multline} \int_{-\infty}^\infty \exp\left[-\left(x-\frac{p}{x}\right)^2\right]\,dx =\int_{-\infty}^0 \exp\left[-\left(x-\frac{p}{x}\right)^2\right] \, dx+\int_0^\infty \exp\left[-\left(x-\frac{p}{x}\right)^2\right]dx \\= \int_{-\infty}^\infty \frac{e^{-u^2}}{2}\left(1 - \frac{u}{\sqrt{4p+u^2}}\right) \, du + \int_{-\infty}^\infty \frac{e^{-u^2}}{2}\left(1 + \frac{u}{\sqrt{4p+u^2}}\right) \, du \\= \int_{-\infty}^\infty e^{-u^2}du = \sqrt{\pi} \end{multline}

Using the substitution $$x=\frac{u+\sqrt{u^2+4p}}2\implies\mathrm{d}x=\frac12\left(1+\frac{u}{\sqrt{u^2+4p}}\right)\mathrm{d}u$$ we have $u=x-\frac px$ and, as $u$ varies from $-\infty$ to $+\infty$, $x$ varies from $0$ to $\infty$.

Since the integrand is even, \begin{align} \int_{-\infty}^\infty e^{-\left(x-\frac px\right)^2}\,\mathrm{d}x &=2\int_0^\infty e^{-\left(x-\frac px\right)^2}\,\mathrm{d}x\\ &=2\int_{-\infty}^\infty e^{-u^2}\frac12\left(1+\frac{u}{\sqrt{u^2+4p}}\right)\mathrm{d}u\\ &=\int_{-\infty}^\infty e^{-u^2}\,\mathrm{d}u\\[6pt] &=\sqrt\pi \end{align}

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{I \equiv \int_{-\infty}^{\infty} \exp\pars{-\bracks{x - {p \over x}} ^{2}}\,\dd x = \root{\pi}:\ {\large }}$

\begin{align} I &\equiv \int_{-\infty}^{\infty}\exp\pars{-\bracks{x - {p \over x}} ^{2}}\,\dd x = 2\int_{0}^{\infty} \exp\pars{-p\bracks{{x \over \root{p}} - {\root{p} \over x}} ^{2}}\,\dd x \\[5mm] & = 2\root{p}\int_{0}^{\infty} \exp\pars{-p\bracks{x - {1 \over x}} ^{2}}\,\dd x \\[5mm] & = \root{p}\bracks{% \int_{0}^{\infty}\exp\pars{-p\bracks{x - {1 \over x}} ^{2}}\,\dd x + \int_{0}^{\infty}\exp\pars{-p\bracks{x - {1 \over x}} ^{2}}\,\dd x} \\[5mm] & = \root{p}\bracks{% \int_{0}^{\infty}\exp\pars{-p\bracks{x - {1 \over x}} ^{2}}\,\dd x + \int_{\infty}^{0}\exp\pars{-p\bracks{{1 \over x} - x} ^{2}} \,\pars{-\,{1 \over x^{2}}}\dd x} \\[5mm] & = \root{p} \int_{0}^{\infty}\exp\pars{-p\bracks{x - {1 \over x}} ^{2}} \pars{1 + {1 \over x^{2}}}\,\dd x \,\,\,\stackrel{x - 1/x\ \mapsto\ x}{=}\,\,\, \int_{-\infty}^{\infty}\expo{-px^{2}}\root{p}\,\dd x \\[5mm] & = \int_{-\infty}^{\infty}\expo{-x^{2}}\,\dd x = \bbx{\root{\pi}} \end{align}

I thought it might be instructive to present another approach from the ones already posted. To that end, we now proceed.

There is nothing particularly special about the function $e^{-\left(x-\frac px\right)^2}$ in the development.

In fact, using the substitutions $x=-\sqrt{p}e^{-t}$ for $x\in (-\infty, 0]$ and $x=\sqrt{p}e^{t}$ for $x\in [0,\infty)$ in the integral $\int_{-\infty}^\infty f\left(x-\frac px\right)\,dx$ yields

\begin{align} \int_{-\infty}^\infty f\left(x-\frac px\right)\,dx&=\int_{-\infty}^0 f\left(x-\frac px\right)\,dx+\int_{0}^\infty f\left(x-\frac px\right)\,dx\\\\ &=\sqrt{p}\int_{-\infty}^\infty f\left(2\sqrt{p}\sinh(t)\right)\,e^{-t}\,dt+\sqrt{p}\int_{-\infty}^\infty f\left(2\sqrt{p}\sinh(t)\right)\,e^{t}\,dt\\\\ &=2\sqrt{p}\int_{-\infty}^\infty f(2\sqrt{p}\sinh(t))\,\cosh(t)\,dt\\\\ &=\int_{-\infty}^\infty f(u)\,du \end{align}

which for $f(u)=e^{-u^2}$ is equal to $\sqrt{\pi}$ as expected!

We could have approached the problem of specific interest with a slight modification of the general development in the highlighted section.

First we let $x=\sqrt{p}\,e^{t}$. Then, we have $x-\frac px =2\sqrt{p}\sinh(t)$ and

\begin{align} \int_{-\infty}^\infty e^{-\left(x-\frac px\right)^2}\,dx&=2\int_{0}^\infty e^{-\left(x-\frac px\right)^2}\,dx\\\\ &=2\sqrt p\int_{-\infty}^\infty e^{-4p\sinh^2(t)}\,e^t\,dt\tag 1 \end{align}

Next, we let $x=\sqrt {p}\,e^{-t}$. Then, we have $x-\frac px=-2\sqrt{p}\sinh(t)$ and

\begin{align} \int_{-\infty}^\infty e^{-\left(x-\frac px\right)^2}\,dx&=2\int_{0}^\infty e^{-\left(x-\frac px\right)^2}\,dx\\\\ &=2\sqrt p\int_{-\infty}^\infty e^{-4p\sinh^2(t)}\,e^{-t}\,dt\tag 2 \end{align}

Adding $(1)$ and $(2)$ and dividing by $2$, we obtain

\begin{align} \int_{-\infty}^\infty e^{-\left(x-\frac px\right)^2}\,dx&=2\sqrt{p}\int_0^\infty e^{-4p\sinh^2(x)}\,\cosh(x)\,dx\tag3 \end{align}

Finally, enforcing the substitution $u=\sinh(t)$ in $(3)$ yields

\begin{align} \int_{-\infty}^\infty e^{-\left(x-\frac px\right)^2}\,dx&=2\sqrt{p}\int_0^\infty e^{-4pu^2}\,\,du\\\\ &=\sqrt{\pi} \end{align}

as expected!

Hint: Substitute $x-\frac{p}{x}$ with $t$ and this looks suspiciously similar to the error function.

For $a=\sqrt p$, tet $x=at$ and then $$x-\frac{p}{x}=at-\frac{p}{at}=\sqrt p(t-\frac1t).$$ So \begin{aligned} I & =\int_{-\infty}^\infty \exp \left(-\left(x-\frac p x \right)^2\right) \, dx=\sqrt p\int_{-\infty}^\infty \exp \left(-p\left(t-\frac1t \right)^2\right) \, dt \\[10pt] & =2\sqrt p\int_0^\infty \exp \left(-p\left(t-\frac1t \right)^2\right) \, dt. \end{aligned} \tag 1 Using $t\to\frac1t$, one has $$I=2\sqrt p\int_{0}^\infty \frac1{t^2}\exp \left(-p\left(t-\frac1t \right)^2\right) \, dt.\tag{2}$$ Then adding (1) and (2) and under $u=t-\frac1t$, one has $$I=\sqrt p\int_{0}^\infty (1+\frac1{t^2})\exp \left(-\left(t-\frac1t \right)^2\right) \, dt=\sqrt p\int_{-\infty}^\infty\exp(pu^2) \, du=\sqrt\pi.$$

• In your last two $\color{#f00}{\texttt{exp}}$ ( last line ) arguments: the first one needs a $\color{#f00}{\large p}$ factor and the second one need a $\color{#f00}{\large -}$ sign. Otherwise, everything is fine. – Felix Marin Jul 25 '17 at 22:32