The Significance of Simpsons Rule for Quadratic Polynomials

  • Thread starter Thread starter lampCable
  • Start date Start date
lampCable
Messages
22
Reaction score
1

Homework Statement


Consider the ansatz
\frac{1}{b-a}\int_a^bf(x)dx \approx \alpha_1f(a)+\alpha_2f(\frac{b-a}{2})+\alpha_3f(b)
We can determine the values of \alpha_1,\alpha_2,\alpha_3 by requiring the approximation to be exact for quadratic polynomials, which yeilds Simpsons rule.

Why there is no loss of generality in assuming that a = -1 and b = 1?

Homework Equations

The Attempt at a Solution

 
Physics news on Phys.org
lampCable said:
Why there is no loss of generality in assuming that a=−1a = -1 and b=1b = 1?
Hi lampCable:

Here is a hint.

You can make a linear substitution y = px+q such that y(a) = -1 and y(b) = +1. Since f(x) is a quadratic polynomial in e, f(y) will also be a quadratic polynomial of y.

Hope that helps.

Regards,
Buzz
 
  • Like
Likes lampCable
lampCable said:

Homework Statement


Consider the ansatz
\frac{1}{b-a}\int_a^bf(x)dx \approx \alpha_1f(a)+\alpha_2f(\frac{b-a}{2})+\alpha_3f(b)
We can determine the values of \alpha_1,\alpha_2,\alpha_3 by requiring the approximation to be exact for quadratic polynomials, which yeilds Simpsons rule.

Why there is no loss of generality in assuming that a = -1 and b = 1?

Homework Equations

The Attempt at a Solution


Surely the middle term should be ##\alpha_2 f(\frac{a+b}{2})##?

BTW: Simpson's rule is valid for cubics as well; that becomes clear upon taking a = -1 and b = 1, but only after you have found ##\alpha_1, \alpha_2, \alpha_3##.
 
Ray Vickson said:
Surely the middle term should be \alpha_2 f(\frac{a+b}{2})?
Yes, I'm quite sure that the middle term is correct. Or what do you mean?

Ray Vickson said:
BTW: Simpson's rule is valid for cubics as well; that becomes clear upon taking a = -1 and b = 1, but only after you have found α1,α2,α3\alpha_1, \alpha_2, \alpha_3.
Yes, this is because the contribution from the odd x^3 term is zero, giving no further conditions on \alpha_1, \alpha_2, \alpha_3 (giving the same conditions as for f=x). Right?

Buzz Bloom said:
You can make a linear substitution y = px+q such that y(a) = -1 and y(b) = +1. Since f(x) is a quadratic polynomial in e, f(y) will also be a quadratic polynomial of y.

Thank you for the hint. So, a suitable substitution is
<br /> y = \frac{x-b}{b-a} + \frac{x-a}{b-a}.<br />
This gives
<br /> \frac{1}{b-a}\int_a^bf(x)dx = \frac{1}{2}\int_{-1}^1f\bigg{(}\frac{b(y-1)}{2}-\frac{a(y+1)}{2}\bigg{)}dy = \frac{1}{2}\int_{-1}^1g(y)dy \approx \alpha_1g(-1)+\alpha_2g(0)+\alpha_3g(1)<br />
And so, by your argument, since f(x) is a quadratic polynomial in x, then f\bigg{(}\frac{b(y-1)}{2}-\frac{a(y+1)}{2}\bigg{)} and hence g(y) are quadratic polynomials in y. And the inequality above is therefore equivalent to the assumption that a=-1 and b=1 in the original ansatz.

Correct?
 
Ray Vickson said:
BTW: Simpson's rule is valid for cubics as well; that becomes clear upon taking a = -1 and b = 1, but only after you have found ##\alpha_1, \alpha_2, \alpha_3##.

lampCable said:
Yes, this is because the contribution from the odd x^3 term is zero, giving no further conditions on \alpha_1, \alpha_2, \alpha_3 (giving the same conditions as for f=x). Right?

I think Ray is talking here about Simpson's Second Rule.

The problem you have to prove in the OP is also known as Simpson's First Rule, and it uses a quadratic interpolating polynomial to determine the coefficients, or Simpson's Multipliers, of the three ordinates.

In Simpson's Second Rule, a cubic interpolating polynomial is used and four ordinates are required, with different multipliers, of course.
 
lampCable said:
\alpha_1g(-1)+\alpha_2g(0)+\alpha_3g(1)
If the middle term is ##\alpha_2f(\frac{b-a}{2})##, you get ##\alpha_2g((1-(-1))/2)=\alpha_2g(2/2)=\alpha_2g(1)##.
But @Ray Vickson is correct, the middle term should be ##\alpha_2f(\frac{a+b}{2})##, and that will give you ##\alpha_2g(0)##.
 
  • Like
Likes lampCable
lampCable said:
Yes, I'm quite sure that the middle term is correct. Or what do you mean?

I cannot figure out what you are saying here? Are you saying that what YOU wrote is correct, or are you agreeing that what I wrote is correct?
 
SteamKing said:
I think Ray is talking here about Simpson's Second Rule.

The problem you have to prove in the OP is also known as Simpson's First Rule, and it uses a quadratic interpolating polynomial to determine the coefficients, or Simpson's Multipliers, of the three ordinates.

In Simpson's Second Rule, a cubic interpolating polynomial is used and four ordinates are required, with different multipliers, of course.

No, I don't think so. The ordinary 3-point Simpson rule (designed so that it works on quadratics) also works on cubics. That is why the error analysis for Simpson's rule is proportional to ##(b-a)^4## instead of ##(b-a)^3##.

The reason is simple: when you apply the 3-point Simpson rule to ##x^3## (on a symmetric interval ##[-a,a]##) the exact integral and the Simpson result agree exactly (both being 0). Non-symmetric intervals ##[a,b]## give the same result, but the arguments are messier and less revealing.

For more on this, see, eg., https://en.wikipedia.org/wiki/Simpson's_rule .
 
  • Like
Likes lampCable
Samy_A said:
If the middle term is \alpha_2f(\frac{b-a}{2}), then you get 2g((1−(−1))/2)=2g(2/2)=2g(1)\alpha_2g((1-(-1))/2)=\alpha_2g(2/2)=\alpha_2g(1).
But Ray is correct, the middle term should be \alpha_2f(\frac{b+a}{2}).

Oh, yes of course, I did not see my mistake. Thank you.

Ray Vickson said:
I cannot figure out what you are saying here? Are you saying that what YOU wrote is correct, or are you agreeing that what I wrote is correct?

I am sorry, I misunderstood what you said. You are definitely correct.
 
  • #10
Ray Vickson said:
No, I don't think so. The ordinary 3-point Simpson rule (designed so that it works on quadratics) also works on cubics. That is why the error analysis for Simpson's rule is proportional to ##(b-a)^4## instead of ##(b-a)^3##.

The reason is simple: when you apply the 3-point Simpson rule to ##x^3## (on a symmetric interval ##[-a,a]##) the exact integral and the Simpson result agree exactly (both being 0). Non-symmetric intervals ##[a,b]## give the same result, but the arguments are messier and less revealing.

For more on this, see, eg., https://en.wikipedia.org/wiki/Simpson's_rule .
Well Simpson's First Rule numerical integration can be applied to integrate a number of different functions for which it was not explicitly derived. The error that you get when you do so may not be as small as with integrating a quadratic function, but people still use it, nevertheless.

Simpson's First Rule is also called the 1-4-1 rule, after the multipliers. Simpson's Second Rule is the 1-3-3-1 rule, also after its multipliers.

I'm a naval architect. Simpson's Rule used to be quite ubiquitous in my profession before computers. It was used to integrate quite a few curves where the shape had no known explicit representation except the ordinates measured from a drawing.
 
  • Like
Likes lampCable
  • #11
SteamKing said:
Well Simpson's First Rule numerical integration can be applied to integrate a number of different functions for which it was not explicitly derived. The error that you get when you do so may not be as small as with integrating a quadratic function, but people still use it, nevertheless.

Simpson's First Rule is also called the 1-4-1 rule, after the multipliers. Simpson's Second Rule is the 1-3-3-1 rule, also after its multipliers.

I'm a naval architect. Simpson's Rule used to be quite ubiquitous in my profession before computers. It was used to integrate quite a few curves where the shape had no known explicit representation except the ordinates measured from a drawing.

There is no error (except for roundoff) when integrating linear, quadratic or cubic functions using Simpson's 1-4-1 rule. Of course for other functions the use of 1-4-1 Simpson will generally involve an error ##E_S## bounded by
|E_S| \leq \frac{h^4}{180} K \, (b-a)^4,
where ##h = (b-a)/n## and ##K = \max_{a \leq y \leq b} |f''''(y)|## is the maximum of the fourth derivative. Here, ##n## is the number of sub-intervals of ##[a,b]##, so the function ##f(x)## is evaluated at the ##(n+1)## equally-spaced points ##a = x_0 < x_1 < \cdots < x_n = b##.
 
Back
Top