Simpson's 1/3 Rule Calculator

Type a function, an interval and an even number of intervals to use Simpson's 1/3 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.

An even number of equal intervals, 2 or more.

Try

Result

You entered∫02x2 dx≈S4\int_{0}^{2} x^{2}\,dx \approx S_{4}

S≈83≈2.666667\displaystyle S \approx \frac{8}{3} \approx 2.666667

Error against the exact integral

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

    Fit a parabola through each group of three points. The heights are weighted 1,4,2,4,2,…,4,11, 4, 2, 4, 2, \ldots, 4, 1, which needs an even number of intervals.

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

    The x-values are equally spaced.

    Δx=2−04=0.5\begin{aligned} \Delta x &= \frac{2 - 0}{4} \\ &= 0.5 \end{aligned}
  3. Heights

    The 5 heights.

    f(xi): 0, 0.25, 1, 2.25, 4f(x_i):\ 0,\ 0.25,\ 1,\ 2.25,\ 4
  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 Δx/3.

    S=2.666667S = 2.666667

Worked examples