Simpson's 3/8 Rule Calculator

Type a function, an interval and a number of intervals divisible by 3 to use Simpson's 3/8 rule.

Use x. Type powers with ^, and functions with brackets: sin(x), e^(2x), ln(x), sqrt(x).

A number such as 0 or 1/2, pi, e, inf or -inf.

A number larger than the lower limit, pi, e, inf or -inf.

A number of equal intervals divisible by 3, such as 3, 6 or 9.

Try

Result

You entered∫03x2 dx≈S3\int_{0}^{3} x^{2}\,dx \approx S_{3}

S≈9\displaystyle S \approx 9

Error against the exact integral

0\displaystyle 0
Show the work
  1. Simpson's 3/8 rule

    Fit a cubic through each group of four points. The heights are weighted 1,3,3,2,3,3,2,…,3,3,11, 3, 3, 2, 3, 3, 2, \ldots, 3, 3, 1, which needs the number of intervals to be divisible by 3.

    Sn=3Δx8[f(x0)+3f(x1)+3f(x2)+2f(x3)+⋯+3f(xn−1)+f(xn)]S_n = \frac{3\Delta x}{8}\left[f(x_0) + 3f(x_1) + 3f(x_2) + 2f(x_3) + \cdots + 3f(x_{n-1}) + f(x_n)\right]
  2. Width of each interval

    The x-values are equally spaced.

    Δx=3−03=1\begin{aligned} \Delta x &= \frac{3 - 0}{3} \\ &= 1 \end{aligned}
  3. Heights

    The 4 heights.

    f(xi): 0, 1, 4, 9f(x_i):\ 0,\ 1,\ 4,\ 9
  4. Exact for cubics

    Simpson's rule is exact for every polynomial of degree 3 or less, and this function is one, so the estimate is the exact integral.

  5. Result

    The weighted sum times 3Δx/8.

    S=9S = 9

Worked examples