Simpson's Rule

Simpson's rule approximates a definite integral over an interval by partitioning the interval into an even number of subintervals, approximating the given function on consecutive pairs of intervals by quadratic functions, and then computing the integral corresponding to the quadratic 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 (even) number of subintervals and press the "Approximate" button to show the approximating parabolas 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