Trapezoid Rule?...

flaren5

New member
Joined
May 17, 2013
Messages
33
The following table gives the values of a function \(\displaystyle f(x)\) at a certain number of equidistant points on the \(\displaystyle x\)-axis. From the data supplied, calculate the approximate values of \(\displaystyle \int_0^{2.0}\, f(x)\, dx\) by using each of the following rules. (Give the explicit formula / definition for each of the rules, before applying them.)

(i) Trapezoidal Rule . . . . .(ii) Simpson's Rule​

Code:
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| x    = | 0.0 | 0.2 | 0.4 | 0.6 | 0.8 | 1.0 | 1.2 | 1.4 | 1.6 | 1.8 | 2.0 |
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| f(x) = | 2.7 | 2.1 | 2.3 | 1.7 | 2.2 | 2.9 | 3.1 | 3.4 | 3.9 | 4.9 | 8.7 |
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
I was wondering if anyone can lead me in the right direction with the above question. I know I'm supposed to use the equation stated below, but I'm not too sure what \(\displaystyle n\) is, in order to figure out \(\displaystyle h\).

The \(\displaystyle n\)-subinterval Trapezoidal Rule approximation to \(\displaystyle \int_a^b\, f(x)\, dx\), denoted \(\displaystyle T_n\), is given by:

. . . . .\(\displaystyle T_n\, =\, h\left(\frac{1}{2}y_0\, +\, y_1\, +\, y_2\, +\, y^3\, ...\, +\, y_{n-1}\, +\, \frac{1}{2}y_n\right)\)

We assume \(\displaystyle f(x)\) is continuous on \(\displaystyle [a,\, b]\) and subdivide \(\displaystyle [a,\, b]\) into \(\displaystyle n\) subintervals of equal length \(\displaystyle h\, =\, (b\, -\, a)/n\) using the \(\displaystyle n\, +\, 1\) points.
 
Last edited by a moderator:
You have \(\displaystyle n+1\) points, \(\displaystyle (x_0, y_0),...,(x_n,y_n)\). Phyisically counting we see there are 11 points, the 11th is the (n+1)th so n=10. Also, a=0=x0, and b=2=xn.
 
The following table gives the values of a function \(\displaystyle f(x)\) at a certain number of equidistant points on the \(\displaystyle x\)-axis. From the data supplied, calculate the approximate values of \(\displaystyle \int_0^{2.0}\, f(x)\, dx\) by using each of the following rules. (Give the explicit formula / definition for each of the rules, before applying them.)

(i) Trapezoidal Rule . . . . .(ii) Simpson's Rule​

Code:
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| x    = | 0.0 | 0.2 | 0.4 | 0.6 | 0.8 | 1.0 | 1.2 | 1.4 | 1.6 | 1.8 | 2.0 |
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| f(x) = | 2.7 | 2.1 | 2.3 | 1.7 | 2.2 | 2.9 | 3.1 | 3.4 | 3.9 | 4.9 | 8.7 |
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
I was wondering if anyone can lead me in the right direction with the above question. I know I'm supposed to use the equation stated below, but I'm not too sure what \(\displaystyle n\) is, in order to figure out \(\displaystyle h\).

The \(\displaystyle n\)-subinterval Trapezoidal Rule approximation to \(\displaystyle \int_a^b\, f(x)\, dx\), denoted \(\displaystyle T_n\), is given by:

. . . . .\(\displaystyle T_n\, =\, h\left(\frac{1}{2}y_0\, +\, y_1\, +\, y_2\, +\, y^3\, ...\, +\, y_{n-1}\, +\, \frac{1}{2}y_n\right)\)

We assume \(\displaystyle f(x)\) is continuous on \(\displaystyle [a,\, b]\) and subdivide \(\displaystyle [a,\, b]\) into \(\displaystyle n\) subintervals of equal length \(\displaystyle h\, =\, (b\, -\, a)/n\) using the \(\displaystyle n\, +\, 1\) points.
h is the width of each bin, which you can see by looking at the x-row of the table is h=0.2. The trapezoidal rule works for any n, either even or odd. Just take half of the first and last y-values, plus 1 times the sum of the rest, and multiply by h.
 
Last edited by a moderator:
Top