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 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 | +--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
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: