Trapezoidal Rule Calculator for a Function

Approximate an integral (given by a function) using the trapezoidal rule step by step

The calculator will approximate the integral using the trapezoidal rule, with steps shown.

Related calculator: Trapezoidal Rule Calculator for a Table

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please contact us.

Your Input

Approximate the integral 01sin3(x)+1dx\int\limits_{0}^{1} \sqrt{\sin^{3}{\left(x \right)} + 1}\, dx with n=5n = 5 using the trapezoidal rule.

Solution

The trapezoidal rule uses trapezoids to approximate the area:

abf(x)dxΔx2(f(x0)+2f(x1)+2f(x2)+2f(x3)++2f(xn2)+2f(xn1)+f(xn))\int\limits_{a}^{b} f{\left(x \right)}\, dx\approx \frac{\Delta x}{2} \left(f{\left(x_{0} \right)} + 2 f{\left(x_{1} \right)} + 2 f{\left(x_{2} \right)} + 2 f{\left(x_{3} \right)}+\dots+2 f{\left(x_{n-2} \right)} + 2 f{\left(x_{n-1} \right)} + f{\left(x_{n} \right)}\right)

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

We have that f(x)=sin3(x)+1f{\left(x \right)} = \sqrt{\sin^{3}{\left(x \right)} + 1}, a=0a = 0, b=1b = 1, and n=5n = 5.

Therefore, Δx=105=15\Delta x = \frac{1 - 0}{5} = \frac{1}{5}.

Divide the interval [0,1]\left[0, 1\right] into n=5n = 5 subintervals of the length Δx=15\Delta x = \frac{1}{5} with the following endpoints: a=0a = 0, 15\frac{1}{5}, 25\frac{2}{5}, 35\frac{3}{5}, 45\frac{4}{5}, 1=b1 = b.

Now, just evaluate the function at these endpoints.

f(x0)=f(0)=1f{\left(x_{0} \right)} = f{\left(0 \right)} = 1

2f(x1)=2f(15)=2sin3(15)+12.0078260679127932 f{\left(x_{1} \right)} = 2 f{\left(\frac{1}{5} \right)} = 2 \sqrt{\sin^{3}{\left(\frac{1}{5} \right)} + 1}\approx 2.007826067912793

2f(x2)=2f(25)=2sin3(25)+12.0582069723326482 f{\left(x_{2} \right)} = 2 f{\left(\frac{2}{5} \right)} = 2 \sqrt{\sin^{3}{\left(\frac{2}{5} \right)} + 1}\approx 2.058206972332648

2f(x3)=2f(35)=2sin3(35)+12.172574461165122 f{\left(x_{3} \right)} = 2 f{\left(\frac{3}{5} \right)} = 2 \sqrt{\sin^{3}{\left(\frac{3}{5} \right)} + 1}\approx 2.17257446116512

2f(x4)=2f(45)=2sin3(45)+12.3402147534248682 f{\left(x_{4} \right)} = 2 f{\left(\frac{4}{5} \right)} = 2 \sqrt{\sin^{3}{\left(\frac{4}{5} \right)} + 1}\approx 2.340214753424868

f(x5)=f(1)=sin3(1)+11.263258974474734f{\left(x_{5} \right)} = f{\left(1 \right)} = \sqrt{\sin^{3}{\left(1 \right)} + 1}\approx 1.263258974474734

Finally, just sum up the above values and multiply by Δx2=110\frac{\Delta x}{2} = \frac{1}{10}: 110(1+2.007826067912793+2.058206972332648+2.17257446116512+2.340214753424868+1.263258974474734)=1.084208122931016.\frac{1}{10} \left(1 + 2.007826067912793 + 2.058206972332648 + 2.17257446116512 + 2.340214753424868 + 1.263258974474734\right) = 1.084208122931016.

Answer

01sin3(x)+1dx1.084208122931016\int\limits_{0}^{1} \sqrt{\sin^{3}{\left(x \right)} + 1}\, dx\approx 1.084208122931016A