%% This document created by Scientific Notebook (R) Version 3.0


\documentclass[12pt,thmsa]{article}
\usepackage{amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{makeidx}
\usepackage{sw20jart}

%TCIDATA{TCIstyle=article/art4.lat,jart,sw20jart}

%TCIDATA{<META NAME="ViewSettings" CONTENT="31">}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="Title" CONTENT="Definite Integrals">}
%TCIDATA{Created=Mon Aug 19 14:52:24 1996}
%TCIDATA{LastRevised=Thu Feb 13 17:06:58 1997}
%TCIDATA{Language=American English}
%TCIDATA{CSTFile=MathHelp.cst}
%TCIDATA{<LINK REL="author" HREF="DM0-1.tex">}
%TCIDATA{<LINK REL="first" HREF="DM7-1.tex">}
%TCIDATA{<LINK REL="contents" HREF="DM0-0.tex">}
%TCIDATA{<LINK REL="copyright" HREF="DM0-2.tex">}
%TCIDATA{<LINK REL="end" HREF="DM7-9.tex">}
%TCIDATA{<LINK REL="index" HREF="DMIndex.tex">}
%TCIDATA{<LINK REL="next" HREF="DM7-7.tex">}
%TCIDATA{<LINK REL="parent" HREF="DM7.tex">}
%TCIDATA{<LINK REL="previous" HREF="DM7-5.tex">}
%TCIDATA{<LINK REL="top" HREF="DM0-0.tex">}

\input{tcilatex}
\begin{document}


\section{Definite Integrals\label{Definite integral}}

The \emph{definite integral} $\int_{a}^{b}f(x)dx$ of a 
\index{Definite Integral} 
\index{Integral!definite}function $f(x)$ defined on the interval $[a,b]$ is
given by 
\[
\int_{a}^{b}f(x)dx=\lim_{\left\| P\right\| \rightarrow
0}\sum_{i=1}^{n}f\left( 
\overline{x}_{i}\right) \Delta x_{i} 
\]
where $\overline{x}_{i}$ is a point in the $i$th subinterval of the
partition $P:a=x_{0}<x_{1}<x_{2}<\cdots <x_{n}=b$ of the interval $[a,b]$
and $\left\| P\right\| =\max \left\{ \Delta x_{i}\right\} $. The sum $%
\sum_{i=1}^{n}f\left( \overline{x}_{i}\right) \Delta x_{i}$ is called a
Riemann sum. The function $f$ is \emph{integrable} on $[a,b]$ if the
preceding limit exists.

If $f$ is integrable on $[a,b]$, then 
\[
\int_{a}^{b}f(x)dx=\lim_{n\rightarrow \infty }\frac{b-a}{n}%
\sum_{i=1}^{n}f\left( a+i\frac{b-a}{n}\right) 
\]
In particular, if $f$ is continuous on $[a,b]$, then $f$ is integrable on $%
[a,b]$.

\label{Evaluate}\label{Evaluate numerically}Definite integrals can be
evaluated in the same way as indefinite integrals: Leave the insertion point
in the expression and choose \textsf{Evaluate} or \textsf{Evaluate
Numerically}.

\begin{quote}
$\blacktriangleright $ To enter a definite integral
\end{quote}

\begin{enumerate}
\item[1.]  Click \FRAME{itbpF}{0.3009in}{0.3009in}{0.0701in}{}{}{integral.wmf%
}{\special{language "Scientific Word";type "GRAPHIC";display
"PICT";valid_file "F";width 0.3009in;height 0.3009in;depth
0.0701in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'Integral.wmf';file-properties "XNPEU";}} or choose \textsf{Insert + Operator%
} and choose the integral sign.

\item[2.]  Click \FRAME{itbpF}{0.3009in}{0.3009in}{0.0701in}{}{}{subscrip.wmf%
}{\special{language "Scientific Word";type "GRAPHIC";display
"PICT";valid_file "F";width 0.3009in;height 0.3009in;depth
0.0701in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'Subscrip.wmf';file-properties "XNPEU";}} or choose \textsf{Insert +
Subscript}.

\item[3.]  Use the tab key to enter the upper limit of integration. (Limits
of integration work the same as any other subscripts or superscripts.)

\item[4.]  Press the spacebar or the right arrow to get out of the
superscript, and type the rest of the expression.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate, Evaluate Numerically}
\end{quote}

\begin{quotation}
$\int_{0}^{1}x^{2}\sqrt{x^{3}+1}dx=\allowbreak \frac{4}{9}\sqrt{2}-\frac{2}{9%
}=\allowbreak .4063171388$
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\int_{0}^{1}x^{2}\sqrt{x^{3}+1}dx=\allowbreak .4063171388$

The following examples are easily handled by \textsl{Scientific Notebook}.
Choose \textsf{Evaluate} or \textsf{Evaluate Numerically} to compute these
integrals. 
\[
\begin{array}{lll}
\dint_{0}^{2\pi }\sin x\,dx\vspace{6pt} & \dint_{0}^{1}\sqrt{1-x^{2}}dx & 
\dint_{1}^{2}\ln x\,dx \\ 
\dint_{0}^{1}\ln x\,dx\vspace{6pt} & \dint_{a}^{b}x\ln x\,dx & 
\dint_{0}^{1}e^{x}\,dx \\ 
\dint_{0}^{\pi }x\ln \sin x\,dx\vspace{6pt} & \dint_{0}^{\infty
}e^{-x^{2}}\,dx & \dint_{1}^{\infty }\dfrac{1}{x^{2}}\,dx \\ 
\dint_{1}^{\infty }\dfrac{1}{x^{n}}\,dx\vspace{6pt} & \dint_{0}^{\pi /4}\sec
x\,dx & \dint_{0}^{\pi /2}\sec ^{3}x\,dx \\ 
\dint_{0}^{1}\dfrac{1}{x^{1/3}}\,dx & \dint_{0}^{\infty }\dfrac{\cos x}{%
\sqrt{x}}\,dx & \dint_{0}^{\infty }\,\dfrac{dx}{\left( 1+x\right) \sqrt{x}}%
\medskip
\end{array}
\]

Integrals involving 
\index{Absolute value}absolute values or 
\index{Piecewise-defined function}\label%
{Piecewise-defined function, integral}piecewise-defined functions can now be
treated like any other function.\medskip
\end{quotation}

\strut

\begin{example}
Consider the integral $\int_{-2}^{2}\left| x^{2}-1\right| dx$

\begin{itemize}
\item  \textsf{Evaluate} 
\[
\int_{-2}^{2}\left| x^{2}-1\right| dx=\allowbreak 4 
\]
This can be verified by writing the integral as a sum of several integrals
with the absolute-value sign removed.

\item  \textsf{Solve + Exact} 
\[
x^{2}-1>0%
\text{, Solution is: }\left\{ x<-1\right\} ,\allowbreak \left\{ 1<x\right\} 
\]
It follows that $\left| x^{2}-1\right| =x^{2}-1$ for $x<-1$ or $1<x,$ and $%
\left| x^{2}-1\right| =-\left( x^{2}-1\right) =1-x^{2}$ for $-1<x<1$. Thus,
you can write the integral as the sum of the following three integrals: 
\[
\int_{-2}^{2}\left| x^{2}-1\right| dx=\int_{-2}^{-1}\left( x^{2}-1\right)
dx+\int_{-1}^{1}\left( 1-x^{2}\right) dx+\int_{1}^{2}\left( x^{2}-1\right)
dx 
\]

\item  \textsf{Evaluate} 
\[
\int_{-2}^{-1}\left( x^{2}-1\right) dx+\int_{-1}^{1}\left( 1-x^{2}\right)
dx+\int_{1}^{2}\left( x^{2}-1\right) dx=\allowbreak 4 
\]
\medskip
\end{itemize}
\end{example}

\begin{example}
Suppose that $f$ is defined piecewise by the expression 
\[
f(x)=\left\{ 
\begin{array}{lll}
x^{2} & \text{if} & x<0 \\ 
x & \text{if} & x\leq 0
\end{array}
\right. 
\]
Direct evaluation of the integral $\int_{-2}^{3}f(x)dx$ yields $43/6$. This
can be verified by writing the integral as a sum of integrals involving
ordinary functions. This yields 
\[
\int_{-2}^{3}f(x)dx=\int_{-2}^{0}x^{2}dx+\int_{0}^{3}xdx=\allowbreak \frac{43%
}{6} 
\]
\end{example}

\strut

\begin{quotation}
\label{Improper integrals}\emph{Note: }You should use special care when
working with 
\index{Improper integrals} 
\index{Integral!improper}improper integrals. Make sure answers look
reasonable. Neither machines nor people are infallible, but people and
machines working together can accomplish more than either can working alone
or unattended.\medskip
\end{quotation}

\strut

\begin{example}
The following example illustrates one type of potential problem.

\textsf{Evaluate, Evaluate Numerically} 
\begin{eqnarray*}
\int_{-\pi }^{\pi }%
\frac{1+\sin x}{\left( x-\cos x\right) ^{2}}dx=\allowbreak -2\frac{\pi }{%
\left( \pi +1\right) \left( \pi -1\right) } \\
=\allowbreak -.7083952139
\end{eqnarray*}
This result cannot be correct because $\frac{1+\sin x}{\left( x-\cos
x\right) ^{2}}\geq 0$ for all $x$; thus the integral, if it exists, must be
nonnegative.
\end{example}

\strut

\begin{quotation}
\emph{Note}\quad This improper integral is examined further in the exercises
at the end of this chapter.
\end{quotation}

\strut

\subsection{\ Definite Integrals from the Definition\label%
{Definite integrals, definition}}

\strut

\begin{example}
Define $f$ by the equation $f(x)=x^{3}$. Calculate the integral $%
\int_{1}^{4}f(x)dx$ as follows.

\begin{enumerate}
\item[1.]  Enter the equation 
\[
\int_{1}^{4}f(x)dx=\lim_{n\rightarrow \infty }\sum_{i=1}^{n}f\left( 1+i\frac{%
4-1}{n}\right) \frac{4-1}{n} 
\]

\item[2.]  Select the term to the right of the summation sign.

\item[3.]  Press and hold down the \textsc{ctrl } key and apply \textsf{%
Evaluate}, then apply \textsf{Factor}.

\item[4.]  Select the series.

\item[5.]  Press and hold down the \textsc{ctrl } key and apply \textsf{%
Evaluate}, then apply \textsf{Expand}, then attach parentheses.

\item[6.]  With the insertion point in the expression, apply \textsf{Evaluate%
}.
\end{enumerate}

These steps produce the following sequence of expressions. 
\begin{eqnarray*}
\int_{1}^{4}f(x)dx=\lim_{n\rightarrow \infty }\sum_{i=1}^{n}f\left( 1+i\frac{%
4-1}{n}\right) \frac{4-1}{n} \\
=\lim_{n\rightarrow \infty }\sum_{i=1}^{n}3\frac{\left( n+3i\right) ^{3}}{%
n^{4}} \\
=\lim_{n\rightarrow \infty }\left( \frac{189}{2n}+\frac{135}{4n^{2}}+\frac{%
255}{4}\right) \\
=\allowbreak \frac{255}{4}
\end{eqnarray*}
\end{example}

For comparison, you can compute this integral directly.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\dint_{1}^{4}f(x)dx=\allowbreak \dfrac{255}{4}\medskip $
\end{quotation}

\strut

\subsection{\ Pictures of Riemann Sums\label{Riemann sums}}

You can plot pictures of Riemann sums 
\index{Riemann sums} obtained from midpoints, left endpoints, or right
endpoints of subintervals.

\subsubsection{Middle Boxes\label{Middle boxes}}

The Riemann sum determined by the 
\index{Middle boxes}midpoints is given by 
\[
\frac{b-a}{n}\sum_{i=0}^{n-1}f\left( a+\frac{b-a}{2n}+i\frac{b-a}{n}\right) 
\]
which is the sum of the areas of rectangles whose heights are determined by
midpoints of subintervals.

\begin{quote}
$\blacktriangleright $ To make a middle-boxes plot
\end{quote}

\begin{enumerate}
\item[1.]  Leave the insertion point inside the expression $x\sin x$.

\item[2.]  From the \textsf{Calculus} submenu, choose \textsf{Plot Approx.
Integral}.

\begin{itemize}
\item  A middle-boxes plot appears with default range settings.
\end{itemize}

\item[3.]  Click the plot to select the frame, or double-click the plot to
select the view.

\item[4.]  Click the properties tool \FRAME{itbpF}{0.3009in}{0.3009in}{%
0.0701in}{}{}{property.wmf}{\special{language "Scientific Word";type
"GRAPHIC";display "PICT";valid_file "F";width 0.3009in;height 0.3009in;depth
0.0701in;original-width 0pt;original-height 0pt;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename 'Property.wmf';file-properties
"XNPEU";}}.

\item[5.]  Reset the interval and number of boxes as desired.

\item[6.]  Choose \textsf{OK}.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Plot Approx. Integral}
\end{quote}

\begin{quotation}
$x\sin x$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$x\sin x$};linecolor "black";linestyle
1;linethickness 1;pointstyle "point";xmin "0";xmax "3.14";xviewmin
"0";xviewmax "3.14";yviewmin "-0.03639";yviewmax "1.857";rangeset"X";phi
45;theta 45;plottype 3;numpoints 49;axesstyle "normal";xis
\TEXUX{x};var1name \TEXUX{$x$};boxtype 4;numboxes 4;}}

Applied to the expression $x\sin x$, with four rectangles and limits 0 and
3, the approximating Riemann sum is 
\[
\frac{3}{4}\sum_{i=0}^{3}\left( \frac{3}{8}+i\frac{3}{4}\right) \sin \left( 
\frac{3}{8}+i\frac{3}{4}\right) =\allowbreak 3.17839115 
\]
Direct evaluation using \textsf{Evaluate Numerically} produces 
\[
\int_{0}^{3}x\sin xdx=\allowbreak 3.111097498 
\]

\subsubsection{Left Boxes\label{Left boxes}}

The sum of the areas enclosed by rectangles is the \emph{Riemann sum} 
\[
\frac{b-a}{n}\sum_{i=0}^{n-1}f\left( a+i\frac{b-a}{n}\right) 
\]
where the heights of the rectangles are determined by the function values at
the 
\index{Left boxes}left-hand endpoints of the subintervals.

\begin{quote}
$\blacktriangleright $ To make a left-boxes plot
\end{quote}

\begin{enumerate}
\item[1.]  Make a middle-boxes plot.

\item[2.]  Select the frame or the view.

\item[3.]  Click 
\FRAME{itbpF}{0.3009in}{0.3009in}{0.0701in}{}{}{property.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";display "PICT";valid_file
"F";width 0.3009in;height 0.3009in;depth 0.0701in;original-width
0pt;original-height 0pt;cropleft "0";croptop "1";cropright "1";cropbottom
"0";filename 'Property.wmf';file-properties "XNPEU";}}and choose the \textsf{%
Plot Components} page.

\item[4.]  Check \textsf{Left Boxes}.

\item[5.]  Reset the intervals and the number of boxes as desired.

\item[6.]  Choose \textsf{OK}.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Plot Approx. Integral, Edit +
Properties}
\end{quote}

\begin{quotation}
$x\sin x$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$x\sin x$};linecolor "black";linestyle
1;linethickness 1;pointstyle "point";xmin "0";xmax "3";xviewmin
"-0.06";xviewmax "3.061";yviewmin "-0.03637";yviewmax
"1.856";rangeset"X";phi 45;theta 45;plottype 3;numpoints 49;axesstyle
"normal";xis \TEXUX{x};var1name \TEXUX{$x$};boxtype 1;numboxes 4;}}

Applied to the expression $x\sin x,$ with four rectangles and $0\leq x\leq 3$%
, the approximating Riemann sum is 
\[
\frac{3}{4}\sum_{i=0}^{3}\left( i\frac{3}{4}\right) \sin \left( i\frac{3}{4}%
\right) =\allowbreak 2.818602182 
\]

\subsubsection{Right Boxes\label{Right boxes}}

For right boxes 
\index{Right boxes}, the sum of the areas enclosed by rectangles is the
Riemann sum 
\[
\frac{b-a}{n}\sum_{i=1}^{n}f\left( a+i\frac{b-a}{n}\right) 
\]
where the heights of the rectangles are determined by the function values at
the right-hand endpoints of the subintervals.

\begin{quote}
$\blacktriangleright $ To make a right-boxes plot
\end{quote}

\begin{itemize}
\item  Revise a middle-boxes plot or a left-boxes plot, this time choosing 
\textsf{Right Boxes}.
\end{itemize}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Plot Approx. Integral}
\end{quote}

\begin{quotation}
$x\sin x$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";function \TEXUX{$x\sin x$};linecolor "black";linestyle
1;linethickness 1;pointstyle "point";xmin "0";xmax "3";xviewmin "0";xviewmax
"3";yviewmin "-0.03637";yviewmax "1.856";rangeset"X";phi 45;theta
45;plottype 3;numpoints 49;axesstyle "normal";xis \TEXUX{x};var1name
\TEXUX{$x$};boxtype 2;numboxes 4;}}

Applied to the expression $x\sin x$, with four rectangles and $0\leq x\leq 3$%
, the approximating Riemann sum is 
\[
\frac{3}{4}\sum_{i=1}^{4}\left( i\frac{3}{4}\right) \sin \left( i\frac{3}{4}%
\right) =\allowbreak 3.1361222 
\]

\subsubsection{Left and Right Boxes}

\begin{quote}
$\blacktriangleright $ To make a plot that shows both left and right boxes
\end{quote}

\begin{itemize}
\item  Revise a middle-boxes plot or a left-boxes plot, this time choosing 
\textsf{Left and Right Boxes}.
\end{itemize}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Plot Approx. Integral}
\end{quote}

\begin{quotation}
$x\sin x$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";plot-snapshots TRUE;function \TEXUX{$x\sin x$};linecolor
"black";linestyle 1;linethickness 1;pointstyle "point";xmin "0";xmax
"3";xviewmin "-0.06";xviewmax "3.061";yviewmin "-0.03637";yviewmax
"1.856";rangeset"X";phi 45;theta 45;plottype 3;numpoints 49;axesstyle
"normal";xis \TEXUX{x};var1name \TEXUX{$x$};boxtype 3;numboxes 4;}}

\subsection{\ Making Assumptions\label{Assumptions about variables} About
Variables}

Occasionally, you will need to make 
\index{Assumptions about variables}assumptions about variables to do certain
calculations. For example, consider the following integral.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\dint_{0}^{1}nx^{2n-1}dx=\allowbreak 
\dfrac{1}{2}\lim\limits_{x\rightarrow 0+}\left( \left( x^{2}\right)
^{n}+1\right) $
\end{quotation}

\strut

The limit on the right exists for $n\geq 0$, but fails to exist for $n<0$.
You can evaluate this limit by applying the function $\func{assume}$ 
\index{Assume@Assume}to restrict possible values of $n$.

\label{Assume}\label{Additionally}\label{About}In this section, we discuss
three 
\index{Additionally@Additionally} 
\index{About@About}functions 
\[
\func{assume}\qquad \func{additionally}\qquad \func{about} 
\]
These functions place restraints on specific variables, or provide
information on the restraints. The function \textsl{assume} enables you to
place a restraint on a variable. The function \textsl{additionally} allows
you to place additional restraints; and the function \textsl{about} returns
information on the restraints.

\begin{quote}
$\blacktriangleright $ To compute the integral $\dint_{0}^{1}nx^{2n-1}dx$
\end{quote}

\begin{enumerate}
\item[1.]  Enter the expression 
\[
\func{assume}(n,\func{positive})\medskip 
\]
in mathematics mode. (The two terms---$\func{assume}$ and $\func{positive}$%
---will automatically turn gray when they are typed.)

\item[2.]  With the insertion point in the expression $\func{assume}(n,\func{%
positive})$, choose \textsf{Evaluate}.

\item[3.]  Place the insertion point in the integral $%
\int_{0}^{1}nx^{2n-1}dx $ and choose \textsf{Evaluate}. 
\[
\int_{0}^{1}nx^{2n-1}dx=\allowbreak \frac{1}{2} 
\]
\end{enumerate}

\strut

\begin{quotation}
\textsl{Tip}\quad Note that $\func{assume}$, $\func{about}$, and $\func{%
additionally}$ are mathematical functions, so you need to be in mathematics
mode when you type these commands.
\end{quotation}

\strut

\begin{itemize}
\item  \label{Allowable assumptions}Allowable assumptions include 
\[
\func{real}\quad \func{complex}\quad \func{integer}\quad \func{positive}%
\quad \func{negative} 
\]
\end{itemize}

Evaluation of the expressions $\func{assume}(n,\func{positive})$ and $\func{%
additionally}(n,\func{integer})$, followed by evaluation of the expression $%
\func{about}(n)$, produces the following output.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate, Evaluate, Evaluate}
\end{quote}

\begin{quotation}
$\func{assume}(n,\func{positive})$

$\func{additionally}(n,\func{integer})$

$\func{about}(n)$ : $\func{integer},\func{RealRange}\left( 1,\infty \right) $
\end{quotation}

\strut

The following sequence of operations tests the equality $\Gamma (n+1)=n!$
under the assumption that $n$ is a positive integer.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate, Evaluate, Check Equality}
\end{quote}

\begin{quotation}
$\func{assume}(n,\func{positive})$

$\func{additionally}(n,\func{integer})$

$\Gamma (n+1)=n!$ is true
\end{quotation}

\medskip

To clear the assumptions about a variable, select the variable and choose 
\textsf{Define + Undefine}

\begin{quote}
$\blacktriangleright $ \textsf{Define + Undefine}
\end{quote}

\begin{quotation}
$n$
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$\func{about}(n)$ : No assumptions\medskip
\end{quotation}

\strut

\subsection{\ Approximation Methods\label{Approximate integral}}

\textsl{Scientific Notebook} supports the midpoint 
\index{Approximation methods}method, the trapezoidal rule, and Simpson's
rule for approximating define integrals. To apply each of these
approximation methods, place the insertion point in a mathematical
expression, from the \textsf{calculus} submenu choose \textsf{Approximate
Integral}, and then choose the appropriate method in the dialog box.

\subsubsection{Midpoint Rule\label{Midpoint rule}}

\begin{quotation}
In general, the \emph{midpoint approximation} $M_{n}$ for $%
\int_{a}^{b}f(x)dx $ with $n$ subdivisions is given by 
\index{Midpoint rule} 
\index{Approximate integral!midpoint rule} 
\index{Definite integral!midpoint rule} 
\[
\int_{a}^{b}f(x)dx\approx M_{n}=%
\frac{b-a}{n}\sum_{i=0}^{n}f\left( a+\frac{b-a}{2n}+i\frac{b-a}{n}\right) 
\]
with an error bound of 
\[
\left| M_{n}-\int_{a}^{b}f(x)dx\right| \leq K\frac{(b-a)^{3}}{24n^{2}} 
\]
where $K$ is any number such that $\left| f^{\prime \prime }(x)\right| \leq
K $ for all $x\in \left[ a,b\right] $.
\end{quotation}

\begin{quote}
$\blacktriangleright $ To approximate $\int_{0}^{\pi }x\sin x\,dx$ using the
midpoint method
\end{quote}

\begin{enumerate}
\item[1.]  Leave the insertion point in the expression $\int_{0}^{\pi }x\sin
x\,dx$.

\item[2.]  From the \textsf{Calculus} submenu, choose \textsf{Approximate
Integral}.

\item[3.]  Choose \textsf{Midpoint} in the dialog box with 10 \textsf{%
Subintervals}.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Approximate Integral + Midpoint}
\end{quote}

\begin{quotation}
$\dint_{0}^{\pi }x\sin x\,dx$ Approximate integral (midpoint rule) is

$\frac{1}{10}\pi \dsum\limits_{i=0}^{9}\frac{1}{10}\left( i+\frac{1}{2}%
\right) \pi \sin \frac{1}{10}\left( i+\frac{1}{2}\right) \pi $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\frac{1}{10}\pi \dsum\limits_{i=0}^{9}\frac{1}{10}\left( i+\frac{1}{2}%
\right) \pi \sin \frac{1}{10}\left( i+\frac{1}{2}\right) \pi =\allowbreak
3.1545$

\textsl{Note}\emph{\quad }You can also find approximate integrals by
specifying only the expression $x\sin x$ (without the $\int_{0}^{\pi }$ or
the $dx)$, in which case you enter the lower and upper ends of the range in
the dialog box.
\end{quotation}

To get the following output you enter 0 as \textsf{Lower End of Range} and
3.14159 as \textsf{Upper End of Range} in the dialog box.

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Approximate integral + Midpoint}
\end{quote}

\begin{quotation}
$x\sin x$ Approximate integral (midpoint rule) is

$.31416\sum_{i=0}^{9}\left( .31416i+.15708\right) \sin \left(
.31416i+.15708\right) $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate}
\end{quote}

\begin{quotation}
$.31416\dsum\limits_{i=0}^{9}\left( .31416i+.15708\right) \sin \left(
.31416i+.15708\right) =\allowbreak 3.1545$
\end{quotation}

\subsubsection{Trapezoid Rule\label{Trapezoidal rule}\label{Trapezoid rule}}

\begin{quotation}
The formula for the \emph{trapezoid rule} approximation 
\index{Trapezoidal rule} 
\index{Approximate integral!trapezoidal rule} 
\index{Definite integral!trapezoidal rule}$T_{n}$ is given by 
\[
\int_{a}^{b}f(x)dx\approx T_{n}=%
\frac{b-a}{2n}\left( f(a)+2\sum_{i=1}^{n-1}f\left( a+i\frac{b-a}{n}\right)
+f(b)\right) 
\]
with an error bound of 
\[
\left| T_{n}-\int_{a}^{b}f(x)dx\right| \leq K\frac{(b-a)^{3}}{12n^{2}} 
\]
where $K$ is any number such that $\left| f^{\prime \prime }(x)\right| \leq
K $ for all $x\in \left[ a,b\right] $.
\end{quotation}

\begin{quote}
$\blacktriangleright $ To approximate $\int_{0}^{\pi }x\sin x\,dx$ using the
trapezoid rule
\end{quote}

\begin{enumerate}
\item[1.]  Leave the insertion point in the expression $\int_{0}^{\pi }x\sin
x\,dx$.

\item[2.]  From the \textsf{Calculus} submenu, choose \textsf{Approximate
Integral}.

\item[3.]  Choose \textsf{Trapezoid} in the dialog box with 10 \textsf{%
Subintervals}.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Approximate Integral + Trapezoid}
\end{quote}

\begin{quotation}
$\dint_{0}^{\pi }x\sin x\,dx$ Approximate integral (trapezoid rule) is

$\frac{1}{10}\pi \dsum\limits_{i=1}^{9}\frac{1}{10}i\pi \sin \frac{1}{10}%
i\pi $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\frac{1}{10}\pi \dsum\limits_{i=1}^{9}\frac{1}{10}i\pi \sin \frac{1}{10}%
i\pi =\allowbreak 3.1157$
\end{quotation}

\subsubsection{Simpson's Rule\label{Simpson's rule}}

\begin{quotation}
The \emph{Simpson's rule} approximation 
\index{Simpson's rule} 
\index{Approximate integral!Simpson's rule} 
\index{Definite integral!Simpson's rule}$S_{n}$ ($n$ an even positive
integer) is given for an arbitrary function $f$ by 
\begin{eqnarray*}
\int_{a}^{b}f(x)\,dx &\approx &S_{n} \\
&=&%
\frac{b-a}{3n}\left( f\left( a\right) +f\left( b\right)
+4\sum_{i=1}^{n/2}f\left( a+\left( 2i-1\right) \frac{b-a}{n}\right) \right.
\\
&&\left. +2\sum_{i=1}^{-1+n/2}f\left( a+2i\frac{b-a}{n}\right) \right)
\end{eqnarray*}
The error bound for Simpson's rule is given by 
\[
\left| S_{n}-\int_{a}^{b}f(x)\,dx\right| \leq K\frac{(b-a)^{5}}{180n^{4}}%
\medskip 
\]
where $K$ is any number such that $\left| f^{(4)}(x)\right| \leq K$ for all $%
x\in \left[ a,b\right] $. In particular, Simpson's rule is exact for
integrals of polynomials of degree at most 3 (because the fourth derivative
of such a polynomial is identically zero).
\end{quotation}

\begin{quote}
$\blacktriangleright $ To approximate $\int_{0}^{\pi }x\sin x\,dx$ using
Simpson's rule
\end{quote}

\begin{enumerate}
\item[1.]  Leave the insertion point in the expression $\int_{0}^{\pi }x\sin
x\,dx$.

\item[2.]  From the \textsf{Calculus} submenu, choose \textsf{Approximate
Integral}.

\item[3.]  Choose \textsf{Simpson} in the dialog box with 10 \textsf{%
Subintervals}.
\end{enumerate}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Approximate Integral + Simpson}
\end{quote}

\begin{quotation}
$\dint_{0}^{\pi }x\sin x\,dx$ Approximate integral (Simpson's rule) is

$\frac{1}{30}\pi \left( 4\dsum\limits_{i=1}^{5}\frac{1}{10}\left(
2i-1\right) \pi \sin \frac{1}{10}\left( 2i-1\right) \pi
+2\dsum\limits_{i=1}^{4}\frac{1}{5}i\pi \sin \frac{1}{5}i\pi \right) $
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\frac{1}{30}\pi \left( 4\dsum\limits_{i=1}^{5}\frac{1}{10}\left(
2i-1\right) \pi \sin \frac{1}{10}\left( 2i-1\right) \pi
+2\dsum\limits_{i=1}^{4}\frac{1}{5}i\pi \sin \frac{1}{5}i\pi \right)
=\allowbreak 3.1418\medskip $
\end{quotation}

\strut

\begin{example}
To find the number of subdivisions required to approximate $%
\int_{0}^{1}e^{-x^{2}}dx$ using Simpson's rule, with an error of at most $%
10^{-5}$ you need to find an upper bound for the fourth derivative of $%
e^{-x^{2}}$ on the interval $\left[ 0,1\right] $. On way you can do this is
by plotting the fourth derivative on the interval $\left[ 0,1\right] $.
Define $f(x)=e^{-x^{2}}$. Then evaluate the expression $f^{(4)}(x)$to get$%
\allowbreak $%
\[
f^{(4)}(x)=12e^{-x^{2}}-48x^{2}e^{-x^{2}}+16x^{4}e^{-x^{2}} 
\]
\end{example}

$\blacktriangleright $ \textsf{Plot 2D + Rectangular}

\begin{quotation}
$12e^{-x^{2}}-48x^{2}+16x^{4}e^{-x^{2}}$
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";plot-snapshots TRUE;function
\TEXUX{$12e^{-x^{2}}-48x^{2}+16x^{4}e^{-x^{2}}$};linecolor "black";linestyle
1;linethickness 1;pointstyle "point";xmin "0";xmax "1";xviewmin
"-0.02";xviewmax "1.02";yviewmin "-38.69";yviewmax
"13.01";rangeset"X";recompute TRUE;phi 45;theta 45;plottype 4;numpoints
49;axesstyle "normal";xis \TEXUX{x};var1name \TEXUX{$x$};}}

\begin{example}
From the graph, you can see that $f^{(4)}(x)$ has a maximum value on this
interval of $f^{(4)}(0)=\allowbreak 12$. Solve the inequality 
\[
12\frac{(1-0)^{5}}{180n^{4}}\leq 10^{-5} 
\]
to get the potential solutions 
\[
\left\{ n\leq -\frac{10}{3}\sqrt{3}\sqrt[4]{6}\right\} ,\allowbreak \left\{
n=0\right\} ,\allowbreak \left\{ \frac{10}{3}\sqrt{3}\sqrt[4]{6}\leq
n\right\} 
\]
Since $n$ must be an even positive integer, $n\geq \frac{10}{3}\sqrt{3}\sqrt[%
4]{6}=\allowbreak 9.036$, we take $n=10$. Calculating, 
\begin{eqnarray*}
S_{10}\approx \frac{1}{30}+\frac{1}{30}e^{-1}+\frac{2}{15}%
\sum_{i=1}^{5}e^{-\left( \frac{1}{5}i-\frac{1}{10}\right) ^{2}}+\frac{1}{15}%
\sum_{i=1}^{4}e^{-\frac{1}{25}i^{2}} \\
=\allowbreak .7468249483
\end{eqnarray*}
Direct evaluation using \textsf{Evaluate Numerically} yields 
\[
\int_{0}^{1}e^{-x^{2}}dx=\allowbreak .7468241328 
\]
and 
\[
\left| \allowbreak .7468241328-\allowbreak .7468249483\right| =8.155\times
10^{-7}<10^{-5} 
\]
\medskip
\end{example}

\subsection{\ Numerical Integration\label{Numerical integration}}

Many integrals (such as $\int_{0}^{1}e^{-x^{2}}dx$ and $\int_{0}^{\pi }\frac{%
\sin t}{t}dt$) cannot be evaluated exactly, but you get numerical
approximations by choosing \textsf{Evaluate Numerically}.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\dint_{0}^{1}e^{-x^{2}}dx=\allowbreak .7468241328\vspace{6pt}$

$\dint_{0}^{\pi }\dfrac{\sin t}{t}dt=\allowbreak 1.851937052$
\end{quotation}

Integrals associated with arc lengths of curves can almost never be
evaluated exactly.

\begin{quotation}
Given a curve $y=f(x)$, the \emph{arc length} between $x=a$ and $x=b$ is
given by the integral 
\[
\int_{a}^{b}\sqrt{1+\left( f^{\prime }(x)\right) ^{2}}dx 
\]
\end{quotation}

\medskip

For example, given $f(x)=x\sin x$, consequently, $f^{\prime }(x)=\allowbreak
\sin x+x\cos x$, you can find the length of the arc between $x=0$ and $x=\pi 
$ by applying \textsf{Evaluate Numerically}.

\begin{quote}
$\blacktriangleright $ \textsf{Evaluate Numerically}
\end{quote}

\begin{quotation}
$\dint_{0}^{\pi }\sqrt{1+\left( f^{\prime }(x)\right) ^{2}}dx=\dint_{0}^{\pi
}\sqrt{1+\left( \sin x+x\cos x\right) ^{2}}dx=\allowbreak 5.04040692$
\end{quotation}

\strut

Curves in the plane or three-dimensional space can also be represented
parametrically.\medskip

\begin{example}
The center of a piece of string of radius $r$ wound around a spool of radius 
$R$ can be represented by the parametric equations 
\[
x=(R+r)\cos \theta ,y=(R+r)\sin \theta ,z=\frac{r\theta }{\pi } 
\]
Assume that $r=1/8$ inch, $R=1$ inch, and the spool is $2$ inches long. Find
the length of string required to wrap on layer around the spool.

To find the length, you can first find the arc length of one loop of the
curve by defining the functions $x$, $y$, $z$ and using the formula for arc
length. 
\[
\int_{0}^{2\pi }\sqrt{\left( \frac{dx}{d\theta }\right) ^{2}+\left( \frac{dy%
}{d\theta }\right) ^{2}+\left( \frac{dz}{d\theta }\right) ^{2}}d\theta
=\allowbreak 7.07300306 
\]
Then, since the spool is 2 inches long, there would be approximately eight
loops in one layer for a total spring length of 
\[
7.07300306\times 8=\allowbreak 56.58402448 
\]
inches.

Another way to calculate the length of this string is to calculate volume in
two ways. Let $L$ be the length of the string. For the purpose of
calculating volume, assume that the cross section of the string is square
with width $1/4$ inch. Then, the volume $V$ is given by 
\[
V=L/16=2\pi \left( R+2r\right) ^{2}-2\pi R^{2} 
\]
Solving for $L$, we get $L=16\left( 2\pi \left( R+2r\right) ^{2}-2\pi
R^{2}\right) =\allowbreak 56.54866776$ inches.

This method of calculating the volume in two different ways works especially
well if the string is wrapped around the spool numerous times.
\end{example}

\strut

The preceding example can be visualized graphically. In the \textsf{Plot
Properties} tabbed dialog, set the \textsf{Plot Style} to \textsf{Hidden
Line, }the \textsf{Sample Size} to 99, the \textsf{Radius} to 1/8, and the 
\textsf{Domain Interval} to $0\leq t\leq 16\pi =50.265;$ choose \textsf{%
Equal Scaling on Each Axis}.

\begin{quote}
$\blacktriangleright $ \textsf{Plot 3D + Tube}
\end{quote}

\begin{quotation}
$\left[ \frac{9}{8}\cos t,\frac{9}{8}\sin t,\frac{t}{8\pi }\right] $
\end{quotation}

\FRAME{dtbpF}{3in}{2.0003in}{0pt}{}{}{}{\special{language "Scientific
Word";type "MAPLEPLOT";width 3in;height 2.0003in;depth 0pt;display
"PICT";maintain-aspect-ratio TRUE;plot-snapshots TRUE;function
\TEXUX{$\left[ \frac{9}{8}\cos t,\frac{9}{8}\sin t,\frac{t}{8\pi }\right]
$};linecolor "black";linestyle 1;linethickness 1;pointstyle "point";radius
\TEXUX{$1/8$};xmin "0";xmax "50.26548246";xviewmin "-1.297";xviewmax
"1.3";yviewmin "-1.299";yviewmax "1.3";zviewmin "-0.1677";zviewmax
"2.169";rangeset"X";recompute TRUE;phi 45;theta 45;plottype 13;constrained
TRUE;num-x-gridlines 99;num-y-gridlines 10;plotstyle "hidden";axesstyle
"none";plotshading "Z";xis \TEXUX{t};}}

\subsection{\ Related topics}

\begin{itemize}
\item  \hyperref{Limits}{}{}{DM7-2.tex#Limit}

\item  \hyperref{Differentiation}{}{}{DM7-3.tex#Derivative}

\item  \hyperref{Indefinite Integration}{}{}{DM7-4.tex#Indefinite integral}

\item  \hyperref{Sequences and Series}{}{}{DM7-7.tex#Sequences}

\item  \hyperref{Plotting Curves and Surfaces}{}{}{DM6-1.tex#Plotting}

\item  \hyperref{Frame Properties}{}{}{DM6-2.tex#Frame Properties}

\item  \hyperref{The View for 2D Plots}{}{}{DM6-3.tex#View intervals}

\item  \hyperref{2D Plots of Functions and Expressions}{}{}{DM6-4.tex#Plot
expression}

\item  \hyperref{The View Box for 3D Plots}{}{}{DM6-5.tex#Plot 3D, view}

\item  \hyperref{3D Plots of Functions and Expressions}{}{}{DM6-6.tex#3D
Plots}

\item  \hyperref{Exercises and Solutions}{}{}{DM7-9.tex#Exercises}
\end{itemize}

\rule{0.67in}{0.01in}

\hyperref{\FRAME{itbpF}{38.875pt}{24.5pt}{6pt}{}{}{index.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid-file "F";width 38.875pt;height 24.5pt;depth
6pt;original-width 36.125pt;original-height 22.5625pt;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename 'index.wmf';file-properties
"XNPEU";}}}{}{}{DMIndex.tex#Math Index}\quad {\small Index entries: 
\hyperref{Curves in space}{}{}{DMIndex.tex#Curves in space}, \hyperref{%
Cylindrical coordinates}{}{}{DMIndex.tex#Cylindrical coordinates}, \hyperref{%
Plot properties}{}{}{DMIndex.tex#Plot properties}, \hyperref{Plotting tools}{%
}{}{DMIndex.tex#Plotting tools}, \hyperref{Plotting 3D}{}{}{%
DMIndex.tex#Plotting 3D}, \hyperref{Surfaces of revolution}{}{}{%
DMIndex.tex#Surfaces of revolution}, \hyperref{Tube plots}{}{}{%
DMIndex.tex#Tube plots}}

\end{document}
