Simpson's rule approximates the definite integral of a function f(x) over an interval [a, b] by partitioning the interval into an even number of subintervals, approximating f(x) on consecutaive pairs of subintervals by quadratic functions, and then computing the integral corresponding to the quadratic functions.
In the script below, enter f(x), a, and b. When entering f(x), you can use +, -, *, /, ^, ( ), abs(), sin(), cos(), tan(), exp(), log(), log10(), asin(), acos(), atan(), pi, e. Take care to remember the * in all multiplications and to avoid discontinuities. Also, note that here, log() stands for the natural logarithm, while log10() stands for the common logarithm. When entering a and b, you can use integers or decimals. Press the "Plot" button to draw the graph of f(x). Then enter n, the (even) number of subintervals and press the "Approximate" button to show the approximating parabolas and the corresponding value for the integral.
Back to the Protas home page