The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Calculus! Help me out with Simpson's Rule! UPDATE! FOLLOWUP!

Loren MichaelLoren Michael Registered User regular
edited April 2009 in Help / Advice Forum
ac281e21c702c7a01b4270ada92baa27.png

I'm looking at the composite Simpson's rule, for dealing with multiple subintervals for better accuracy. I get how to use the rule, and I understand that it works... but I'm not clear why it's four times the evens and two times the odds.

Can someone please explain how that composite rule is extrapolated from this:

80ca47af148fedc25f9b42d84725c0b2.png

a7iea7nzewtq.jpg
Loren Michael on

Posts

  • physi_marcphysi_marc Positron Tracker In a nutshellRegistered User regular
    edited April 2009
    Alright, this is hard to explain over the Internet, but I'll give it a shot.

    You break (a,b) into 2n subintervals with width h = (b-a)/2n. Then, apply Simpson's rule to each pair of intervals. Notice that in the original Simpson's rule (b-a)/6 is just the interval width divided by 3, so in the composite rule you end up with h/3.

    For example, let's say you split it into 4 subintervals. The values x0, x1, x2, x3 and x4 delimit these subintervals.

    You apply Simpson's rule to each pair (pair 1 is from x0 to x1 and from x1 to x2 and pair 2 is from x2 to x3 and from x3 to x4). You get:

    (h/3)*( f(x0) + 4f(x1) + f(x2) ) + (h/3)*( f(x2) + 4f(x3) + f(x4) ) = (h/3)*( f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + f(x4) )

    Notice how x1 and x3 come out 4 times but x2 only comes out twice? That's where it comes from.

    Hope that makes sense.

    EDIT: Wikipedia's version breaks (a,b) into n subintervals, instead of 2n. But it doesn't make any difference, of course.

    physi_marc on
    Switch Friend Code: 3102-5341-0358
    Nintendo Network ID: PhysiMarc
  • Loren MichaelLoren Michael Registered User regular
    edited April 2009
    Okay, so what about a problem with three subintervals, four function values?

    If I have four function values, I have a first and a last, but then I have two values in the middle. Which is multiplied 4 times and which is multiplied 2 times?

    Loren Michael on
    a7iea7nzewtq.jpg
  • DemerdarDemerdar Registered User regular
    edited April 2009
    Split it up into even sub intervals so that you can apply composite simp rule? And then maybe subtract what you double count?

    Demerdar on
    y6GGs3o.gif
Sign In or Register to comment.