Trapezoidal Rule
Calling Sequence
Parameters
Description
Examples
ApproximateInt(f(x), x = a..b, method = trapezoid, opts)
ApproximateInt(f(x), a..b, method = trapezoid, opts)
ApproximateInt(Int(f(x), x = a..b), method = trapezoid, opts)
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
The ApproximateInt(f(x), x = a..b, method = trapezoid) command approximates the integral of f(x) from a to b by using the trapezoidal 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, the trapezoidal rule approximates the integral on each subinterval xi−1,xi by integrating the linear function that interpolates the endpoints xi−1,fxi−1 and xi,fxi. This value is
xi−xi−1fxi−1+fxi2
In the case that the widths of the subintervals are equal, the approximation can be written as
b−afx0+2fx1+2fx2+...+2fxN−1+fxN2N
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.
polynomial≔CurveFittingPolynomialInterpolationx0,x1,f0,f1,z:
integrated≔intpolynomial,z=x0..x1:
factorintegrated
−−x1+x0f0+f12
withStudentCalculus1:
ApproximateIntsinx,x=0..5,method=trapezoid
sin122+sin12+sin322+sin22+sin522+sin32+sin722+sin42+sin922+sin54
ApproximateIntxx−2x−3,x=0..5,method=trapezoid,output=plot
ApproximateInttanx−2x,x=−1..1,method=trapezoid,output=plot,partition=50
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.
ApproximateIntlnx,1..100,method=trapezoid,output=animation
See Also
Boole's Rules
Newton-Cotes Rules
Simpson's 3/8 Rule
Simpson's Rule
Student
Student plot options
Student[Calculus1]
Student[Calculus1][ApproximateInt]
Student[Calculus1][ApproximateIntTutor]
Student[Calculus1][RiemannSum]
Student[Calculus1][VisualizationOverview]
Download Help Document