# Trapezoidal rule problem

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.

-
@Julian Thanks for the edit ! – shashi kant Dec 14 '12 at 13:29
Thanks should go to @levap. I just approved his edit (and did some minor improvements). – Julian Kuelshammer Dec 14 '12 at 13:45
Oh then @levap Thank you too friend :) – shashi kant Dec 14 '12 at 14:03
But I've one more confusion that In Trapezoidal or Simpson rule Do we need to integrate the function first or we can directly apply the values to the respective function equation to get the approximation? – shashi kant Dec 14 '12 at 14:04

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.

-
Shouldn't that be an $h = \frac{b-a}n$? That is, an $n$ in the denominator? – Amzoti Dec 14 '12 at 12:47
@Amzoti Thanks. – martini Dec 14 '12 at 12:54
@martini thanks for the reply ! – shashi kant Dec 14 '12 at 13:31

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$.

-
Hey Andre Thanks for reply! – shashi kant Dec 14 '12 at 13:30

When you have 5 integration points you will divide you integration interval in 4 sub-intervals, and by definition $n$ is the number of sub-intervals, which is 4 in this case.

-