| Version 6 |
Version 5 |
| \begin{definition} |
\begin{definition} |
| The trapezoidal rule is a method for approximating a definite |
The trapezoidal rule is a method for approximating a definite |
| integral by evaluating the integrand at finitely many points. The |
integral by evaluating the integrand at finitely many points. The |
| formal rule is given by |
formal rule is given by |
|
\int_{x_{0}}^{x_{1}}f(x)\,dx\;=\;\frac{h}{2}\left[f(x_{0})+f(x_{1})\right]
|
\int_{x_{0}}^{x_{1}}f(x)\,dx\;=\;\frac{h}{2}[f(x_{0})+f(x_{1})]
|
| where $h=x_{1}-x_{0}$. |
where $h=x_{1}-x_{0}$. |
| \end{definition} |
\end{definition} |
| The trapezoidal rule is the first Newton-Cotes quadrature formula. |
The trapezoidal rule is the first Newton-Cotes quadrature formula. |
| It has degree of precision 1. This means it is exact for |
It has degree of precision 1. This means it is exact for |
| polynomials of degree less than or equal to one. We can see this |
polynomials of degree less than or equal to one. We can see this |
| with a \PMlinkescapetext{simple} example. |
with a \PMlinkescapetext{simple} example. |
| \begin{example} |
\begin{example} |
| Using the fundamental theorem of the calculus shows |
Using the fundamental theorem of the calculus shows |
| \int_{0}^{1}x\,dx =1/2. |
\int_{0}^{1}x\,dx =1/2. |
| In this case the trapezoidal rule gives the exact value, |
In this case the trapezoidal rule gives the exact value, |
| \int_{0}^{1}x\,dx \;\approx\;\frac{1}{2}[f(0)+f(1)]=1/2. |
\int_{0}^{1}x\,dx \;\approx\;\frac{1}{2}[f(0)+f(1)]=1/2. |
| \end{example} |
\end{example} |
| It is important to note that most calculus books give the wrong |
It is important to note that most calculus books give the wrong |
| definition of the trapezoidal rule. Typically they define a |
definition of the trapezoidal rule. Typically they define a |
| composite trapezoidal rule which uses the trapezoidal rule on a |
composite trapezoidal rule which uses the trapezoidal rule on a |
| specified number of subintervals. Also note the trapezoidal rule |
specified number of subintervals. Also note the trapezoidal rule |
| can be derived by integrating a linear interpolation or using the |
can be derived by integrating a linear interpolation or using the |
| method of undetermined coefficients. The later is probably a bit |
method of undetermined coefficients. The later is probably a bit |
| easier. |
easier. |