\documentclass[11pt]{article}
\def\Z{\mathbb{Z}}
\def\Q{\mathbb{Q}}
\usepackage{latexsym,amsmath,amssymb,graphicx}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textheight}{8.5in}
\begin{document}
\centerline{Mathematics 136 -- Calculus 2}
\centerline{Selected Solutions for Lab Day 2 -- ``In search of a better numerical integral method''}
\centerline{November 11, 2016}

\vskip 10pt 
\noindent
B 3)  How is the sign of the error for $M_N$ related to the concavity of $y = f(x)$ on 
the interval $[a,b]$?  (You can determine the concavities from the plots
produced in the {\tt ApproximateIntTutor} pop-up.  
\vskip 10pt
\noindent
{\it Solution:}  The connection comes from the fact that if we look at one of the 
rectangles corresponding to a term in an $M_N$ approximation, then we can \emph{rotate}
the top edge of the rectangle about the point on the graph for $x = $ midpoint of the 
subinterval until it is tangent to the graph there, yielding a ``tangent trapezoid.''  
The picture if the graph
$y = f(x)$ is \emph{concave up} is shown in Figure 1 on the back.  The graph is in blue, 
the midpoint rectangle is in red, and the edges of the tangent trapezoid not contained
in the sides of the midpoint rectangle are shown dotted and in black.  We see:
\begin{itemize}
\item The tangent trapezoid obtained has area equal to the area of the midpoint
rectangle because the two triangles formed on either side of the midpoint
are congruent.
\item The slanted edge of the tangent trapezoid lies \emph{below} the graph $y = f(x)$
because the graph is assumed to be concave up.  
\item We show only one of the midpoint rectangles, but the situation is the 
same all through the interval. 
\item If the picture is like this on the whole interval $[a,b]$ (in particular, 
if the concavity is always the same), then adding up these terms we see the $M_N$
approximation is an \emph{underestimate} of the integral in this case:
$$M_N < \int_a^b f(x)\ dx.$$
In other words, the midpoint 
error, ${\rm Error}(M_N) = M_N - \int_a^b f(x)\ dx < 0$ is negative.  
\end{itemize}
The inequalities are reversed if $y = f(x)$ is concave down on the interval.
\vskip 10pt
\noindent
C 2)  
\vskip 10pt
\noindent
From B 3), we know that ${\rm Error}(M_N)$ is opposite in sign to 
${\rm Error}(T_N)$ and from our examples (or the error bounds) we expect
that $|{\rm Error}(T_N)| \doteq \frac{1}{2}|{\rm Error}(M_N)|.$
Consider what happens when we form the linear combination $S_N = \frac{2M_N + T_N}{3}$.
We will have
\begin{eqnarray*}
{\rm Error}(S_N) &=& S_N - \int_a^b f(x)\ dx\\
&=& \frac{2M_N + T_N}{3} - \int_a^b f(x)\ dx\\
&=& \frac{2}{3}\left(M_N - \int_a^b f(x)\ dx\right) + \frac{1}{3}\left(T_N - \int_a^b f(x)\ dx\right)\\
&=& \frac{2}{3}{\rm Error}(M_N) + \frac{1}{3} {\rm Error}(T_N)
\end{eqnarray*}
We have seen that if the concavity does not change on the interval, then 
the midpoint and trapezoidal rule errors are \emph{opposite in sign} and the 
trapezoidal rule error is roughly twice as large in absolute value.  Hence the last line
in the equations above will \emph{very nearly cancel out and be equal to zero}.  
(It will not be exactly zero in most cases because the equality 
$$|{\rm Error}(T_N)| \doteq \frac{1}{2}|{\rm Error}(M_N)|$$
is only approximate.
This is the complete explanation for why Simpson's rule is generally more accurate.\footnote{It is true
that the Simpson's rule formula can also be defined by looking at integrals of piecewise functions
with quadratic polynomial component functions.  However, we had not 
discussed that and the question was phrased to be answered using the description we
had.}

\begin{figure}
\begin{center}
\includegraphics[width=2.3truein,height=2.3truein]{TangTrap.png}
\caption{$y = f(x)$ concave up, midpoint rectangle, and tangent trapezoid} 
\end{center}
\end{figure}



\end{document}
