# How to compute this double integral?

Let

$$T=1, K=100, S_0=100, \sigma=0.05, r=0.15.$$

Define $\nu:=\frac{2r}{\sigma^2}-1$ and $$H(y,z)=\frac{z e^{\pi^2 /4y}}{\pi \sqrt{\pi y}}\int_0^{\infty} e^{-z \cosh(u) -u^2/(4y)} \sinh(u) \sin(\frac{\pi u}{2y})du$$ then next define $$f(y,z)=\left( \frac{z}{S_0}\right)^{\nu/2}\frac{1}{4KT}\exp\left(-\frac{2(S0+z)}{KT\sigma^2}-\frac{\nu^2\sigma^2y}{8} \right) \times H(\frac{\sigma^2y}{8},\frac{4\sqrt{S_0 z}}{KT\sigma^2})$$ and $$g(y,z)=z\frac{e^{-ry}-e^{-rT}}{rT}$$ I would like to compute the following double integral $$I=\int_0^{\infty}\left[\int_0^T g(y,z)f(y,z)dy\right]dz.$$

When I tried this with Maple, please see the picture below, it ran out of memory.

I would like to ask whether there is a way to compute the above integral? What should I do to compute the integral?

• I think the probable cause is the infinite oscillatory integral $H$, whose integrand decays exponentially with $z$, but $z$ starts at $0$, and so does $y$, making it decrease too slowly and oscillate too quickly for default schemes to converge quickly enough. Running out of memory is maybe not too relevant here, that's too implementation-specific. Aug 8 '15 at 23:06
• The $e^{\pi^2/(4y)}$ term is not too helpful either near $y=0$, that is a very bad singularity. Is there some context to this? It doesn't look to me like the integral converges at $y=0$. Where does this integral come from, and what are you actually trying to compute? Aug 8 '15 at 23:17
• Dear Kirill, I am trying to compute the value of an exotic option. I would like to ask : is there any way to remove the singularity at $y=0$ ? Thank you for your comments. Aug 9 '15 at 1:36
• In this form it's difficult, I think it's better just to redo your calculations making sure not to introduce transformations that lead to ill-behaved terms like $e^{\pi^2/4y}\sin \frac{\pi u}{2y}$. At the very least you should prove that the integral converges at all before asking for its numerical value. But those are separate calculus questions, more suitable for math.SE. Aug 9 '15 at 2:00
• Thanks Kirill, I have recalculated more than 10 times : (( and I believe this is what I got. It cannot be wrong. Aug 9 '15 at 2:06