\nopagenumbers
\magnification=1200
\baselineskip=12pt
\def \d{\displaystyle}
\def \h{\hfill}
\def \v{\vfill}
\def \title#1{\line{\h{\bf Math 151  #1}\h}}
\def \namdat#1{\line {Name and Section \vrule height .4pt width2in depth0pt
\h#1\par}}
\def \frac #1#2{{\d #1\over \d #2}}
\parindent=0pt
\font \bigbf = cmr10 scaled 1200
\def \i{\item}
\def \vs{\vskip 5pt}
\def \vss{\vskip 10pt}
\def \hs{\hskip 10pt}
\def \c{\circ}
\def \t{\theta}
\def \vc#1{ {\bf\vec#1} }
\def \q{\quad}


\baselineskip = 14pt
\line{\h  Spring 1998}
\line{\h \bigbf Maple Lab, Week 21 \h}
\vss
\line{\h \bigbf Far-Out Integrals I\h}
 \vs
 \centerline{\it Based on suggestions by M. L. Platt, CASE 
Newsletter \#28, April 1997}
\vss
 {\bf References:} 
\hbox{\vtop{\hsize=5truein\baselineskip=13pt
\obeylines% ALL STEWART REFS ARE TO ED 3!
Integration by parts: Stewart Sec.~7.1; CalcLabs Sec.~9.2
Numerical integration: Stewart Sec.~7.8; CalcLabs Secs.~7.3, 15.7
Limits at Infinity: Stewart Sec.~3.5}}
 \vss

{\bf Background:}  This lab demonstrates the usefulness of 
integration by parts to improve the results of a numerical 
integration.  It also introduces integration over an infinite 
interval, which we will study in more depth later (see
 Stewart Sec.~7.9).  Such integrals are defined by limit formulas 
of the sort
 $$\int_0^\infty f(x)\, dx = \lim_{L\to\infty} \int_0^L f(x)\, 
dx.$$

 
 \vss

{\bf Exercises:  1.}  Consider 
 $\d I_{\rm exp}(L) = \int_0^L x^2 e^{-x}\, dx$.
\vs
 {\bf (A)} Analytically (by hand) evaluate $I_{\rm exp}(L)$
 for $L = 10$, 100, 1000, and $\infty$.
 Use Maple to get the numerical values of your results.
 \vs
 {\bf (B)} Use Simpson's rule with $n = 100$
 %% load Student package, etc.?
 to evaluate $I_{\rm exp}(L)$  for $L = 10$, 100, and 1000.
 (Remember the {\tt simpson} command in the {\tt student} package.)
 Compare with your exact results.
 Use the error formula for Simpson's rule (Stewart p.~484)
 to estimate how many decimal places of accuracy you should have 
expected; compare with what actually happened; explain.
 \vs
 {\bf (C)} Could you have safely predicted the value of 
$I_{\rm exp}(\infty)$ from your Simpson results?


\vss
{\bf 2.}  Consider
$\d I_{\rm sin}(L) = \int_\pi^L {\sin x\over x}\, dx$.
(This integral can't be evaluated analytically.)
 \vs
 {\bf (A)} Use Simpson's rule with $n = 100$
 to evaluate $I_{\rm sin}(L)$  for $L = 10$, 100, and 1000.
 Use the error formula for Simpson's rule 
 to estimate how many decimal places of accuracy you should  
expect.
 Estimate how the accuracy would improve if you took $n=10,000$.
 \vs
 {\bf (B)} Discuss the feasibility of calculating a table
 of  values of $I_{\rm sin}(L)$ for $L = 1000$, 2000, \dots,
 10000, accurate to 4 decimal places.
Discuss the feasibility of determining $I_{\rm sin}(\infty)$ 
by calculating $I_{\rm sin}(L)$ for very large $L$ (using 
appropriately large values of~$n$). 
\vss

\goodbreak 
 {\bf 3.} {THE MAIN POINT:}
 Integrate $I_{\rm sin}(L)$ by parts (with $u = 1/x$,
 $dv = \sin x \, dx$) to get a new integral, $I_{\rm cos}(L)$,
  that is more amenable 
to numerical integration at large~$L$.
 Can you approximate $I_{\rm cos}(\infty)$ to 4 decimal places by 
 $I_{\rm cos}(L)$  for some $L$ that is small enough that the 
integral can be feasibly found with Simpson's rule?
 If necessary, integrate by parts again!
 \vs
 {\bf Hint:}  $\d \left|\int_L^\infty {\cos x \over x^n}\,dx 
\right| < \int_L^\infty {1\over x^n}\, dx$ (and similarly for 
$\,\sin$).

 \vss  
{\bf 4 (extra credit).} Find $\d \int_0^\infty {\sin x\over x}\, dx$
as accurately as you can.
 (You may need to take special action to tell Maple that 
the value of the integrand at~0 is equal to~0.)
\vss
  

 {\bf Save all your files, calculations, and output for possible 
use in the sequel to this lab, which will occur late in the 
semester.} 
\bye




