Simpson's Rule for Cubics
Date: 10/23/2000 at 02:30:23 From: George Stratis Subject: Simpson's rule with cubic polynomials I don't understand why Simpson's rule gives the exact answer for cubic polynomials. Can you explain that using a simple example, like x^3?
Date: 10/23/2000 at 06:18:32 From: Doctor Mitteldorf Subject: Re: Simpson's rule with cubic polynomials There's no simple verbal explanation that I know of. However, it's an interesting and instructive exercise to just do the calculation: Take the function y = x^3 between any two points - you may want to do a and b for generality, but I'll do 0 and 2 for illustration: The Simpson weightings are 1, 4, 1. So the Simpson sum is (1*0^3 + 4*1^3 + 1*2^3) = 12 To get the Simpson integral estimate, divide by 1+4+1 = 6 (this is part of the averaging process) and then multiply by the length of the interval, 2. So the Simpson integral for this case is 12/6 * 2 = 4. Of course, the exact value of the integral is 2^4/4, which is exactly 4. Once you've proven this is true for any two numbers a...b, not just for 0...2, you can combine several intervals together to get Simpson sums with the usual weightings 1, 4, 2, 4, 2, 4, ...2, 4, 1. If it works exactly on each of the intervals separately, then it works on the entire interval. - Doctor Mitteldorf, The Math Forum http://mathforum.org/dr.math/
Date: 10/23/2000 at 07:43:40 From: Doctor Anthony Subject: Re: Simpson's rule with cubic polynomials Assume that y = f(x) is a CUBIC polynomial of the form y = ax^3 + bx^2 + cx + d We consider two intervals each of width h, and take the origin at the middle ordinate. So the following three points are on the curve: (-h,y0), (0,y1), (h,y2). The TRUE area is given by INT[(ax^3 + bx^2 + cx + d) dx] from -h to h Integrating, we get [ax^4/4 + bx^3/3 + cx^2/2 + dx] from -h to h. ah^4/4 + bh^3/3 + ch^2/2 + dh -[ah^4/4 - bh^3/3 + ch^2/2 - dh] ---------------------------------- 2bh^3/3 + 2dh So the area is A = 2bh^3/3 + 2dh Substituting our three points into the equation of the curve, we have y0 = -ah^3 + bh^2 - ch + d y1 = 0 + 0 + 0 + d y2 = ah^3 + bh^2 + ch + d y0+y2 = 2bh^2 + 2d h(y0+y2) = 2bh^3 + 2dh (h/3)(y0+y2) = 2bh^3/3 + 2dh/3 = 2bh^3/3 + 2dh - 4dh/3 = A - 4(y1)(h/3) So the exact area of the two slices is A = (h/3)(y0 + 4y1 + y2) Adding a succession of PAIRS of slices, we obtain A = (h/3)[y0 + 4y1 + y2 + y2 + 4y3 + y4 + ... + yn] = (h/3)[y0 + yn + 4(y1 + y3 + ... + y(n-1)) + 2(y2 + y4 + ... + y(n-2))] For the formula to work there must be an EVEN number of slices, that is, n must be an even number. In words the formula is A = (h/3)[(first + last) + 4*(sum of odd) + 2*(sum of even)] and note that the formula is exact for polynomials of degree 3. - Doctor Anthony, The Math Forum http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.