Are errors important in calculating integrals in Python?

Click For Summary

Discussion Overview

The discussion centers around the importance of considering errors when calculating integrals using numerical methods in Python, specifically focusing on Simpson's Rule and the Trapezoidal Rule as presented in Mark Newman's Computational Physics textbook. The conversation explores the implications of error estimation in both simple and complex integrals.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant questions the necessity of worrying about the error in integral calculations.
  • Another participant argues that understanding error is crucial for determining the accuracy of numerical methods, especially for functions that change rapidly.
  • There is a discussion about the comparative accuracy of the midpoint method versus the trapezoidal rule, noting that the midpoint method can yield better results despite the trapezoidal method having a higher order.
  • Some participants clarify the distinction between definite and indefinite integrals, emphasizing that the techniques discussed are meant for approximating definite integrals.
  • One participant expresses realization about the focus on definite integrals after initial confusion regarding simple integrals.

Areas of Agreement / Disagreement

Participants exhibit a mix of understanding and confusion regarding the importance of error in integral calculations. While some agree on the necessity of error estimation, others initially question its relevance, indicating a lack of consensus on the topic.

Contextual Notes

The discussion highlights the difference between symbolic antiderivatives and numerical techniques for definite integrals, but does not resolve the broader implications of error estimation in various contexts.

Samuel Rodriguez
Messages
3
Reaction score
0
I am reading Mark Newman's Computational Physics textbook. He goes over calculating integrals with Simpsons's Rule and the Trapezoidal Rule, and then he goes over calculating their errors. Why would I have to ever worry about the error of the integral?

He has the chapters online at his website:

http://www-personal.umich.edu/~mejn/cp/chapters.html

He begins to go over this in chapter 5 on page 150.
 
Technology news on Phys.org
Why wouldn't you worry about it? For example you can prove that the midpoint method is actually better (in the sense it's accurate to a higher order) than the trapezoid rule even through the order of the method itself is higher for the trapezoid method which would be somewhat counter-intuitive.

Furthermore when actually implementing a method you really need to estimate the error or you don't know if the result you get is accurate at all. Functions that change rapidly are much harder to integrate so you need a smaller step size (or perhaps a different method). Often you want the method to be accurate to a certain number of decimals for a specific problem.
 
  • Like
Likes   Reactions: Samuel Rodriguez
Oh I see. I was thinking of simple integrals ∫x2+ 2 dx lol. I wasn't thinking of harder integrals.
 
Samuel Rodriguez said:
Oh I see. I was thinking of simple integrals ∫x2+ 2 dx lol. I wasn't thinking of harder integrals.
The material you're reading has to do with definite integrals, such as ##\int_1^3 x^2 + 2 dx##, not indefinite integrals.

There's a huge difference between finding a symbolic antiderivative (as in ##\int x^2 + 2 dx##), and using numerical techniques to estimate a definite integral. The techniques mentioned in this thread are used to approximate definite integrals.
 
Mark44 said:
The material you're reading has to do with definite integrals, such as ##\int_1^3 x^2 + 2 dx##, not indefinite integrals.

There's a huge difference between finding a symbolic antiderivative (as in ##\int x^2 + 2 dx##), and using numerical techniques to estimate a definite integral. The techniques mentioned in this thread are used to approximate definite integrals.
I understand you. It makes more sense. Thank you.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 2 ·
Replies
2
Views
17K
Replies
5
Views
2K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
1K