Trapezoid method converges faster than the Simpson method

In summary, the conversation discusses the observation that the trapezoid method converges faster than the Simpson method when integrating a first class elliptical integral. One hypothesis for this is that the second and fourth derivatives diverge at pi/2, making it difficult to calculate the maximum error level. The conversation also mentions that the trapezoid rule is a good technique for smooth, periodic integrands and that both methods have upper bounds for error. The conversation ends with a question about why the trapezoid method converges faster in this particular case.
  • #1
Cloruro de potasio
31
1
TL;DR Summary
Is it possible that the trapezoid method converges faster than the simpson method?
Good Morning,

I have been doing computer practices in C ++, and for an integration practice, the trapezoid method converges faster than the Simpson method. The function to be integrated is a first class elliptical integral of the form:
ppp.png

Where k is bounded between [0,1). I have been thinking about the reason for this fact, and one of the hypotheses I have is that both the second derivative (which is used to determine the error level of the trapezoid method), and the fourth (which is used to determine the Simpson method error level), diverge in pi / 2, so it is not possible to calculate the maximum error level.

This is the graph that I get for the decimal logarithm of the error vs the number of intervals used:

simpson.jpg

Does anyone know why this happens?
 
Technology news on Phys.org
  • #2
I believe this has to do with the fact that the trapezoidal rule converges very quickly when integrating a periodic function over an entire period. You are only integrating over half of the period, but your integrand has symmetry so your integral is simply 1/2 of the integral over the full period and you should still get the fast convergence.

The trapezoidal rule really is a go-to technique for smooth, periodic integrands.
 
  • #3
Okay, thanks, and this phenomenon, why does it happen? I've been searching on several websites but I don't understand very well ...
 
  • #4
Cloruro de potasio said:
Summary:: Is it possible that the trapezoid method converges faster than the simpson method?

I have been thinking about the reason for this fact, and one of the hypotheses I have is that both the second derivative (which is used to determine the error level of the trapezoid method), and the fourth (which is used to determine the Simpson method error level), diverge in pi / 2, so it is not possible to calculate the maximum error level.

For the trapezoidal approach, an upper bound for the absolute value of error is

##|E_T| \leq \frac{b - a}{12}h^2 max|f''(x)|##, where the integral is calculated between ##a## and ##b## on the ##x##-axis and ##h = \Delta x = \frac{b - a}{n}##, ##n## is the number of sub-intervals, ##max## refers to the interval ##[a, b]## and ##f''## is continuous on ##[a, b]##.

In practice, we usually cannot find the exact value of ##max|f''(x)|##, so we have to estimate a reasonable upper bound or the worst possible value of error instead. So, if ##M## is any upper bound of ##max|f''(x)|## then ##|E_T| \leq \frac{b - a}{12}h^2 M##. We find the best possible value for ##M## and then proceed to evaluate ##E_T##. In order to decrease ##E_T## for a given ##M## we decrease ##h##.

For Simpson Rule, a useful (absolute) value for error is

##|E_S| \leq \frac{b - a}{180} h^4 max |f^{(4)}(x)|##, where ##max## refers to the interval ##[a, b]## and ##f^{(4)}## is continuous on ##(a, b)##. As in the trapezoidal approach, we usually cannot find the exact value of ##max |f^{(4)}(x)|## along the integration interval. So, again, we find some reasonable upper bound ##M##.

For the first of the above formulas of upper bounds of error, we start from the Mean Value Theorem and extend it, so we get that if ##f## and ##f'## are continuous on ##[a,b]## and ##f'## is differentiable on ##(a,b)##, there is a number ##c## on ##(a,b)## such that ##\int_{a}^{b} f(x)dx = T - \frac{b - a}{12} h^2 f''(c)## and for the second, we start from the Generalized Mean Value Theorem. For the proof of both of these you can search on the net.
 
Last edited:
  • #5
Okay, thanks, I knew these formulas, what happens is that since you have to integrate between 0 and 2π and in 2π the second and fourth derivatives diverge, it is difficult to get the maximum error level ...

And is there any explanation why, in this particular case, the trapezoid method converges faster?
 

FAQ: Trapezoid method converges faster than the Simpson method

What is the Trapezoid method?

The Trapezoid method is a numerical integration technique used to approximate the area under a curve. It involves dividing the area into trapezoids and summing their individual areas.

What is the Simpson method?

The Simpson method is another numerical integration technique that uses quadratic polynomials to approximate the area under a curve. It involves dividing the area into smaller segments and using a combination of trapezoidal and parabolic approximations.

How does the Trapezoid method converge faster than the Simpson method?

The Trapezoid method converges faster than the Simpson method because it uses smaller segments, resulting in a more accurate approximation of the area under the curve. The Simpson method uses larger segments and may require more iterations to achieve the same level of accuracy.

What factors can affect the convergence rate of the Trapezoid and Simpson methods?

The convergence rate of both methods can be affected by the number of segments used, the complexity of the function being integrated, and the desired level of accuracy. In general, the Trapezoid method will converge faster when the function is smoother and has fewer variations.

Are there any limitations to using the Trapezoid and Simpson methods?

Both methods have limitations in terms of the types of functions they can accurately integrate. The Trapezoid method may underestimate the area if the function has sharp peaks or valleys, while the Simpson method may overestimate the area if the function has oscillations. In these cases, other numerical integration methods may be more suitable.

Similar threads

Replies
20
Views
2K
Replies
2
Views
1K
Replies
8
Views
4K
Replies
13
Views
2K
Replies
2
Views
1K
Back
Top