# Fortran Double integration over infinite intervals in Fortran

1. Nov 10, 2016

### Monika Randhawa

Hi.. I am stuck up with a double integration where one of the integration limit is infinity. I know quadpack (qagi) can handle integration over infinite intervals. But how to make it work for the double integration. Or if there is any other routine that can handle both double integration and integration over infinite intervals. Thanks.....

2. Nov 14, 2016

### Krylov

It would likely help if you could post the integral or give an indication of its nastiness. The possible answers may depend on that.

3. Nov 14, 2016

### eys_physics

I don't know about any Fortran library having this. However, I believe that unless your integral is very difficult, e.g. having singularities, the best option is to develop your own integration routine. This is not difficult if you have some experience in Fortran programming. In this way you can also adapt the routine to your needs.
Essentially, for an integration over $[0,\infty]$ you have to cases:
Let's call the variable with infinite limit $x$.
1) if the integrand decays exponentially to 0 as $x\rightarrow \infty$, you should use a Gauss-Laguerre rule
2) if the integrand decays more slowly than exponentially to 0 as $x\rightarrow \infty$, the best option is usually to use a mapping to $[0,1]$ and then a Gauss-Legendre rule

I cannot give you more specific information without knowing the problem in more detail.

4. Nov 14, 2016

### Monika Randhawa

Thanks....... Let me try this.