Trapezoidal Rule

The Trapezoidal Rule approximates a definite integral over an interval by partitioning the interval into a number of subintervals, approximating the given function on each subinterval by a linear function, and then computing the integral corresponding to the linear functions.

In the applet below, enter the integrand f(x) and the endpoints of the interval [a,b] over which you want to integrate. You can use +, -, *, /, ^, (), sin(), cos(), tan(), ln(), log(), asin(), acos(), atan(), pi, e. Take care to remember the * in all multiplications and to avoid discontinuities. Pressing the "Plot" button will draw the graph of f(x). Then enter the number of subintervals and press the "Approximate" button to show the approximating line segments and the corresponding value for the integral.



This applet uses a slightly modified version of the expression parser expr written by Darius Bacon.

source code

arrowBack to the Protas home page