Simpson's rule, was Re: Integrating a Taylor series?
Subject: Simpson's rule, was Re: Integrating a Taylor series?
From: Alasdair McAndrew
Date: Mon, 13 May 2013 09:51:04 +1000
Yes, I know that in general Newton-Cotes rules of order 2n are exact for
polynomials of order 2n+1. However, I was interested in some more general
rules (including Newton-Cotes with derivative end-corrections), some of
which have errors of a very high order of h, and working using a Taylor
series seemed the best way to go.
Thanks,
Alasdair
On Mon, May 13, 2013 at 8:35 AM, Richard Fateman
<fateman at eecs.berkeley.edu>wrote:
> On 5/12/2013 3:25 PM, Richard Fateman wrote:
>
>>
>>
>> simpson(f,x,a,h) := (h/3)*(f(a)+4*f(a+h)+f(a+2*h))**;
>>
>
> maybe even better is to put a symbolic coefficient in front of x^4... that
> is
>
> ratsimp(
> simpson(lambda([x],u*x^4+v*x^**3+r*x^2+s*x+t),x,a,h)-**
> integrate(u*x^4+v*x^3+r*x^2+s***x+t,x,a,a+2*h));
>
> which shows you how the error relates to the 4th derivative, 24*u.
> The error is (4*h^5/15) * u.
>
>
>
--
Blog: http://amca01.wordpress.com
Web: http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew