%Numerical Integration
%If you modify this file, please indicate here and in the footnote
%Math263B
\documentclass[12pt]{article}
\usepackage{times}
\pagestyle{empty}
\topmargin -.1in
\headheight 0in
\addtolength{\textwidth}{1.2in}
\addtolength{\textheight}{1.2in}
\addtolength{\oddsidemargin}{-.6in}
\addtolength{\evensidemargin}{-.6in}
\renewcommand{\baselinestretch}{1.0}
\parindent = 0cm
\parskip = .1cm
\begin{document}
\begin{center}
\Large
Riemann Sums I
\footnote{Copyright \copyright 2005 Todd Young.
All rights reserved. Please address comments to young@math.ohiou.edu.}
%modified by ~~~~}
\end{center}
\begin{enumerate}
\item In the command window type:\\
\verb& dx = .1&\\
\verb& x = 0:dx:2&\\
\verb& y = 3*x.^2&\\
Describe \verb&dx&, \verb&x& and \verb&y&.
\item Next type:\\
\verb& format long&\\
\verb& yl = y(1:20)&\\
\verb& L = dx*sum(yl)&\\
\verb& yr = y(2:21)&\\
\verb& R = dx*sum(yr)&\\
What are \verb&yl& and \verb&yr&?
What are \verb&L& and \verb&R&? How do they compare with the
true value of the integral (what
is the percentage errors)?
\item Repeat the above commands, but begin with:\\
\verb& dx = .001&\\
You will need to adjust the index numbers in the commands
for \verb&yl& and \verb&yr&.
What are the percentage errors of these approximations.
\item To obtain a midpoint Riemann sum type:\\
\verb& dx = .1&\\
\verb& x = dx/2:dx:2-dx/2&\\
\verb& y = 3*x.^2&\\
\verb& M = dx*sum(y)&\\
Explain why this is a midpoint sum. For $dx=.1$ and $dx =.001$
compute the percentage errors. Make a table of
percentage errors in all the above calculations.
\item Repeat all the above commands for the function
$f(x) = \sqrt{1 + .5\sin^2{x}}$\\
(input as \verb& y = sqrt(1 + .5*sin(x).^2))& and record
the answers. The value of this integral correct to
15 significant digits is: 2.27220510258726. Make a
table of percentage errors as above.
\item Using complete sentences and standard mathematical notation,
prepare a brief (\verb$< $1 page) written report answering all
the questions. Do {\bf not} get a printout.
\end{enumerate}
\vfill
\noindent
\textsf{The user compares different Riemann sums and considers
their accuracy.}
\end{document}