\documentclass[10pt,addpoints]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{enumerate}
\usepackage{circuitikz}
\pagestyle{head}

\newcommand\bigangle[2][]{% 
    \draw[->,domain=0:#2,variable=\t,samples=200,>=latex,#1]
      plot ({0.4*(0.3*\t+#2)*cos(\t)/(#2)},
           {0.4*(0.3*\t+#2)*sin(\t)/(#2)})
        ;}
        
%\headrule
%\header{MATH 11}{Exam 1}{Fall 2016}
\begin{document}
continuity: Let $(M,d_1)$ and $(N,d_2)$ be metric spaces. We say that a function $f \colon M \rightarrow N$ is continuous provided that
\[ \forall \epsilon > 0 \forall p \in M \exists \delta > 0 \text{ such that } q \in M \text{ and } d_1(p,q) \implies d_2(f(p),f(q))<\epsilon \]
\hrule \vspace{1mm}
\textbf{Example}: Consider the metric space $\mathbb{R}$ endowed with the usual metric $d(x,y)=|x-y|$. Show that $f \colon \mathbb{R} \rightarrow \mathbb{R}$ given by $f(x)=8x^2-3x+2$ is continuous. 

\textbf{Scratch work}: Given a fixed $p$, we want to find a bound on $\delta$ such that a $q$ obeying $d(p,q)=|p-q|<\delta$ implies 
\[(*) \hspace{35pt} d(f(p),f(q))=|f(p)-f(q)|=|(8p^2-3p+2)-(8q^2-3q+2)|<\epsilon. \] To find the condition on $\delta$, we do algebra. Our algebra has a goal: we only have ``control" over $|p-q|$ ($\delta$ cannot depend on $q$ -- in actuality, $\delta$ determines which $q$'s are allowed!!! However, $\delta$ \textit{often does} depend on $p$).

Compute:
\[ \begin{array}{ll}
|(8p^2-3p+2)-(8q^2-3q+2)| &= |8(p^2-q^2)-3(p-q)| \\
&= |8\underbrace{(p-q)(p+q)}_{\text{factor}}-3(p-q)| \\
&= \underbrace{|p-q|}_{\text{we control}} |\underbrace{8(p+q)-3}_{\text{want } q-p \text{ (why not } p-q?)}| \\
&= |p-q| |8(q+p\underbrace{-p+p}_{\text{add zero}})-3|  \\
&= |p-q| \underbrace{|8(q-p)+16p-3|}_{\text{prepare for triangle inequality}} \\
&\underbrace{\leq}_{\text{triangle inequality}} |p-q| \Big[ 8|q-p| + |16p-3| \Big] \\
&\underbrace{<}_{\text{we control } |p-q| < \delta} \delta \Big[ 8\delta + |16p-3| \Big] \\
&\underbrace{<}_{\text{we can choose } \delta < 1} \underbrace{\delta}_{\text{leave this one}} \Big[ 8 + |16p-3| \Big] \\
\end{array} \]
Our ultimate goal is to find a condition on $\delta$ that causes $(*)$ to occur. If we pick the number $\delta$ so that
$$|(8p^2-3p+2)-(8q^2-3q+2)| < \delta \Big[ 8+|16p-3| \Big| < \epsilon,$$
then it will work. In other words, ``solve" for $\delta$ in the inequality
$$\delta \Big[ 8+|16p-3| \Big] < \epsilon.$$
Thus, take
$$\delta < \dfrac{\epsilon}{8+|16p-3|}.$$

\textbf{Proof}: Let $\epsilon > 0$ and let $p \in \mathbb{R}$. Choose $0 < \delta < \dfrac{\epsilon}{8+|16p-3|}.$ Then if $q \in \mathbb{R}$ with $d(q,p)=|q-p|<\delta$, we compute
$$\begin{array}{ll}
|(8p^2-3p+2)-(8q^2-3q+2)| &\leq \delta \Big[ 8 + |16p-3| \Big] < \left( \dfrac{\epsilon}{8+|16p-3|} \right) (8+|16p-3|)=\epsilon,
\end{array}$$
completing the proof.
\end{document}