Proving closed form for $\int_0^\infty \frac{x e^{-x^2} \sin(2 z x)}{m^2 + x^2} dx$ In the book "Tables of Integral Transforms" by Erdelyi, Magnus, et al, the following formula is provided:
$$
\int_0^\infty \frac{x e^{-x^2} \sin(2 z x)}{m^2 + x^2} dx = \frac{\pi e^{m^2}}{4} \left( e^{-2 z m} \text{erfc}(m-z) - e^{2 z m} \text{erfc}(m+z)\right)
$$
I have tried a few tricks to get this, but am still stumped. Could anyone point me in the right direction on showing this? It seems to at least be somewhat nontrivial, considering that Mathematica cannot provide this result.
 A: Let
$$ I(p) = \int_{0}^{\infty} \frac{x \, e^{-x^2} \sin(2 p x)}{m^2 + x^2} \, dx. $$
Since $p$ is a variable not involved in the integral then:
\begin{align}
\frac{d^2 \, I}{d \, p^2} - 4 \, m^2 \, I &= -4 \, \int_{0}^{\infty} x \, e^{-x^2} \, \sin(2 p x) \, dx 
= -2 \, \sqrt{\pi} \, p \, e^{- p^2}.
\end{align}
This differential equation has the general solution
$$ I(p) = c_{1} \, e^{2 m p} + c_{2} \, e^{-2 m p} - \frac{\pi}{4} \, e^{m^2} \, \left( e^{2 m p} \, \text{erf}(m - p) + e^{-2 m p} \, \text{erf}(m - p) \right). $$
Using $I(0) = 0$ then
$$ c_{1} + c_{2} = \frac{\pi}{2} \, e^{m^2} \, \text{erf}(m). $$
Obtaining the second equation to determine the coefficients $c_{1}$ and $c_{2}$ gives the desired result and is left to the reader.
In Gradshteyn, " Tables of integrals, series, and products ", p. 504, $(3.954)$ the formula
\begin{align}
I(\beta, a) &= \int_{0}^{\infty} x \, e^{- \beta \, x^2} \, \frac{\sin(a x) \, dx}{x^2 + \gamma^2}  \\
&= - \frac{\pi}{4} \, e^{\beta \, \gamma^2} \, \left( 2 \, \sinh(a \gamma) + e^{- a \gamma} \, \text{erf}\left( \gamma \, \sqrt{\beta} - \frac{a}{2 \, \sqrt{\beta}}\right) \right. \\
& \hspace{20mm} \left. - e^{a \gamma} \, \text{erf}\left( \gamma \, \sqrt{\beta} + \frac{a}{2 \, \sqrt{\beta}}\right) \right)
\end{align}
is given.
The same pattern can be applied with a first and second order differential equation. These are
\begin{align}
\frac{d^2 \, I}{d \, a^2} - \gamma^2 \, I &= \cdots \\
\frac{d \, I}{d \, \beta} - \gamma^2 \, I &= \cdots. 
\end{align}
Both of these equations have an exponential form on the right hand side and give solutions similar to the one in the example.
A: Let I(t) take the following form, where t is a nonnegative number
$$I(t)=\int_{-\infty}^\infty\frac{xe^{-t(x^2+m^2)}\sin{(2xz)}}{x^2+m^2}dx, I=\frac{1}{2}e^{m^2}I(1)$$
Take the derivative with respect to t
$$I'(t)=-\int_{-\infty}^\infty xe^{-t(x^2+m^2)}\sin{(2xz)}=-e^{-m^2t}\int_{-\infty}^\infty xe^{-tx^2}\sin{(2xz)}dx$$
By integrating by parts and continuing we get
$$I'(t)=\frac{-z}{t}e^{-m^2t}\int_{-\infty}^\infty e^{-tx^2}\cos{(2xz)}dx=\frac{-z}{t}e^{-m^2t}e^{z^2/t}\Re\int_{-\infty}^\infty e^{-t(x-iz/t)^2}dx$$$$=\frac{-z}{t}e^{-m^2t}e^{z^2/t}\Re\int_{-\infty}^\infty e^{-tx^2}dx=\frac{-z\sqrt{\pi}}{t\sqrt{t}}e^{-m^2t}e^{z^2/t}$$
Is that enough to point you in the right direction?
A: Assume that $b,z,m>0$.
Using the classical integral $$\int_{0}^{\infty} e^{-x^{2}} \cos(ax) \, \mathrm dx = \frac{\sqrt{\pi}}{2} e^{-a^{2}/4}, $$ and the related integral $$ \begin{align} \int_{0}^{\infty} e^{-bx^{2}} e^{-ax} \, \mathrm dx &=  e^{a^{2}/(4b)} \int_{0}^{\infty} e^{-b(x+a/(2b))^{2}} \, \mathrm dx \\ &= e^{a^{2}/(4b)} \int_{a/(2b)}^{\infty} e^{-bu^{2}} \, \mathrm du \\ &= \frac{e^{a^{2}/(4b)}}{\sqrt{b}} \int_{a/(2\sqrt{b})}^{\infty} e^{-v^{2}} \, \mathrm dv \\ &= \frac{ e^{a^{2}/(4b)}}{\sqrt{b}} \, \frac{\sqrt{\pi}}{2} \,  \operatorname{erfc} \left(\frac{a}{2 \sqrt{b}} \right), \end{align}$$ we have
$$ \begin{align} \int_{0}^{\infty} \frac{xe^{-x^{2}}\sin(2zx)}{m^{2}+x^{2}} \, \mathrm dx &= \int_{0}^{\infty} e^{-x^{2}} \sin(2zx) \int_{0}^{\infty} e^{-mt}\sin(xt)  \, \mathrm dt \, \mathrm dx \\ &= \int_{0}^{\infty} e^{-mt} \int_{0}^{\infty} e^{-x^{2}} \sin(2zx)  \sin(tx) \, \mathrm dx \, \mathrm dt \\ &= \frac{1}{2} \int_{0}^{\infty} e^{-mt} \int_{0}^{\infty} e^{-x^{2}}\left( \cos \left((t-2z)x \right) - \cos \left((t+2z) x\right) \right) \, \mathrm dx \, \mathrm dt \\ &= \frac{\sqrt{\pi}}{4} \int_{0}^{\infty} e^{-mt} \left(e^{-(t-2z)^{2}/4}-e^{-(t+2z)^{2}/4} \right) \, \mathrm dt \\ &= \frac{\sqrt{\pi}e^{-z^{2}}}{4} \int_{0}^{\infty} e^{-t^{2}/4} \left(e^{-(m-z)t} -  e^{-(m+z)t}\right) \mathrm dt \\ &= \frac{\pi e^{-z^{2}}}{4} \left(e^{(m-z)^{2}}  \operatorname{erfc} \left(m-z \right) -e^{(m+z)^{2}} \operatorname{erfc} \left(m+z\right)  \right) \\ &= \frac{\pi e^{m^{2}}}{4} \left(e^{-2zm}  \operatorname{erfc} \left(m-z \right) -e^{2zm} \operatorname{erfc} \left(m+z\right)  \right). \end{align}$$

Switching the order of integration is justified by Fubini's theorem since $$\int_{0}^{\infty} \int_{0}^{\infty} \left| e^{-x^{2}} \sin(2zx) e^{-mt} \sin(xt) \right|\, \mathrm dt \, \mathrm dx \le \int_{0}^{\infty} \int_{0}^{\infty} e^{-x^{2}} e^{-mt} \, \mathrm dt \, \mathrm dx = \frac{\sqrt{\pi}}{2m} < +\infty.$$
