Error of integration in numerical methods

Click For Summary

Discussion Overview

The discussion revolves around the error of integration in numerical methods, specifically comparing the midpoint method and the trapezoidal method. Participants explore the reasoning behind both methods exhibiting an error of order ##h^2## despite differing in the number of points used for integration. The scope includes theoretical considerations and conceptual clarifications related to numerical integration techniques.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant questions why the midpoint method (one-point) and trapezoidal method (two-point) both have an error of order ##h^2##, despite the difference in the number of points used.
  • Another participant suggests that the amount of error depends on assumptions about the function and notes that the trapezoidal method gives an exact answer for quadratic functions.
  • It is mentioned that the error behavior of ##O(h^2)## is independent of the specific function, with ##h## defined as ##b-a##.
  • Some participants discuss the presence of a coefficient in front of the ##h^2## term, indicating it depends on the assumed function, but emphasize that this does not affect the order of the error.
  • A participant provides an intuitive explanation of the midpoint method, suggesting that it compensates for areas above and below the curve, while the trapezoidal method does not achieve the same balance with only edge points.
  • Another participant questions the assumption of symmetry in the graph for the compensation argument, leading to a clarification that the graph does not need to be symmetric but can be symmetric up to the first order at the midpoint.

Areas of Agreement / Disagreement

Participants express differing views on the implications of the error order and the role of function assumptions. There is no consensus on the reasoning behind the error being ##O(h^2## for both methods, and the discussion remains unresolved regarding the nature of compensation in the midpoint method.

Contextual Notes

Participants acknowledge that the behavior of the error is influenced by the function being integrated, but the discussion does not resolve the specific conditions or assumptions that lead to the observed error orders.

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
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K