Error of integration in numerical methods

AI Thread Summary
The discussion centers on the error of integration in numerical methods, specifically comparing the midpoint and trapezoidal methods, both of which exhibit an error of order O(h^2). The midpoint method uses a single point at the center of the interval, while the trapezoidal method averages the function values at the endpoints. The key reasoning is that the midpoint provides a better approximation by balancing the areas above and below the curve, leading to a consistent error behavior. Both methods yield O(h^2) because they rely on the function's behavior near the midpoint, which is approximated well by a quadratic function. Ultimately, the error's dependence on the function's characteristics is acknowledged, but the order remains the same due to the nature of the approximations used.
Silviu
Messages
612
Reaction score
11

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.

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})##

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!
 
Physics news on Phys.org
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:
Charles Link said:
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
 
There is a coefficient in front of the ## h^2 ##. To some degree that coefficient will depend upon the function that is assumed.
 
Charles Link said:
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?
 
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.
 
I like Serena said:
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?
 
Silviu said:
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).
 

Similar threads

Replies
9
Views
2K
Replies
3
Views
1K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
6
Views
2K
Replies
6
Views
3K
Back
Top