Simpson's 3-8th Rule - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Simpson's 3/8 Rule

 Calling Sequence ApproximateInt(f(x), x = a..b, method = simpson[3/8], opts) ApproximateInt(f(x), a..b, method = simpson[3/8], opts) ApproximateInt(Int(f(x), x = a..b), method = simpson[3/8], 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[3/8], opts) command approximates the integral of f(x) from a to b by using Simpson's 3/8 rule.  This rule is also known as Newton's 3/8 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=\left(a={x}_{0},{x}_{1},...,{x}_{N}=b\right)$ of the interval $\left(a,b\right)$, Simpson's 3/8 rule approximates the integral on each subinterval $\left({x}_{i-1},{x}_{i}\right)$ by integrating the cubic function that interpolates the four points $\left({x}_{i-1},f\left({x}_{i-1}\right)\right)$, $\left(\frac{2{x}_{i-1}}{3}+\frac{{x}_{i}}{3},f\left(\frac{2{x}_{i-1}}{3}+\frac{{x}_{i}}{3}\right)\right)$, $\left(\frac{{x}_{i-1}}{3}+\frac{2{x}_{i}}{3},f\left(\frac{{x}_{i-1}}{3}+\frac{2{x}_{i}}{3}\right)\right)$, and $\left({x}_{i},f\left({x}_{i}\right)\right)$.  This value is

$\frac{\left({x}_{i}-{x}_{i-1}\right)\left(f\left({x}_{i-1}\right)+3f\left(\frac{2{x}_{i-1}}{3}+\frac{{x}_{i}}{3}\right)+3f\left(\frac{{x}_{i-1}}{3}+\frac{2{x}_{i}}{3}\right)+f\left({x}_{i}\right)\right)}{8}$

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

$\frac{\left(b-a\right)\left(f\left({x}_{0}\right)+3f\left(\frac{2{x}_{0}}{3}+\frac{{x}_{1}}{3}\right)+3f\left(\frac{{x}_{0}}{3}+\frac{2{x}_{1}}{3}\right)+2f\left({x}_{1}\right)+3f\left(\frac{2{x}_{1}}{3}+\frac{{x}_{2}}{3}\right)+3f\left(\frac{{x}_{1}}{3}+\frac{2{x}_{2}}{3}\right)+2f\left({x}_{2}\right)+\mathrm{...}+f\left(\frac{{x}_{N-1}}{3}+\frac{2{x}_{N}}{3}\right)+f\left({x}_{N}\right)\right)}{8N}$

 Traditionally, Simpson's 3/8 rule is written as: given N, where N is a positive multiple of 3, and given equally spaced points $a={x}_{0},{x}_{1},{x}_{2},...,{x}_{N}=b$, an approximation to the integral ${\int }_{a}^{b}f\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ is

$\frac{3\left(b-a\right)\left(f\left({x}_{0}\right)+3f\left({x}_{1}\right)+3f\left({x}_{2}\right)+2f\left({x}_{3}\right)+3f\left({x}_{4}\right)+3f\left({x}_{5}\right)+2f\left({x}_{6}\right)+3f\left({x}_{7}\right)+\mathrm{...}+3f\left({x}_{N-1}\right)+f\left({x}_{N}\right)\right)}{8N}$

 • 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{polynomial}≔{\mathrm{CurveFitting}}_{\mathrm{PolynomialInterpolation}}\left(\left[{x}_{0},\frac{2{x}_{0}+{x}_{1}}{3},\frac{{x}_{0}+2{x}_{1}}{3},{x}_{1}\right],\left[f\left(0\right),f\left(\frac{1}{3}\right),f\left(\frac{2}{3}\right),f\left(1\right)\right],z\right):$
 > $\mathrm{integrated}≔{∫}_{{x}_{0}}^{{x}_{1}}\mathrm{polynomial}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆz:$
 > $\mathrm{factor}\left(\mathrm{integrated}\right)$
 ${-}\frac{\left({{x}}_{{0}}{-}{{x}}_{{1}}\right){}\left({f}{}\left({0}\right){+}{f}{}\left({1}\right){+}{3}{}{f}{}\left(\frac{{1}}{{3}}\right){+}{3}{}{f}{}\left(\frac{{2}}{{3}}\right)\right)}{{8}}$ (1)
 > $\mathrm{with}\left({\mathrm{Student}}_{\mathrm{Calculus1}}\right):$
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0..5,\mathrm{method}={\mathrm{simpson}}_{\frac{3}{8}}\right)$
 $\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{25}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{13}}{{3}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left(\frac{{9}}{{2}}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{14}}{{3}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{29}}{{6}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left({5}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left({3}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{19}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{10}}{{3}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left(\frac{{7}}{{2}}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{11}}{{3}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{23}}{{6}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left({4}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{11}}{{6}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left({2}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{13}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{7}}{{3}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left(\frac{{5}}{{2}}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{8}}{{3}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{17}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{2}}{{3}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{5}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{7}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{4}}{{3}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left(\frac{{3}}{{2}}\right)}{{8}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{5}}{{3}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{1}}{{6}}\right)}{{16}}{+}\frac{{3}{}{\mathrm{sin}}{}\left(\frac{{1}}{{3}}\right)}{{16}}{+}\frac{{\mathrm{sin}}{}\left(\frac{{1}}{{2}}\right)}{{8}}{+}\frac{{\mathrm{sin}}{}\left({1}\right)}{{8}}$ (2)
 > $\mathrm{ApproximateInt}\left(x\left(x-2\right)\left(x-3\right),x=0..5,\mathrm{method}={\mathrm{simpson}}_{\frac{3}{8}},\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{ApproximateInt}\left(\mathrm{tan}\left(x\right)-2x,x=-1..1,\mathrm{method}={\mathrm{simpson}}_{\frac{3}{8}},\mathrm{output}=\mathrm{plot},\mathrm{partition}=50\right)$

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

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