How to Integrate a Function with Steep Rise for Small x?
- Level: Graduate
- Thread starter DrDu
- Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 2K views
Physics news on Phys.org
Discussion
Science Advisor
Education Advisor
- 1,222
- 820
The integrand is not singular at ##x = 0## so you could use a standard routine for adaptive quadrature, as implemented in the standard software (Maple, Mathematica, MATLAB, Octave, etc.). This will select a smaller mesh width near ##x = 0## and allow for a larger mesh width for large ##x##.
If you insist on doing it yourself, it is not so hard to implement one of the usual rules (e.g. trapezoidal or Simpson's) adaptively through recursion. Most NA books discuss this. If you need references, let me know. To deal with the limit at infinity, just restrict to a large but finite interval. Because of your behavior for large ##x##, it will be easy to get a bound on the contribution to the error.
If you insist on doing it yourself, it is not so hard to implement one of the usual rules (e.g. trapezoidal or Simpson's) adaptively through recursion. Most NA books discuss this. If you need references, let me know. To deal with the limit at infinity, just restrict to a large but finite interval. Because of your behavior for large ##x##, it will be easy to get a bound on the contribution to the error.
Science Advisor
- 6,424
- 1,006
Thank you for your answer Krylov!
Adaptive quadrature is too slow for my purposes as I will have to evaluate integrals of this kind many thousand times. I think now about splitting the integral e.g. at x=1, use y=-a/x as new integration variable for x<1 and use Gauss-Laguerre integration on both regions.
Adaptive quadrature is too slow for my purposes as I will have to evaluate integrals of this kind many thousand times. I think now about splitting the integral e.g. at x=1, use y=-a/x as new integration variable for x<1 and use Gauss-Laguerre integration on both regions.
Similar threads
- jk22
- · Replies 8 ·
- Calculus
- Replies
- 8
- member 428835
- · Replies 5 ·
- AI and Computer Science
- Replies
- 5
- mathmari
- · Replies 2 ·
- Calculus
- Replies
- 2
- Mutatis
- · Replies 3 ·
- Calculus and Beyond Homework Help
- Replies
- 3
- Vitani11
- · Replies 6 ·
- Calculus and Beyond Homework Help
- Replies
- 6
- blenx
- · Replies 5 ·
- Calculus
- Replies
- 5
Undergrad
How to integrate function 1/(x^2+a) ?
- Holali
- · Replies 1 ·
- Calculus
- Replies
- 1
- Mathpower
- · Replies 17 ·
- Calculus and Beyond Homework Help
- Replies
- 17
- lazypast
- · Replies 17 ·
- Calculus
- Replies
- 17
- dgamma3
- · Replies 4 ·
- Differential Equations
- Replies
- 4