Trapezoidal rule problem

792 Views Asked by At

In a trapezoidal rule problem I got following question:

"Evaluate the above integral using trapezoidal rule with five points."

My confusion is here what we take for the value of $n$ is it $5$ or $4$. I'm thinking like suppose if you take $5$ points $1,2,3,4,5$ then there would be $4$ sections/intervals so that's why $n$ should be $4$. Can anyone help me in it that what would be $n$'s value and why? Please provide explanation too if possible. Thanks!

Note: $h=\frac{b-a}{n}$ where $b$ and $a$ are limits.

2

There are 2 best solutions below

3
On

It seems like your $n$ equals $4$. As you say in your question, you consider $h = \frac{b-a}n$, that gives you the evaluation points $x_i = a + ih$, $0 \le i \le n$ (such that $x_0 = a$ and $x_n = b$), so altogether five points, as you correctly say.

1
On

There is some ambiguity, texts usually say something like "with $n=8$." But $5$ points is $5$ points, and it would be unreasonable not to count the endpoints. So here $n=4$.

If we are integrating $f(x)$ from $a$ to $b$, we would use $$\frac{\Delta x}{2}\left(f(x_0)+2f(x_1)+2f(x_2)+2f(x_3)+f(x_4)\right),$$ where $\Delta x=\dfrac{b-a}{4}$ and $x_i=a+(\Delta x)i$.