Approximate $$$\int\limits_{0}^{\pi} \sin{\left(x \right)}\, dx$$$ with $$$n = 6$$$ using the Simpson's rule

The calculator will approximate the integral of $$$\sin{\left(x \right)}$$$ from $$$0$$$ to $$$\pi$$$ with $$$n = 6$$$ subintervals using the Simpson's rule, with steps shown.

Related calculators: Simpson's Rule Calculator for a Table, Simpson's 3/8 Rule Calculator for a Function

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Your Input

Approximate the integral $$$\int\limits_{0}^{\pi} \sin{\left(x \right)}\, dx$$$ with $$$n = 6$$$ using the Simpson's rule.

Solution

The Simpson's 1/3 rule (also known as the parabolic rule) uses parabolas to approximate the area:

$$$\int\limits_{a}^{b} f{\left(x \right)}\, dx\approx \frac{\Delta x}{3} \left(f{\left(x_{0} \right)} + 4 f{\left(x_{1} \right)} + 2 f{\left(x_{2} \right)} + 4 f{\left(x_{3} \right)} + 2 f{\left(x_{4} \right)}+\dots+4 f{\left(x_{n-3} \right)} + 2 f{\left(x_{n-2} \right)} + 4 f{\left(x_{n-1} \right)} + f{\left(x_{n} \right)}\right)$$$

where $$$\Delta x = \frac{b - a}{n}$$$.

We have that $$$f{\left(x \right)} = \sin{\left(x \right)}$$$, $$$a = 0$$$, $$$b = \pi$$$, and $$$n = 6$$$.

Therefore, $$$\Delta x = \frac{\pi - 0}{6} = \frac{\pi}{6}$$$.

Divide the interval $$$\left[0, \pi\right]$$$ into $$$n = 6$$$ subintervals of the length $$$\Delta x = \frac{\pi}{6}$$$ with the following endpoints: $$$a = 0$$$, $$$\frac{\pi}{6}$$$, $$$\frac{\pi}{3}$$$, $$$\frac{\pi}{2}$$$, $$$\frac{2 \pi}{3}$$$, $$$\frac{5 \pi}{6}$$$, $$$\pi = b$$$.

Now, just evaluate the function at these endpoints.

$$$f{\left(x_{0} \right)} = f{\left(0 \right)} = 0$$$

$$$4 f{\left(x_{1} \right)} = 4 f{\left(\frac{\pi}{6} \right)} = 2$$$

$$$2 f{\left(x_{2} \right)} = 2 f{\left(\frac{\pi}{3} \right)} = \sqrt{3}\approx 1.732050807568877$$$

$$$4 f{\left(x_{3} \right)} = 4 f{\left(\frac{\pi}{2} \right)} = 4$$$

$$$2 f{\left(x_{4} \right)} = 2 f{\left(\frac{2 \pi}{3} \right)} = \sqrt{3}\approx 1.732050807568877$$$

$$$4 f{\left(x_{5} \right)} = 4 f{\left(\frac{5 \pi}{6} \right)} = 2$$$

$$$f{\left(x_{6} \right)} = f{\left(\pi \right)} = 0$$$

Finally, just sum up the above values and multiply by $$$\frac{\Delta x}{3} = \frac{\pi}{18}$$$: $$$\frac{\pi}{18} \left(0 + 2 + 1.732050807568877 + 4 + 1.732050807568877 + 2 + 0\right) = 2.000863189673536.$$$

Answer

$$$\int\limits_{0}^{\pi} \sin{\left(x \right)}\, dx\approx 2.000863189673536$$$A