How Can Simpson's Rule Be Adjusted for Functions Undefined at Boundary Points?

Click For Summary
SUMMARY

This discussion focuses on adjusting Simpson's Rule for numerical integration when functions are undefined at boundary points. Users often add a small constant to the boundaries, such as evaluating the integral at [a+10^-6,b] for (a,b]. Alternatives like Gaussian quadrature are recommended for better efficiency and accuracy. The conversation also highlights the concept of removable singularities, where functions can be redefined at specific points, and the importance of understanding function behavior near undefined points to avoid divergence.

PREREQUISITES
  • Understanding of numerical integration methods, specifically Simpson's Rule.
  • Familiarity with concepts of removable singularities in calculus.
  • Knowledge of Gaussian quadrature as an alternative numerical integration method.
  • Basic proficiency in R programming for numerical analysis.
NEXT STEPS
  • Research the implementation of Gaussian quadrature in R for improved numerical integration.
  • Study the concept of removable singularities and how to redefine functions at those points.
  • Explore advanced numerical integration techniques beyond Simpson's Rule.
  • Learn about handling divergent integrals and boundary cutoffs in numerical methods.
USEFUL FOR

Mathematicians, data scientists, and software developers involved in numerical analysis and integration, particularly those using R for computational tasks.

saminny
Messages
9
Reaction score
0
Hi,

I've using numerical integration method (Simpson rule) to evaluate a definite integral in the interval [a,b]. I was wondering what is the ideal way to approximate the integral in the boundary [a,b) or (a,b] or (a,b) when for example, the function inside the integral does not exist at that point. What I usually do is add a small constant to the open boundary, for example to evaluate integral at (a,b], I will evaluate at [a+10^-6,b]. What are your thoughts?

Secondly, are there any numerical integration methods available in R?

thanks,

Sam
 
Physics news on Phys.org
Two things.

Firstly, which Simpson's rule is relatively easy to code, in practice it wouldn't be touched with a ten foot pole because it is so inefficient. Gauusian quadrature provide a much better results with less resources and if your integrals are taking a long time you should look into such methods.

Secondly, if the function does not exist at a single point you may still be able to evaluate the integral appropriately. If the function has a "removable singularity" at the point, e.g. sin(x)/x at x=0, then you can simply redefine the equation at that point and everything will work.

However, sometimes the problem is not the undefined point, but the behaviour of the function leading up to that point as well. e.g. 1/x^2 near x=0. You simply can't evaluate the integral on [0,b] or (0,b] as fundamentally it will diverge to infinity no matter how you go about it. In this second case, a boundary cutoff of the type you are using may have to be employed.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
31
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K