%MODULE 1: Epsilon-Delta limits

%USER DEFINED COMMANDS
\newcommand{\ds}{\displaystyle}
\newcommand{\nsp}{\hspace*{9pt}}
\newcommand{\lns}{\rule{0pt}{11pt}    }
\newcommand{\xp}{\mbox{\Large \sl  e}  }



%INPUT THE INSTRUCTIONS PAGE 
\input{lib/instructions}

%BUILD  TITLE PAGE 
\TitleSlide{Overview}
{\color{white}
In this lesson we introduce the \emph{fundamental} concept of Calculus:
\emph{the limit}. For now we will take a more intuitive approach,
looking at \emph{graphical} and \emph{numerical} approaches to the limit.
We will introduce a rigorous, \emph{algebraic} approach to the limit in
another module.}

\StartSlide{Assignment: the intuitive notion of a limit}{Two sample problems}

Let
\BCitem
\item $\displaystyle{\ec f\left(x\right) = \frac{x^2-x}{x-1}}$, and
\item $\displaystyle{\ec w\left(x\right)=\sin \left(\frac{1}{x}\right)}$.
\ECitem

Both of these functions are undefined \emph{at} $x=0$.
We want to explore how they behave as $x$ \emph{approaches} $0$.

\NewSlide{SAGE worksheets}

In this lab you will not need a special SAGE worksheet,
but you will need to have a new SAGE worksheet handy,
so go ahead and login to SAGE and open a new worksheet.

\NewSlide{The graphical approach}

Let's start with $f(x)$. Use SAGE to plot a graph of $f$ around $x=0$.
If you do not know how to do this, review the first module, ``An Introduction to SAGE''.
You should see the following plot:

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/worksheet_startup_small.png}
\par\end{center}

\StartOverlaySlide{Setup Limits: $\epsilon$-$\delta$}

First we will set up the applet. When you first start it, you should see something like this:

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/worksheet_startup_small.png}
\par\end{center}

\OverlaySlide{Setup Limits: $\epsilon$-$\delta$}

We will set up the applet to work with $\ec f(x)$ first. Make the following assignments:
\BCitem
\item $\ec f \rightarrow (x^2 - x)/(x-1)$
\item $\ec a \rightarrow 1$
\item $\ec L\rightarrow 1$
\item $\ec \delta\rightarrow 0.1$
\item $\ec \epsilon\rightarrow 0.1$
\item $\ec x_{\mathrm min}\rightarrow -1$
\item $\ec x_{\mathrm max}\rightarrow 4$
\item $\ec y_{\mathrm min}\rightarrow -1$
\item $\ec y_{\mathrm max}\rightarrow 4$
\ECitem

\StartOverlaySlide{The precise definition of a limit}

We want to express the idea that as $\ec x$ draws near to $\ec a$,
the $y$-values $\ec f(x)$ draw so near to $\ec L$
that you cannot find any \emph{meaningful} distance between them.
Stated precisely,

\textbf{
\BCitem
\item For any measurable distance $\ec\epsilon$,
\item we can find a neighborhood around $\ec x=a$
\item such that for any $x$-value in that neighborhood,
\item the distance between the $y$-value of $\ec f$ and $\ec L$ is less than $\ec \epsilon$.
\ECitem
}

Written another way,

\OverlaySlide{The precise definition of a limit}

{\dims We want to express the idea that as $\ec x$ draws near to $\ec a$,
the $y$-values $\ec f(x)$ draw so near to $\ec L$
that you cannot find any \emph{meaningful} distance between them.}
Stated precisely,

\textbf{
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x\in(a-\delta,a+\delta)$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem
}

Switch back and forth between these two slides to see how the words translate into symbols.

We can rewrite this \emph{again} as:

\OverlaySlide{The precise definition of a limit}

{\dims We want to express the idea that as $\ec x$ draws near to $\ec a$,
the $y$-values $\ec f(x)$ draw so near to $\ec L$
that you cannot find any \emph{meaningful} distance between them.}
Stated precisely,

\textbf{
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem
}

\StartOverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/good_outermost.png}
\par\end{center}

Currently, SAGE should show the output above.
Right now we set the precision to $\ec\epsilon=0.1$.
The goal is that $\ec |f(x)-L|<\epsilon$, or that
\emph{the distance between the $y$-values of $\ec f$ and $L$ is smaller than $\ec\epsilon$.}

Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?

\OverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/good_outermost.png}
\par\end{center}

{\dims Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?}

The distance between the $y$-values of points in the pink regions
and $\ec L$ is larger than $\ec\epsilon$.
This would violate the desired outcome of a limit: that $y$-values grow very close to $\ec L$.

What about smaller values of $\ec\epsilon$, say $\ec\epsilon=0.01$?

\OverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/zoom_bad.png}
\par\end{center}

{\dims Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?}

When we make $\ec\epsilon$ smaller, we have a problem: the blue curve of $\ec f$
now passes in the pink regions of the plane. For these points, $\ec|f(x)-L|\mathbf{>}\epsilon$.

\OverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/zoom_bad.png}
\par\end{center}

{\dims Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?}

When we make $\ec\epsilon$ smaller, we have a problem: the blue curve of $\ec f$
now passes in the pink regions of the plane. For these points, $\ec|f(x)-L|{\mathbf >}\epsilon$.

However, the phrasing of the definition is that ``there exists $\ec\delta$''.
Maybe we can find another value of $\ec\delta$  so that the curve no longer enters the pink region.
To get an idea, let's zoom in on the graph. Change the maximum and minimum $x$- and $y$-values
so that we zoom into the region of the plane $\ec x\in[0.9,1.1]$ and $\ec y\in[0.9,1.1]$.

\OverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/zoom_bad2.png}
\par\end{center}

{\dims Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?}

It looks like we could make it work by choosing a smaller value of $\ec\delta$.
Let's try $\ec\delta=0.01$.

\OverlaySlide{Example with $f(x)$}

We illustrate this precise definition of a limit using $f(x)$.

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/zoom_good.png}
\par\end{center}

{\dims Geometrically, you see that the graph of $f(x)$ does not stray
into the pink regions of the plane.
How does this reflect the definition?}

In this case it worked out. Notice that we have $\ec\delta=\ec\epsilon$.

\StartOverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

So we want\[
\ec |f(x)-L|<\epsilon.
\]

\OverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

That is,\[
\ec \left|\frac{x^2-x}{x-1}-1\right|<\epsilon.
\]

\OverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

We can factor the numerator, so that we want\[
\ec \left|\frac{x(x-1)}{x-1}-1\right|<\epsilon.
\]

\OverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

When $\ec x=1$ the funciton is undefined; otherwise the denominator is non-zero and\[
\ec \left|x-1\right|<\epsilon.
\]

\OverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

So what value of $\ec\delta$ should we choose? We want
\[
\ec \left|x-1\right|<\delta\quad\Longrightarrow\quad\left|x-1\right|<\epsilon
\]
so choose $\ec\delta=\epsilon$.

\OverlaySlide{Proving it}

We can show this rigorously by falling back on the definition.
We remind you that the definition is
\BCitem
\item For all $\ec \epsilon>0$,
\item there exists $\ec \delta>0$
\item such that for all $\ec x$ satisfying $\ec|x-a|<\delta$,
\item $\ec |f(x)-L|<\epsilon$. 
\ECitem

So what value of $\ec\delta$ should we choose? We want
\[
\ec \left|x-1\right|<\delta\quad\Longrightarrow\quad\left|x-1\right|<\epsilon
\]
so choose $\ec\delta=\epsilon$.

Notice that in the example given, when $\ec\epsilon=.1$ we chose $\ec\delta=.1$,
and when $\ec\epsilon=.01$ we chose $\ec\delta=.01$.

\StartOverlaySlide{Smaller $\delta$ works, too!}

Of course you could have chosen a $\ec\delta$ that was even \emph{smaller}
than the one required. Try changing $\ec\delta$ to .005 in the SAGE worksheet,
and see if the curve passes through the pink region.

\OverlaySlide{Smaller $\delta$ works, too!}

Of course you could have chosen a $\ec\delta$ that was even \emph{smaller}
than the one required. Try changing $\ec\delta$ to .005 in the SAGE worksheet,
and see if the curve passes through the pink region.

You should see something like this:

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/zoom_good_smaller_delta.png}
\par\end{center}

So smaller values of delta work just as well.

\StartOverlaySlide{General functions}

It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]
That translates to\[
\ec -\epsilon<x^2-1<\epsilon.
\]
Let's try to rewrite this inequality so that it has $\ec x-1$ instead of $\ec x^2-1$.

\OverlaySlide{General functions}

{\dims It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]}
Isolating $\ec x^2$ we have \[
\ec 1-\epsilon<x^2<1+\epsilon.
\]

\OverlaySlide{General functions}

{\dims It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]}
We are concerned with a neighborhood of $\ec x=a=1$, so $\ec x$ is positive. Thus\[
\ec \sqrt{1-\epsilon}<x<\sqrt{1+\epsilon}.
\]

\OverlaySlide{General functions}

{\dims It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]}
To find a value for $\ec\delta$ we need the form $\ec|x-1|<\delta$.
We can subtract 1 from both sides and obtain\[
\ec \sqrt{1-\epsilon}-1<x-1<\sqrt{1+\epsilon}-1.
\]

\OverlaySlide{General functions}

{\dims It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]
To find a value for $\ec\delta$ we need the form $\ec|x-1|<\delta$.
We can subtract 1 from both sides and obtain\[
\ec \sqrt{1-\epsilon}-1<x-1<\sqrt{1+\epsilon}-1.
\]}

Which gives a \emph{smaller} neighborhood around $\ec x=a=1$?
Some algebra shows that $\ec\sqrt{1+\epsilon}-1$ (we skip that step here).

\OverlaySlide{General functions}

{\dims It is not easy to determine a correct value of $\ec \delta$ for every function.
Even ``simple'' functions require care.

Suppose $\ec f(x)=x^2$. How can we show that $\ec\lim_{x\rightarrow 1}f(x)=1$?

Falling back on the definition, let $\epsilon$ be an arbitrary distance. We want\[
\ec |x^2-1|<\epsilon.
\]
To find a value for $\ec\delta$ we need the form $\ec|x-1|<\delta$.
We can subtract 1 from both sides and obtain\[
\ec \sqrt{1-\epsilon}-1<x-1<\sqrt{1+\epsilon}-1.
\]}

Try this in the SAGE applet with a few values of $\ec\epsilon$, and verify that
$\ec\delta=\sqrt{1+\epsilon}-1$ keeps the blue function out of the pink regions.

\NewSlide{What about $w(x)$?}
We turn now to $\ec w(x)=\sin(1/x)$.
To help see why this has no limit at $\ec x=0$,
make the following changes to the SAGE applet:
\BCitem
\item $\ec f \rightarrow sin(1/x)$
\item $\ec a \rightarrow 0$
\item $\ec L \rightarrow 0$
\item $\ec \delta\rightarrow 0.1$
\item $\ec \epsilon \rightarrow 0.1$
\item $\ec x_{\mathrm min} \rightarrow -1$
\item $\ec x_{\mathrm max} \rightarrow 1$
\item $\ec y_{\mathrm min} \rightarrow -1$
\item $\ec y_{\mathrm max} \rightarrow 1$
\ECitem

\StartOverlaySlide{What about $w(x)$?}

Your initial graph should look like this:

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad1.png}
\par\end{center}

Notice the intense ``wiggling'' on as $\ec x\rightarrow 0$. Clearly this value of $\ec\delta$
is too large for $\ec\epsilon=.1$; let's try a smaller value of $\ec\delta$, say $\ec\delta=.01$.
Be sure to zoom in so you can see what happens.

\OverlaySlide{What about $w(x)$?}

Now you should see this (or something similar):

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad2.png}
\par\end{center}

The wiggling has not ceased to take us into the pink zone, so $\ec\delta$ is still too large
for this value of $\ec\epsilon$. Let's try one more smaller value of $\ec\delta$.

\OverlaySlide{What about $w(x)$?}

Now you should see this (or something similar):

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

Wow! This wiggling never ceases! In fact, some mathematicians call this function the
\emph{Infinite Wiggle}.

\StartOverlaySlide{What is going on?}

We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We need to convince ourselves of this.

\OverlaySlide{What is going on?}

{\dims We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We need to convince ourselves of this.}

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

Notice that the curve touches $\ec y=1$ many, many times.
What $x$-values give $\ec\sin(x)=1$?

\OverlaySlide{What is going on?}

{\dims We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We would like to explain this as much as possible.}

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

Notice that the curve touches $\ec y=1$ many, many times.
What $x$-values give $\ec\sin(x)=1$?

You should know that
$\ec x=\frac{\pi}{2}, -\frac{\pi}{2}, \frac{5\pi}{2}, -\frac{5\pi}{2}, \ldots$
makes $\sin(x)=1$.

\OverlaySlide{What is going on?}

{\dims We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We need to convince ourselves of this.}

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

Notice that the curve touches $\ec y=1$ many, many times.
What $x$-values give $\ec\sin(x)=1$?

You should know that
$\ec x=\frac{\pi}{2}, -\frac{\pi}{2}, \frac{5\pi}{2}, -\frac{5\pi}{2}, \ldots$
make $\sin(x)=1$.

We are dealing with the function $\sin(1/x)$, so look at the reciprocal of these
numbers: $\ec x=\frac{2}{\pi}, -\frac{2}{\pi}, \frac{2}{5\pi}, -\frac{2}{5\pi}, \ldots$
make $\sin(1/x)=1$.

\OverlaySlide{What is going on?}

{\dims We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We need to convince ourselves of this.}

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

Notice that the curve touches $\ec y=1$ many, many times.
What $x$-values give $\ec\sin(x)=1$?

You should know that
$\ec x=\frac{\pi}{2}, -\frac{\pi}{2}, \frac{3\pi}{2}, -\frac{3\pi}{2}, \ldots$
make $\sin(x)=1$.

We are dealing with the function $\sin(1/x)$, so look at the reciprocal of these
numbers: $\ec x=\frac{2}{\pi}, -\frac{2}{\pi}, \frac{2}{5\pi}, -\frac{2}{5\pi}, \ldots$
make $\sin(1/x)=1$.

These values approach zero: $\ec \frac{2}{\pi}, \frac{2}{5\pi}, \frac{2}{9\pi}, \ldots$.
The pattern goes on forever, \emph{all} their $y$-values are 1,
and the limit of these numbers is 0.

\OverlaySlide{What is going on?}

{\dims We saw that no matter how small we made $\ec\delta$, the graph of $\ec w(x)$
only wiggled all the more intensely. We need to convince ourselves of this.}

\begin{center}
\includegraphics[scale=0.75]{./module-epsilon_delta/figures/wiggle_bad3.png}
\par\end{center}

The upshot?
\BCitem
\item Regardless of the value of $\ec \delta$
\item we can find $\ec x$
\item such that $\ec|x-0|<\delta$
\item but $\ec |f(x)-0|=1>0.1=\epsilon!$
\ECitem

\NewSlide{Thus...}

We conclude that \[\ec
\lim_{\rightarrow 0}\sin\left(\frac{1}{x}\right)
\]
\textbf{does not exist}.

\NewSlide{Conclusion}

\BCitem
\item You should now be able to use SAGE to estimate and illustrate
the precise definition of a limit.
\item You have had an introduction to finding $\ec\delta$ algebraically,
but it takes a lot of practice to grow used to it.
\item What is most important is that you understand why this gives us the
precise definition of the limit.
\ECitem

To recap,
in a neighborhood around $\ec a$,
the $y$-value $\ec f(x)$ draws so near to $\ec L$
that you cannot find any meaningful distance between them.

$\ec\delta$ (the maximum distance between $\ec a$ and any point in its
$\ec\delta$-neighborhood) symbolizes  the neighborhood around $\ec a$
while $\ec\epsilon$ and its arbitrary value symbolize the ability to darw so
near to $\ec L$ that one cannot find any meaningful distance between them.
