Integrate $\frac{1}{ \sqrt{T^2 - \tau^2}}\exp\left(-\frac{a^2}{4 (T + \tau )} - \frac{b^2}{4 (T-\tau )}\right)$ I want to compute the integral
$$
\int_t^T \int_{-\infty}^\infty \frac{1}{ \sqrt{\tau - t} (T-\tau)} \exp\left(-\frac{(z-x)^2}{2(\tau - t)} -\frac{(z-v)^2 + (z-w)^2}{2(T-\tau)} \right) d z d \tau.
$$
First integrating with respect to $z$ I get
$$ 
\int_t^T \frac{\sqrt{2\pi}}{ \sqrt{T - \tau}\sqrt{-2 t + \tau + T}}\exp\left(-\frac{(v + w - 2 x)^2}{4 (-2 t + \tau + T)} - \frac{(v-w)^2}{4 (T-\tau )}\right) d \tau.
$$
So to go further I think I should be able to integrate
$$
\int_0^T \frac{1}{ \sqrt{T^2 - \tau^2}}\exp\left(-\frac{a^2}{4 (T + \tau )} - \frac{b^2}{4 (T-\tau )}\right) d \tau
$$
 A: $$I=\underbrace{\int_0^{T}\frac{d\tau}{\sqrt{T^2-\tau^2}}\exp\left(-\frac{a^2}{4(T+\tau)}-\frac{b^2}{4(T-\tau)}\right)}\\{\tau\rightarrow \frac{T(1-y^2)}{1+y^2}}$$
$$=\exp\left(-\frac{a^2+b^2}{8T}\right)\int_0^{1} \frac{dy}{1+y^2}\exp\left(-\frac{a^2y^2+\frac{b^2}{y^2}}{8T}\right)$$
Let's parametrize the integral in order to build two ODE: $$ f(\alpha,\beta)=\int_0^{1} \frac{dy}{1+y^2}\exp\left(-\alpha^2y^2-\frac{\beta^2}{y^2}\right)$$
$$g(\alpha,\beta)=f(\alpha ,\beta)-\frac{1}{2\alpha}\frac{\partial f}{\partial\alpha}=\int_{0}^{1}\exp\left(-\alpha^2y^2-\frac{\beta^2}{y^2}\right)dy$$
Now, let's use $g(\alpha,\beta)$ to solve the remaining integral: $$\alpha g(\alpha,\beta)+\frac{1}{2}\frac{\partial g}{\partial\beta}=\exp\left(2\alpha\beta\right)\int_{0}^{1}\left(\alpha-\frac{\beta}{y^2}\right)\exp\left[-\left(\alpha y+\frac{\beta}{y}\right)^2 \right]dy=-\frac{\sqrt{\pi}}{2}\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)$$
$$\frac{\partial g}{\partial\beta}+2\alpha g(\alpha,\beta)=-\sqrt{\pi}\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)$$
$$\mu_1(\beta)=\exp\left(\int 2\alpha d\beta\right)=\exp\left(2\alpha\beta\right)$$
$$\exp\left(2\alpha\beta\right)\frac{\partial g}{\partial\beta}+2\alpha\exp\left(2\alpha\beta\right) g(\alpha,\beta)=-\sqrt{\pi}\exp\left(4\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)$$
$$\left(\exp\left(2\alpha\beta\right)g(\alpha,\beta)\right)'=-\sqrt{\pi}\int \exp\left(4\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)d\beta=-\frac{\sqrt{\pi}}{4\alpha}\left(\exp\left(4\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\operatorname{erf}\left(\alpha-\beta\right)\right)$$
$$g\left(\alpha,\beta\right)=-\frac{\sqrt{\pi}}{4\alpha}\left(\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\exp\left(-2\alpha\beta\right)\ \operatorname{erf}\left(\alpha-\beta\right)\right)+c$$
$$g\left(\alpha,0\right)=\int_{0}^{1}\exp\left[-\left(\alpha y\right)^2 \right]dy=\frac{\sqrt{\pi}}{2\alpha}\ \operatorname{erf}\left(\alpha\right)=-\frac{\sqrt{\pi}}{4\alpha}\left(\ \operatorname{erfc}\left(\alpha\right)-\ \operatorname{erf}\left(\alpha\right)\right)+c\\ c=\frac{\sqrt{\pi}}{4\alpha}$$
$$\boxed{g\left(\alpha,\beta\right)=-\frac{\sqrt{\pi}}{4\alpha}\left(\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\exp\left(-2\alpha\beta\right)\ \operatorname{erf}\left(\alpha-\beta\right)-1\right)}$$
Using this result in the first ODE: $$f(\alpha ,\beta)-\frac{1}{2\alpha}\frac{\partial f}{\partial\alpha}=-\frac{\sqrt{\pi}}{4\alpha}\left(\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\exp\left(-2\alpha\beta\right)\ \operatorname{erf}\left(\alpha-\beta\right)-1\right)$$
$$\frac{\partial f}{\partial\alpha}-2\alpha f(\alpha ,\beta)=\frac{\sqrt{\pi}}{2}\left(\exp\left(2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\exp\left(-2\alpha\beta\right)\ \operatorname{erf}\left(\alpha-\beta\right)-1\right)$$
$$\mu_2(\alpha)=\exp\left(-\int 2\alpha d\alpha\right)=\exp\left(-\alpha^2\right)$$
$$\left(\exp\left(-\alpha^2\right)f(\alpha,\beta)\right)'=\frac{\sqrt{\pi}}{2}\int\left(\exp\left(-\alpha^2+2\alpha\beta\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\exp\left(-\alpha^2-2\alpha\beta\right)\ \operatorname{erf}\left(\alpha-\beta\right)-\exp\left(-\alpha^2\right)\right)d\alpha$$
$$=-\frac{\operatorname{erf}\left(\alpha\right)\sqrt{\pi}}{2}+\frac{e\sqrt{\pi}}{2}\int\left(\underbrace{\exp\left(-\left(\alpha-\beta\right)^2\right)\ \operatorname{erfc}\left(\alpha+\beta\right)}_{IBP}-\exp\left(-\left(\alpha+\beta\right)^2\right)\ \operatorname{erf}\left(\alpha-\beta\right)\right)d\alpha$$
$$=-\frac{\operatorname{erf}\left(\alpha\right)\sqrt{\pi}}{2}+\frac{e\sqrt{\pi}}{2}\left(-\frac{\sqrt{\pi}}{2} \operatorname{erf}\left(\beta-\alpha\right)\ \operatorname{erfc}\left(\alpha+\beta\right)-\int\left(\underbrace{\operatorname{erf}\left(\beta-\alpha\right)+\operatorname{erf}\left(\beta+\alpha\right)}_{0}\right)\exp\left(-(\alpha+\beta)^2\right)d\alpha\right)$$
$$f(\alpha ,\beta)=-\frac{\sqrt{\pi}\operatorname{erf}\left(\alpha\right)e^{\alpha^2}}{2}-\frac{\pi e^{a^2+1}}{4}\left(\operatorname{erf}\left(\beta-\alpha\right)\ \operatorname{erfc}\left(\alpha+\beta\right)\right)+k$$
$$f(0,0)=\int_0^1\frac{dy}{1+y^2}=\frac{\pi}{4}=k$$
$$\boxed{f(\alpha,\beta)=-\frac{\sqrt{\pi}e^{\alpha^2}}{2}\operatorname{erf}\left(\alpha\right)-\frac{\pi e^{\alpha^2+1}}{4}\left(\operatorname{erf}\left(\beta-\alpha\right)\ \operatorname{erfc}\left(\alpha+\beta\right)\right)+\frac{\pi}{4}}$$
Therefore, the original integral is equal to: $$I=\exp\left(-\frac{a^2+b^2}{8T}\right)f\left(\frac{a}{2\sqrt{2T}},\frac{b}{2\sqrt{2T}}\right)=$$
$$ \bbox[5px,border:2px solid red] { \frac{\pi}{4}\exp\left(-\frac{a^2+b^2}{8T}\right)-\frac{\sqrt{\pi}}{2} \exp\left(-\frac{b^2}{8T}\right)\ \operatorname{erf}\left(\frac{a}{2\sqrt{2T}}\right)-\frac{\pi}{2} \exp\left(-\frac{b^2}{8T}+1\right)\ \operatorname{erf}\left(\frac{b-a}{2\sqrt{2T}}\right)\ \operatorname{erfc}\left(\frac{b+a}{2\sqrt{2T}}\right) } $$
