\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{color}
\setlength{\topmargin}{-0.6 true in}
\setlength{\headsep}{0 true in}
\setlength{\topskip}{0 true in}
\setlength{\textwidth}{6.5 true in}
\setlength{\oddsidemargin}{0 true in}
\setlength{\evensidemargin}{0 true in}
\setlength{\textheight}{9.6 true in}
\renewcommand{\arraystretch}{1.2}
\newcommand{\eps}{\varepsilon}
\newcommand{\R}{{\mathbb R}}
\newcommand{\N}{{\mathbb N}}
\newcommand{\Q}{{\mathbb Q}}
\newcommand{\Z}{{\mathbb Z}}
\theoremstyle{definition}
\newtheorem{problem}{Problem}
\definecolor{darkblue}{RGB}{0,0,150}
\definecolor{darkred}{RGB}{180,0,0}
\newenvironment{answer}{\par\medskip\bgroup\color{darkblue}}{\egroup\par\medskip}
\newenvironment{grading}{\par\medskip\bgroup\color{darkred}}{\egroup\par\bigskip}


\begin{document}

\hbox to \hsize{\textbf{Math 331\hfill Midterm Exam}}
\nointerlineskip
\vskip 3pt
\hrule height 1pt

\medskip

{\narrower\narrower\small{
This test is due before class time on Monday, October 26.  
You should do this test on your own, using only your textbook, class notes, 
and previous work in the course as reference.  You should
not work with other students, you should not use the Internet or other references, and you should not
consult anyone except me.  You can ask questions about the test in class and by email.
If I answer an emailed question, I will send my response to everyone in the class.
I might give some hints and clarifications, but I am unlikely to give
extensive, detailed help.   Be sure to show all of
your work! \textbf{Note: There will be no ``rewrites'' of midterm exam problems.}
Grades on the exam might be curved, if they would lower the class average substantially.\par
This test counts for 15\% of your overall grade for the course.  \textbf{You should do only
7 of the 8 problems on this test.}  If you submit answers for all problems, your answer for
problem 8 will be ignored.  If you cannot prove something, you should still turn in whatever
work you can do on it for partial credit---maybe an intuitive argument or other thoughts.
Although some
problems are more difficult than others, and some are quite easy, all 7 problems will count equally.}
\par}

\medskip
\hrule height 1pt
\bigskip


\def\ds{\displaystyle}


\begin{problem}  % problem 1
Recall that  $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+x^{n-3}y^2+\cdots+xy^{n-2}+y^{n-1})$
for any $n\in \N$.
Use this fact to prove directly from the definition of the derivative that
$\frac{d}{dx}x^n=nx^{n-1}$ for $n\in\N$.
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 2
Let $f$ be an integrable function on $[a,b]$.  Suppose that $A\le f(x) \le B$ for all $x\in [a,b]$.
Show, from the definition of the integral, that $A\cdot (b-a)\le\int_a^b f\le B\cdot (b-a)$.
(Hint: Use the trivial partition $P=\{x_0,x_1\}$ where $x_0=a$, $x_1=b$.)
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 3
Let $A$ and $B$ be subsets of $\R$.  Suppose that $x$ is an accumulation point of the set
$A\cup B$.  Show that $x$ is an accumulation point of $A$ or $x$ is an accumulation
point of $B$ (or both).   (Hint: Try a proof by contradiction.)
If you prefer to work with subsets of a metric space $(M,d)$ instead
of $\R$, you can do that instead.
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 4
Suppose that $f(x)$ and $g(x)$ are uniformly continuous
on the interval $I$ (which is not necessarily closed or bounded).
Show directly from the definition of uniform continuity that $f(x)+g(x)$ is
uniformly continuous on $I$.
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 5
Let $X$ and $Y$ be non-empty, bounded subsets of $\R$.  Suppose that for every $x\in X$ and 
for every $y\in Y$, $x<y$.  Prove that $lub(X)\le glb(Y)$.  Is it always true that
$lub(X)<glb(Y)\;$?
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}





\begin{problem}  % problem 7
This question concerns infinite sequences.  You can write the proof for
sequences in $\R$ or for sequences in a metric space. The proof would be essentially 
the same in either case; only the notation changes slightly.

Let $\{x_n\}_{n=1}^\infty$ be an infinite sequence.  We define a
{\it rearrangement\/} of the sequence as follows: Let $s\colon \N\to\N$ be a
bijective function.  Then $\{x_{s(i)}\}_{i=1}^\infty$ is a rearrangement of the
sequence $\{x_n\}_{n=1}^\infty$.  The rearranged sequence has exactly the same terms 
as the original sequence, just in a different order.

Suppose that $\{x_n\}_{n=1}^\infty$ is a convergent sequence and that
$\ds\lim_{n\to\infty}x_n=L$, and let $\{x_{s(i)}\}_{i=1}^\infty$ be a rearrangement of
the sequence.  Show that the rearranged sequence $\{x_{s(i)}\}_{i=1}^\infty$ is
convergent and converges to the same limit, $\ds\lim_{i\to\infty}x_{s(i)}=L$.
(Hint: This is easier than it looks.  Note that the set $\{x_1,x_2,\dots,x_N\}$ is
finite.  Also, $s$ has an inverse function $s^{-1}$.)
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 8
Let $(M,d)$ be a metric space.  Recall that the open ball of radius $\eps$ about a point $x\in M$ is
defined as $B_\eps(x)=\{z\in M\,|\,d(z,x)<\eps\}$.  Suppose that we define the
\textbf{closed ball} of radius $\eps$ about $x$ as $\overline{B}_\eps(x)=\{z\in M\,|\,d(z,x)\le\eps\}$.
We could also consider the closure of the open ball, $\overline{B_\eps(x)}$, where the closure of
a set consists of the set plus its accumulation points.
\begin{itemize}
\item[\bf(a)] Show that $\overline{B}_\eps(x)=\{z\in M\,|\,d(z,x)\le\eps\}$ is a closed subset of $M$.
(Hint:  Show $M\smallsetminus \overline{B}_\eps(x)$ is open, noting that $z\notin \overline{B}_\eps(x)$
means $d(z,x)>\eps$.)
\item[\bf(b)] In $\R$, $B_\eps(x)$ is the open interval $(\eps-\frac\eps2,\eps+\frac\eps2)$.  What is
$\overline{B}_\eps(x)$ in $\R$?  What is $\overline{B_\eps(x)}$ in $\R$.  You do \textbf{not} have
to prove your answers, which should be obvious.
\item[\bf(c)] Give an example to show that $\overline{B}_\eps(x)$ is \textbf{not}
always equal to $\overline{B_\eps(x)}\;$?  (Hint: Consider a metric space with the discrete metric,
and consider an open ball of radius 1.)
\end{itemize}
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\begin{problem}  % problem 9
This problem proves that two integrable functions that differ at only one point have
the same integral.  (Note: A simple induction would then show that functions that agree except at
a finite number of points have the same integral; \textbf{you do not need to prove this}.)
\begin{itemize}
\item[\bf(a)] Let $f$ be the function defined on $[a,b]$ by 
   $f(x)=\begin{cases} 1&\mbox{ if $x=a$}\\ 0&\mbox{ if $x\ne a$}\end{cases}$.
   Show that $f$ is integrable and $\int_a^b f=0$. (Hint: For $\eps>0$, find a partition $P$ of $[a,b]$
   such that $L(P,f)\le 0 \le U(P,f)$ and $U(P,f)-L(P,f)<\eps$. It is possible to do this with a
   specific partition that has just two subintervals.)
   A similar argument shows that a function whose value is 1 at $b$ and 0 at other points of $[a,b]$
   is integrable and has integral 0; \textbf{you do not need to prove this, but you can assume it
   for part (b)}.
\item[\bf(b)] Let $c\in(a,b)$ and consider the function  
   $g(x)=\begin{cases} 1&\mbox{ if $x=c$}\\ 0&\mbox{ if $x\ne a$}\end{cases}$. Show that $g$
   is integrable and $\int_a^b g = 0$.  (Hint:  Use part (a) and the additivity of the integral.)
\item[\bf(c)] Let $f$ be an integrable function on $[a,b]$.  Suppose that $g$ is a function that
is defined on $[a,b]$, that $c\in[a,b]$, and that $g(x) = f(x)$ except that $g(c)\ne f(c)$.
Show that $g$ is integrable and $\int_a^b g=\int_a^b f$.  (Hint: Use parts (a) and (b) and
the linearity of the integral.)
\end{itemize}
\end{problem}

\begin{answer}
%You can put your answer here.
\end{answer}




\end{document}





