Simpson's Rule - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : Student Package : Calculus 1 : Visualization : Integration : Student/Calculus1/Simpson

Simpson's Rule

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ApproximateInt(f(x), x = a..b, method = simpson, opts)

ApproximateInt(f(x), a..b, method = simpson, opts)

ApproximateInt(Int(f(x), x = a..b), method = simpson, opts)

Parameters

f(x)

-

algebraic expression in variable 'x'

x

-

name; specify the independent variable

a, b

-

algebraic expressions; specify the interval

opts

-

equation(s) of the form option=value where option is one of boxoptions, functionoptions, iterations, method, outline, output, partition, pointoptions, refinement, showarea, showfunction, showpoints, subpartition, view, or Student plot options; specify output options

Description

• 

The ApproximateInt(f(x), x = a..b, method = simpson, opts) command approximates the integral of f(x) from a to b by using Simpson's rule. The first two arguments (function expression and range) can be replaced by a definite integral.

• 

If the independent variable can be uniquely determined from the expression, the parameter x need not be included in the calling sequence.

• 

Given a partition P=a=x0,x1,...,xN=b of the interval a,b, Simpson's rule approximates the integral on each subinterval xi1,xi by integrating the quadratic function that interpolates the three points xi1,fxi1, 12xi1+12xi,f12xi1+12xi, and xi,fxi.  This value is

16xixi1fxi1+4f12xi1+12xi+fxi

• 

In the case that the widths of the subintervals are equal, the approximation can be written as

16bafx0+4f12x0+12x1+2fx1+4f12x1+12x2+2fx2+...+fxNN

  

Traditionally, Simpson's rule is written as: given N where N is an even integer and given equally spaced points a=x0,x1,x2,...,xN=b, an approximation to the integral ∫abfxⅆx is

13bafx0+4fx1+2fx2+4fx3+2fx4+...+fxNN

• 

By default, the interval is divided into 10 equal-sized subintervals.

• 

For the options opts, see the ApproximateInt help page.

• 

This rule can be applied interactively, through the ApproximateInt Tutor.

Examples

polynomialCurveFitting[PolynomialInterpolation]x0,x0+x12,x1,f0,f12,f1,z:

integrated∫x0x1polynomialⅆz:

factorintegrated

16x0x1f1+4f12+f0

(1)

withStudent[Calculus1]:

ApproximateIntsinx,x=0..5,method=simpson

16sin92+13sin194+112sin5+16sin3+13sin134+16sin72+13sin154+16sin4+13sin174+13sin54+16sin32+13sin74+16sin2+13sin94+16sin52+13sin114+16sin12+13sin34+13sin14+16sin1

(2)

ApproximateIntxx2x3,x=0..5,method=simpson,output=plot

ApproximateInttanx2x,x=1..1,method=simpson,output=plot,partition=50

To play the following animation in this help page, right-click (Control-click, on Macintosh) the plot to display the context menu.  Select Animation > Play.

ApproximateIntlnx,1..100,method=simpson,output=animation

See Also

Boole's Rule

Newton-Cotes Rules

plot/options

Simpson's 3/8 Rule

Student

Student plot options

Student[Calculus1]

Student[Calculus1][ApproximateInt]

Student[Calculus1][ApproximateIntTutor]

Student[Calculus1][RiemannSum]

Student[Calculus1][VisualizationOverview]

Trapezoidal Rule

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam