# Fortran Double integration over infinite intervals in Fortran

#### 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.....

Related Programming and Computer Science News on Phys.org

#### S.G. Janssens

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

#### eys_physics

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.....
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.

#### Monika Randhawa

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

"Double integration over infinite intervals in Fortran"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving