Integrating the Gaussian kernel with absolute value

1.4k Views Asked by At

How do I integrate: $$\dfrac{1}{\sqrt{4\pi t}}\int_{-\infty}^{\infty}|y|e^{\frac{-(\xi-y)^2}{4t}}dy,$$ in terms of of the error function, erf$(x)=\dfrac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}dt$. I have done some substitutions that result in things like $\int_{\infty}^z$ which I think does not make sense.

1

There are 1 best solutions below

6
On BEST ANSWER

$$\dfrac{1}{\sqrt{4\pi t}}\int_{-\infty}^{\infty}|y|e^{\frac{-(\xi-y)^2}{4t}}dy$$ $$=\dfrac{1}{\sqrt{4\pi t}}\int_{0}^{\infty}ye^{\frac{-(\xi-y)^2}{4t}}dy + \dfrac{1}{\sqrt{4\pi t}}\int_{-\infty}^{0}(-y)e^{\frac{-(\xi-y)^2}{4t}}dy$$ $$=\dfrac{1}{\sqrt{4\pi t}}\int_{0}^{\infty}ye^{\frac{-(\xi-y)^2}{4t}}dy - \dfrac{1}{\sqrt{4\pi t}}\int_{0}^{-\infty}(-y)e^{\frac{-(\xi-y)^2}{4t}}dy$$ $$=\dfrac{1}{\sqrt{4\pi t}}\int_{0}^{\infty}ye^{\frac{-(\xi-y)^2}{4t}}dy + \dfrac{1}{\sqrt{4\pi t}}\int_{0}^{\infty}ye^{\frac{-(\xi+y)^2}{4t}}dy$$ Then, integrating by parts ($u = y$, $\mathrm{d}v = \mathrm{e}^{\dots} $) and using that $\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x\mathrm{e}^{-t^2}\mathrm{d}t$, then performing the next pair of integrals by shifting $\xi$ away...:

$$=\sqrt{\frac{t}{\pi}}\mathrm{e}^{-\frac{\xi^2}{4t}} + \frac{\xi}{2}\left(1+\mathrm{erf} \frac{\xi}{2\sqrt{t}}\right) + \sqrt{\frac{t}{\pi}}\mathrm{e}^{-\frac{\xi^2}{4t}} - \frac{\xi}{2}\left(1-\mathrm{erf} \frac{\xi}{2\sqrt{t}}\right)$$ and this simplifies to $$=2\sqrt{\frac{t}{\pi}}\mathrm{e}^{-\frac{\xi^2}{4t}} + \xi\left(\mathrm{erf} \frac{\xi}{2\sqrt{t}}\right)$$