1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Proving Simpsons rule

  1. Dec 15, 2015 #1
    1. The problem statement, all variables and given/known data
    Consider the ansatz
    [tex] \frac{1}{b-a}\int_a^bf(x)dx \approx \alpha_1f(a)+\alpha_2f(\frac{b-a}{2})+\alpha_3f(b)[/tex]
    We can determine the values of [itex]\alpha_1,\alpha_2,\alpha_3[/itex] by requiring the approximation to be exact for quadratic polynomials, which yeilds Simpsons rule.

    Why there is no loss of generality in assuming that [itex]a = -1[/itex] and [itex]b = 1[/itex]?
    2. Relevant equations


    3. The attempt at a solution
     
  2. jcsd
  3. Dec 15, 2015 #2
    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
     
  4. Dec 15, 2015 #3

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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##.
     
  5. Dec 16, 2015 #4
    Yes, I'm quite sure that the middle term is correct. Or what do you mean?

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

    Thank you for the hint. So, a suitable substitution is
    [tex]
    y = \frac{x-b}{b-a} + \frac{x-a}{b-a}.
    [/tex]
    This gives
    [tex]
    \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)
    [/tex]
    And so, by your argument, since [itex]f(x)[/itex] is a quadratic polynomial in [itex]x[/itex], then [itex]f\bigg{(}\frac{b(y-1)}{2}-\frac{a(y+1)}{2}\bigg{)}[/itex] and hence [itex]g(y)[/itex] are quadratic polynomials in [itex]y[/itex]. And the inequality above is therefore equivalent to the assumption that [itex]a=-1[/itex] and [itex]b=1[/itex] in the original ansatz.

    Correct?
     
  6. Dec 16, 2015 #5

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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.
     
  7. Dec 16, 2015 #6

    Samy_A

    User Avatar
    Science Advisor
    Homework Helper

    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)##.
     
  8. Dec 16, 2015 #7

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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?
     
  9. Dec 16, 2015 #8

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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 .
     
  10. Dec 16, 2015 #9
    Oh, yes of course, I did not see my mistake. Thank you.

    I am sorry, I misunderstood what you said. You are definitely correct.
     
  11. Dec 16, 2015 #10

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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.
     
  12. Dec 16, 2015 #11

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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
    [tex] |E_S| \leq \frac{h^4}{180} K \, (b-a)^4, [/tex]
    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##.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Proving Simpsons rule
  1. Simpson's rule (Replies: 2)

  2. Simpson's Rule (Replies: 1)

  3. Simpson's Rule (Replies: 7)

Loading...