Compute $\int_{-\infty}^{+\infty}(1+\frac{1}{v^2})\exp(-\frac{u^2}{2\sigma_1^2\sigma_2^2}(\sigma_2v+\frac{\sigma_1}{v})^2)\,dv$

First we analyze the special case in which $u=\sqrt2$, and $\sigma_1=\sigma_2=1$. Noting that $\left(x+\frac 1x\right)^2=\left(x-\frac 1x\right)^2 +4$, we have

$$\begin{align} I&=\int_{-\infty}^\infty\left(1+\frac1{x^2}\right)e^{-\left(x+\frac 1x\right)^2}\,dx\\\\ &=e^{-4}\int_{-\infty}^\infty\left(1+\frac1{x^2}\right)e^{-\left(x-\frac 1x\right)^2}\,dx \tag 1\\\\ &=2e^{-4}\int_{-\infty}^\infty e^{-u^2}\,du \tag 2\\\\ &=2\sqrt{\pi}e^{-4} \end{align}$$

CAUTION:

In going from $(1)$ to $(2)$, we first split the integral as

$$\int_{-\infty}^\infty\left(1+\frac1{x^2}\right)e^{-\left(x-\frac 1x\right)^2}\,dx=\int_{-\infty}^0 \left(1+\frac1{x^2}\right)e^{-\left(x-\frac 1x\right)^2}\,dx+\int_{0}^\infty\left(1+\frac1{x^2}\right)e^{-\left(x-\frac 1x\right)^2}\,dx \tag 3$$

Then, we separately enforce the substitution $u=x-\frac1x$ in each of the integrals on the right-hand side of $(3)$.


For the general case, we enforce the substitution $x\to \sqrt{\frac{\sigma_1}{\sigma_2}}x$ to obtain

$$\begin{align} I&=\sqrt{\frac{\sigma_2}{\sigma_1}}\int_{-\infty}^\infty \left(\frac{\sigma_1}{\sigma_2}+\frac1{x^2}\right)e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x+\frac 1x\right)^2}\,dx\\\\ &=\sqrt{\frac{\sigma_2}{\sigma_1}}\int_{-\infty}^\infty \left(1+\frac1{x^2}\right)e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x+\frac 1x\right)^2}\,dx+\sqrt{\frac{\sigma_2}{\sigma_1}}\left(\frac{\sigma_1}{\sigma_2}-1\right)\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x+\frac 1x\right)^2}\,dx\\\\ &=2\sqrt{\frac{\sigma_2}{\sigma_1}}e^{-2\frac{u^2}{\sigma_1\sigma_1}}\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,d\left(x-\frac1x\right)\\\\ &+\sqrt{\frac{\sigma_2}{\sigma_1}}\left(\frac{\sigma_1}{\sigma_2}-1\right)e^{-2\frac{u^2}{\sigma_1\sigma_1}}\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,dx\\\\ &=2\sigma_2e^{-2\frac{u^2}{\sigma_1\sigma_1}}\sqrt{\frac{2\pi}{u^2}}+\sqrt{\frac{\sigma_2}{\sigma_1}}\left(\frac{\sigma_1}{\sigma_2}-1\right)e^{-\frac{u^2}{2\sigma_1\sigma_1}}\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,dx \tag4 \end{align}$$

Making the substitution $x\to 1/x$ in the integral on the right-hand side of $(4)$ over the intervals $0$ to $\infty$ and $-\infty$ to $0$ separately, reveals

$$\begin{align} \int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,dx&=\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\frac{1}{x^2}\,dx\\\\ &= \frac12\int_{-\infty}^\infty \left(1+\frac1{x^2}\right)e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,dx\\\\ &=\int_{-\infty}^\infty e^{-\frac{u^2}{2\sigma_1\sigma_1}\left(x-\frac 1x\right)^2}\,d\left(x-\frac1x\right)\\\\ &=\sqrt{\frac{2\pi \sigma_1\sigma_2}{u^2}}\tag 5 \end{align}$$

Substituting $(5)$ into $(4)$ yields

$$\bbox[5px,border:2px solid #C0A000]{I=\left(\sigma_1+\sigma_2\right)\sqrt{\frac{2\pi}{u^2}}e^{-2\frac{u^2}{\sigma_1\sigma_1}}}$$


Let $I$ denote the integral. Then by the substitution $v \to \frac{1}{v}$ we find that

\begin{align*} I &= \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_1^2\sigma_2^2}\left(\sigma_2 v+\frac{\sigma_1}{v} \right)^2 \bigg\} \,dv \\ &\qquad+ \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_1^2\sigma_2^2}\left(\sigma_1 v+\frac{\sigma_2}{v} \right)^2 \bigg\} \,dv. \end{align*}

Then using the relation

$$ \left( \sigma_i v+\frac{\sigma_j}{v} \right)^2 = \sigma_i^2 \left( v - \frac{\sigma_j}{\sigma_i v} \right)^2 + 4\sigma_i \sigma_j $$

for $\{i,j\} = \{1,2\}$, we can write

\begin{align*} I &= e^{-\frac{2u^2}{\sigma_1 \sigma_2}} \bigg( \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_1^2}\left(v - \frac{\sigma_1}{\sigma_2 v} \right)^2 \bigg\} \,dv \\ &\hspace{5em} + \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_2^2}\left(v - \frac{\sigma_2}{\sigma_1 v} \right)^2 \bigg\} \,dv \bigg). \end{align*}

Applying the Glasser's Master Theorem, we find that

\begin{align*} I &= e^{-\frac{2u^2}{\sigma_1 \sigma_2}} \bigg( \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_1^2}v^2 \bigg\} \,dv + \int_{-\infty}^{+\infty} \exp \bigg\{ -\frac{u^2}{2\sigma_2^2}v^2 \bigg\} \,dv \bigg) \\ &= \sqrt{2\pi } \left( \frac{\sigma_1 + \sigma_2}{|u|} \right) \exp\bigg\{ -\frac{2u^2}{\sigma_1 \sigma_2} \bigg\}. \end{align*}