| Version 15 |
Version 14 |
| \PMlinkescapeword{proposition} |
\PMlinkescapeword{proposition} |
| \textbf{Definition}\\ |
\textbf{Definition}\\ |
| The \emph{trapezoidal rule} is a method for approximating a definite integral by evaluating the integrand at two points. The formal rule is given by |
The \emph{trapezoidal rule} is a method for approximating a definite integral by evaluating the integrand at two points. The formal rule is given by |
| \[ |
\[ |
| \int_{a}^{b}f(x)\,dx\;\approx\;\frac{h}{2}\left[f(a)+f(b)\right] |
\int_{a}^{b}f(x)\,dx\;\approx\;\frac{h}{2}\left[f(a)+f(b)\right] |
| \] |
\] |
| where $h=b-a$. |
where $h=b-a$. |
|
|
|
This rule comes from determining the area of a right trapezoid with \PMlinkname{bases}{Base9} of lengths $f(a)$ and $f(b)$ respectively and a height of length $h$. When using a graph to illustrate the trapezoidal rule, the height of the right trapezoid is actually horizontal and the bases are vertical. This may be confusing to someone who is seeing the trapezoidal rule for the first time. An example is shown below.
|
This rule comes from determining the area of a right trapezoid with bases of lengths $f(a)$ and $f(b)$ respectively and a height of length $h$. When using a graph to illustrate the trapezoidal rule, the height of the right trapezoid is actually horizontal and the bases are vertical. This may be confusing to someone who is seeing the trapezoidal rule for the first time. An example is shown below.
|
|
|
| \begin{center} |
\begin{center} |
| \begin{pspicture}(-2,-1)(2,5) |
\begin{pspicture}(-2,-1)(2,5) |
| \psline{<->}(-2,0)(2,0) |
\psline{<->}(-2,0)(2,0) |
| \psline{<->}(0,-0.5)(0,4) |
\psline{<->}(0,-0.5)(0,4) |
| \parabola{<->}(2,4)(0,0) |
\parabola{<->}(2,4)(0,0) |
| \pspolygon[linecolor=red](-1,0)(-1,1)(1.5,2.25)(1.5,0) |
\pspolygon[linecolor=red](-1,0)(-1,1)(1.5,2.25)(1.5,0) |
| \rput[b](2,-0.5){$x$} |
\rput[b](2,-0.5){$x$} |
| \rput[l](-0.4,5){$y$} |
\rput[l](-0.4,5){$y$} |
| \rput[r](-1,0.5){$f(a)$} |
\rput[r](-1,0.5){$f(a)$} |
| \rput[l](1.5,1){$f(b)$} |
\rput[l](1.5,1){$f(b)$} |
| \rput[a](0.25,-0.3){$h$} |
\rput[a](0.25,-0.3){$h$} |
| \psdots(-1,1)(1.5,2.25) |
\psdots(-1,1)(1.5,2.25) |
| \rput[l](-2,0){.} |
\rput[l](-2,0){.} |
| \end{pspicture} |
\end{pspicture} |
| \end{center} |
\end{center} |
|
|
| The figure in red need not be a right trapezoid. If either $f(a)=0$ or $f(b)=0$, the figure will be a right triangle. If both $f(a)=0$ and $f(b)=0$, the figure will be a line segment. In any case, the same rule for approximating the corresponding definite integral is used. |
The figure in red need not be a right trapezoid. If either $f(a)=0$ or $f(b)=0$, the figure will be a right triangle. If both $f(a)=0$ and $f(b)=0$, the figure will be a line segment. In any case, the same rule for approximating the corresponding definite integral is used. |
|
|
| The trapezoidal rule is the first Newton-Cotes quadrature formula. 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 with a \PMlinkescapetext{simple} example. |
The trapezoidal rule is the first Newton-Cotes quadrature formula. 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 with a \PMlinkescapetext{simple} example. |
|
|
| \textbf{Proposition:}\\ |
\textbf{Proposition:}\\ |
| If $f$ is Riemann integrable on $[a,b]$, $|f''(x)| \le M$ for all $x \in [a,b]$ then |
If $f$ is Riemann integrable on $[a,b]$, $|f''(x)| \le M$ for all $x \in [a,b]$ then |
| $$\left| \int_a^b f(x) \, dx - \frac{h}{2}\left[f(a)+f(b)\right] |
$$\left| \int_a^b f(x) \, dx - \frac{h}{2}\left[f(a)+f(b)\right] |
| \right| \le \frac{M(b-a)^3}{12}.$$ |
\right| \le \frac{M(b-a)^3}{12}.$$ |
|
|
| \textbf{Example:} |
\textbf{Example:} |
|
|
| Using the fundamental theorem of calculus shows |
Using the fundamental theorem of calculus shows |
| \[ |
\[ |
| \int_{0}^{1}x\,dx =\frac{1}{2}. |
\int_{0}^{1}x\,dx =\frac{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)]=\frac{1}{2}. |
\int_{0}^{1}x\,dx \;\approx\;\frac{1}{2}[f(0)+f(1)]=\frac{1}{2}. |
| \] |
\] |
|
|
| It is important to note that most calculus books give the wrong definition of the trapezoidal rule. Typically, they define it to be what is actually the composite trapezoidal rule, which uses the trapezoidal rule on a specified number of subintervals. Also note the trapezoidal rule can be derived by integrating a linear interpolation or using the |
It is important to note that most calculus books give the wrong definition of the trapezoidal rule. Typically, they define it to be what is actually the composite trapezoidal rule, which uses the trapezoidal rule on a specified number of subintervals. Also note the trapezoidal rule can be derived by integrating a linear interpolation or using the |
| method of undetermined coefficients. The latter is probably a bit easier. |
method of undetermined coefficients. The latter is probably a bit easier. |