Newton-Cotes Formulae - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Calculus 1 : Visualization : Integration : Student/Calculus1/NewtonCotes

Newton-Cotes Formulae

 Calling Sequence ApproximateInt(f(x), x = a..b, method = newtoncotes[N], opts) ApproximateInt(f(x), a..b, method = newtoncotes[N], opts) ApproximateInt(Int(f(x), x = a..b), method = newtoncotes[N], opts)

Parameters

 f(x) - algebraic expression in variable 'x' x - name; specify the independent variable a, b - algebraic expressions; specify the interval N - positive integer 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 = newtoncotes[N], opts) command approximates the integral of f(x) from a to b by using the Nth degree Newton-Cotes formula. 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=\left(a={x}_{0},{x}_{1},...,{x}_{N}=b\right)$ of the interval $\left(a,b\right)$, the $N$th degree Newton-Cotes formula approximates the integral on each subinterval $\left({x}_{i-1},{x}_{i}\right)$ by integrating the $N$th degree polynomial which interpolates $N-1$ equally spaced points between the end points of the interval.
 The Newton-Cotes formulae are generalizations of the simpler polynomial interpolation routines.  The following table gives the correspondence between the other methods and the degree.

 Equivalent Method Order Trapezoid 1 Simpson's Rule 2 Simpson's 3/8 Rule 3 Boole's Rule 4

 • 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

 > $\mathrm{int}\left(\mathrm{sin}\left(x\right),x=0...5.0\right)$
 ${0.7163378145}$ (1)
 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{Calculus1}\right]\right):$
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0...5.0,\mathrm{method}=\mathrm{newtoncotes}\left[1\right]\right)$
 ${0.7013515555}$ (2)
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0...5.0,\mathrm{method}=\mathrm{newtoncotes}\left[2\right]\right)$
 ${0.7163534765}$ (3)
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0...5.0,\mathrm{method}=\mathrm{newtoncotes}\left[3\right]\right)$
 ${0.7163447696}$ (4)
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0...5.0,\mathrm{method}=\mathrm{newtoncotes}\left[4\right]\right)$
 ${0.7163378087}$ (5)
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0...5.0,\mathrm{method}=\mathrm{newtoncotes}\left[6\right]\right)$
 ${0.7163378145}$ (6)
 > $\mathrm{ApproximateInt}\left(x\left(x-2\right)\left(x-3\right),0..5,\mathrm{method}=\mathrm{simpson},\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{ApproximateInt}\left(\mathrm{tan}\left(x\right)-2x,x=-1..1,\mathrm{method}=\mathrm{simpson},\mathrm{output}=\mathrm{plot},\mathrm{partition}=50\right)$

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.

 > $\mathrm{ApproximateInt}\left(\mathrm{ln}\left(x\right),x=1..100,\mathrm{method}=\mathrm{simpson},\mathrm{output}=\mathrm{animation}\right)$