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

In summary, numerical integration methods such as Simpson's rule may not be the most efficient option and should be replaced with methods like Gaussian quadrature. Additionally, if the function has a removable singularity at the boundary point, it can be redefined to properly evaluate the integral. However, if the function behaves poorly leading up to the boundary point, a boundary cutoff method may need to be used. There are numerical integration methods available in R, such as the integrate function.
  • #1
saminny
9
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
  • #2
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.
 

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

1. What is numerical integration Simpson method?

Numerical integration Simpson method is a numerical technique used to approximate the value of a definite integral by dividing the interval into smaller subintervals, and using a quadratic polynomial to approximate the curve within each subinterval.

2. How does numerical integration Simpson method work?

The method works by first dividing the interval into an even number of subintervals. Then, it uses the values of the function at the endpoints and the midpoint of each subinterval to construct a quadratic polynomial. This polynomial is then integrated to approximate the area under the curve within each subinterval, and the results are summed to approximate the total area under the curve.

3. What are the advantages of using numerical integration Simpson method?

Compared to other numerical integration methods, such as the trapezoidal rule, Simpson's method tends to provide more accurate results. It also requires fewer function evaluations, making it more efficient for complex functions.

4. What are the limitations of numerical integration Simpson method?

One limitation of Simpson's method is that it can only be applied to functions that are smooth and continuous over the entire interval. It also requires the interval to be divided into an even number of subintervals, which may not always be possible for certain functions.

5. How do you determine the accuracy of numerical integration Simpson method?

The accuracy of Simpson's method can be determined by using a known integral and comparing the approximated value to the exact value. The number of subintervals used can also affect the accuracy, with a higher number of subintervals resulting in a more accurate approximation.

Similar threads

Replies
2
Views
1K
Replies
2
Views
2K
Replies
2
Views
196
Replies
5
Views
3K
Replies
2
Views
4K
Replies
5
Views
4K
Replies
19
Views
3K
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top