Integral over exponential involving reciprocial
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}