A two-dimensional integral related to a Gaussian distribution I am trying to evaluate the integral
$I=\int_a^b\int_a^b\frac{1}{\sqrt{2\pi}\theta}e^{-\frac{(x-y)^2}{2\theta^2}}dxdy$.
With the aid of Mathematica software, the result is
$I=\left(e^{-\frac{(a-b)^2}{2\theta^2}}-1\right)\sqrt\frac{2}{\pi}\theta+(a-b)\,\text{Erf}\left(\frac{a-b}{\sqrt2\theta}\right)$
where $\text{Erf}(\bullet)$ is error function. 
Anyone has idea about detailed derivation of this result?
 A: Based on Winther's suggestion, I successfully have the results as follows:
$\frac{{\left( {x - y} \right)}}{{\sqrt 2 \theta }} = t \Rightarrow x = \sqrt 2 t \theta  + y\\
 = \int_a^b {\left( {\int_{\frac{{b - y}}{{\sqrt 2 \theta }}}^{\frac{{b - y}}{{\sqrt 2 \theta }}} {\frac{1}{{\sqrt {2\pi } \theta }}{e^{ - {t^2}}}\sqrt 2 \theta dt} } \right)} dy\\
 = \frac{1}{2}\int_a^b {\left( {{\rm{Erf}}\left( {\frac{{b - y}}{{\sqrt 2 \theta }}} \right) - {\rm{Erf}}\left( {\frac{{a - y}}{{\sqrt 2 \theta }}} \right)} \right)} dy\\
{\rm{ = }}\frac{1}{2}\left[ {\sqrt 2 \theta \left. {\left( {u{\rm{Erf}}\left( u \right) + \frac{{{e^{ - {u^2}}}}}{{\sqrt \pi  }}} \right)} \right|_0^{\frac{{b - a}}{{\sqrt 2 \theta }}} + \sqrt 2 \theta \left. {\left( {u{\rm{Erf}}\left( u \right) + \frac{{{e^{ - {u^2}}}}}{{\sqrt \pi  }}} \right)} \right|_0^{\frac{{a - b}}{{\sqrt 2 \theta }}}} \right]\\
 = {\left( {{e^{ - {{\left( {\frac{{b - a}}{{\sqrt 2 \theta }}} \right)}^2}}} - 1} \right)\sqrt {\frac{2}{\pi }} \theta  + \left( {b - a} \right){\rm{Erf}}\left( {\frac{{b - a}}{{\sqrt 2 \theta }}} \right)}$ 
