• Support PF! Buy your school textbooks, materials and every day products Here!

Error of integration in numerical methods

  • Thread starter Silviu
  • Start date
623
11
1. Homework Statement
So this is a problem for my numerical methods class. We are doing integration and derivation. The part that I am stuck on is why does the midpoint method and trapezoidal method both have error of order ##h^2##, when the first one is one point integration method while the second one is a 2 points. I know how the error goes like, so I don't need to prove it mathematically, I just need to give a logical explanation.

2. Homework Equations
Trapezoidal method: ##\int_a^b f = (b-a)\frac{f(b)+f(a)}{2}##
Midpoint method: ##\int_a^b f = (b-a)f(\frac{a+b}{2})##

3. The Attempt at a Solution
In derivation, one point methods go like ##O(h)## while 2-point methods like ##O(h^2)##, as in the 2 point methods, you have more information. But the same would be here so I am not sure why the error is different. I was thinking that ##f(\frac{a+b}{2})## uses an actual value belonging to f, while ##\frac{f(b)+f(a)}{2}## is not a value of f, but I am not sure. Can someone help me? Thank you!
 

Answers and Replies

Charles Link
Homework Helper
Insights Author
Gold Member
2018 Award
4,440
1,887
I think in general the amount of error will depend upon some assumptions made about the function. I believe the trapezoidal method (editing: Simpson's rule, not trapezoidal) actually gives an exact answer when integrating a quadratic function.
 
Last edited:
623
11
I think in general the amount of error will depend upon some assumptions made about the function. I believe the trapezoidal method actually gives an exact answer when integrating a quadratic function.
But the error going like ##O(h^2)## is independent of the function, with h = b-a
 
Charles Link
Homework Helper
Insights Author
Gold Member
2018 Award
4,440
1,887
There is a coefficient in front of the ## h^2 ##. To some degree that coefficient will depend upon the function that is assumed.
 
623
11
There is a coefficient in front of the ## h^2 ##. To some degree that coefficient will depend upon the function that is assumed.
But the coefficient has nothing to do with the way error behaves. ##O(h^2)## means a constant times ##h^2##, which indeed depends on the function. My question is not about the constant, but about why it is a constant times ##h^2## in both cases and not other power of h?
 
I like Serena
Homework Helper
6,553
176
Hi Silviu,

Intuitively the midpoint gives us a rectangle such that the part of the graph that is below (or above) on the left, is compensated by the part of the graph that is above (or below) on the right.
With a point on the left at a, we don't have such compensation. It's only with a point on the right at b, that we can get a similar compensation.
In other words, points at the edge only give us half of the information we need.
 
623
11
Hi Silviu,

Intuitively the midpoint gives us a rectangle such that the part of the graph that is below (or above) on the left, is compensated by the part of the graph that is above (or below) on the right.
With a point on the left at a, we don't have such compensation. It's only with a point on the right at b, that we can get a similar compensation.
In other words, points at the edge only give us half of the information we need.
Hello! I am not sure I understand what do you mean by compensation. Doesn't this imply that the graph must be symmetric around that point? Why would it always be?
 
I like Serena
Homework Helper
6,553
176
Hello! I am not sure I understand what do you mean by compensation. Doesn't this imply that the graph must be symmetric around that point? Why would it always be?
The graph doesn't have to be symmetric around the midpoint, but it will be symmetric up to the first order (the tangent line at the midpoint). That's why it's O(h2).
 

Related Threads for: Error of integration in numerical methods

  • Last Post
Replies
19
Views
1K
  • Last Post
Replies
3
Views
3K
Replies
9
Views
9K
Replies
5
Views
822
Replies
11
Views
3K
Replies
16
Views
1K
Replies
10
Views
11K
Replies
2
Views
3K
Top