TITLE: Integral over exponential involving reciprocial
QUESTION [9 upvotes]: 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.

REPLY [3 votes]: 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!