%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{beamer}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 % this default might be overridden by plain title style
 \newcommand\makebeamertitle{\frame{\maketitle}}%
 \AtBeginDocument{
   \let\origtableofcontents=\tableofcontents
   \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
   \def\gobbletableofcontents#1{\origtableofcontents}
 }
 \long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
 \def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
 \def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
 \def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
 \def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
 \long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
   \frame<#1>[#2][#3]{\frametitle{#4}#5}}
 \def\lyxframeend{} % In case there is a superfluous frame end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\usepackage{appearance}\newcommand{\reals}{\mathbb R}

\makeatother

\usepackage{babel}
\begin{document}
%MODULE 1: Squeeze Theorem


%USER DEFINED COMMANDS
\global\long\def\ds{{\displaystyle }}
 \global\long\def\nsp{\hspace{1em}*{9pt}}
 \global\long\def\lns{\rule{0pt}{11pt} }
 \global\long\def\xp{\mbox{\Large\sl e} }


%INPUT THE INSTRUCTIONS PAGE 


%BUILD  TITLE PAGE 



\title{Derivatives by experimentation}


\subtitle{Geometrically, the instantaneous rate of change is the slope of a
line tangent to $\ec f$ at $\ec x=a$. In this lab, you will explore
how we can use the tangent lines to deduce a formula for the derivative
from its values at various points.}

\makebeamertitle

\lyxframeend{}\lyxframe{{A Sample problem}}

\begin{question}If $\ec f\left(x\right)=\sin x$, what is $\ec f'(x)$
\emph{as a function?}

\noindent That is, what formula gives us $\ec f(x)$ for any value
of $\ec x$?\end{question}


\lyxframeend{}\lyxframe{\noindent {SAGE worksheets}}

\noindent In this lab you will need the following SAGE worksheets:
\begin{itemize}
\item Function Factory 
\item Tangent Line Guesser 
\end{itemize}
\noindent Open each one in separate windows or tabs of your browser.


\lyxframeend{}\lyxframe{{Setup Function Factory}}

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

\noindent 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.4]{figures/function_factory_small} 
\end{figure}



\lyxframeend{}\lyxframe{Setup Function Factory}

\noindent Change the values of the input boxes to match the following:
\begin{itemize}
\item delete everything in $\ec\mathit{points}$, leaving it empty; 
\item $\ec x_{\min}\rightarrow-\mathit{pi}/2$; 
\item $\ec x_{\max}\rightarrow5*pi/2$. 
\end{itemize}

\lyxframeend{}\lyxframe{{Setup Tangent Line Guesser}}

Now turn to the Tangent Line Guesser SAGElet. You should see something
like this:

\noindent 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/tanline_guesser_small} 
\end{figure}


\noindent Things are already set up for this exercise.


\lyxframeend{}\lyxframe{{Estimating the derivative}}

We can estimate the values of the derivative of $\ec f$ using the
Tangent Line Guesser. For any $x$ value $\ec a$, you can change
the value of $\ec m$, the slope of the red line.


\pause{}

Experiment with different values of $\ec m$ until the red line seems
to be tangent to the curve. For $\ec a=0$, try $\ec m=2$, $\ec m=1$,
$\ec m=0.5$, $\ec m=0$, and $\ec m=-1$. Which value of $\ec m$
gives the correct line?


\pause{}

\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_a0_m1} 
\end{figure}


The value $\ec m=1$ appears to create a tangent line. Now turn to
the Function Factory.


\lyxframeend{}\lyxframe{{Points in derivative}}

In the Function Factory SAGElet, we enter points that belong to the
derivative, and see if they match the function specified by $\ec f$.
We decided in the Tangent Line Guesser SAGElet that $\ec f'\left(0\right)\approx1$.
Type {\ec(0,1)} in the input box next to $\ec\mathit{points}$.
Press the tab or enter key to see an update. You should see something
like this:

\noindent 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_derivative_ff_first_point} 
\end{figure}


\noindent Right away you can see that $\ec x^{2}$ is \emph{not} the
correct derivative for $\ec\sin x$, because the point {\ec(0,1)}
does not lie on the curve. However, we won't change $\ec f$ yet.


\lyxframeend{}\lyxframe{{More points!}}
\begin{overlayarea}
{\textwidth}{6in}

Return to the Tangent Line Guesser SAGElet. This time, try different
values for $\ec a$. At each value of $\ec a$, try to find a value
of $\ec m$ that gives the correct tangent line. For example:


\pause{}
\begin{onlyenv}%{}
<2>

When we try $\ec a=\pi/2$, we find $\ec m\approx0$.


\begin{figure}[h!]
\centering{}\includegraphics[scale=0.2]{figures/sin_api2_m0} 
\end{figure}


\end{onlyenv}%{}

\pause{}
\begin{onlyenv}%{}
<3>

When we try $\ec a=3\pi/4$, we find $\ec m\approx-0.75$.


\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_a3pi4_m0_75} 
\end{figure}


\end{onlyenv}%{}

\pause{}
\begin{onlyenv}%{}
<4>

When we try $\ec a=-\pi/6$, we find $\ec m\approx0.85$.


\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_a-pi6_m0_85} 
\end{figure}


\end{onlyenv}%{}
\end{overlayarea}

\lyxframeend{}\lyxframe{{Back to Function Factory}}

Add the points
\[
\ec\left(-\frac{\pi}{6},0.85\right),\left(\pi/2,0\right),\left(\frac{3\pi}{4},-0.75\right)
\]
 into Function Factory and you get the following image.

\noindent 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_derivative_ff_four_points} 
\end{figure}


\noindent At this point we can see that $\ec x^{2}$ is \emph{definitely}
wrong. But we still don't know what the correct function is!


\lyxframeend{}\lyxframe{{Take some more points}}

The only thing we can do now is try some more values of $\ec a$.
Choose values that lie between and outside the values we have used
so far. You might want to try $\ec a=\pi/4$, for example, or $\ec a=5\pi/4$,
or $\ec a=3\pi/2$, or more! For each value of $\ec a$, find the
corresponding value of $\ec m$. When you think you have enough points,
add them to Function Factory.


\lyxframeend{}\lyxframe{\noindent {Things fall into place}}

Here is an image reflecting those choices, as well as some others:

\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_derivative_ff_many_points} 
\end{figure}


You should be able to guess the correct value of $\ec f$ at this
point...


\pause{}

\[
{\ec f=\cos x.}
\]
 Change the value of $\ec f$ in the Function Factory to $\ec\cos x$.


\lyxframeend{}\lyxframe{{Things fall into place}}

It looks as if $\ec\cos x$ matches the points perfectly.

\noindent 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.2]{figures/sin_derivative_ff_final_answer} 
\end{figure}



\lyxframeend{}\lyxframe{{Try more!}}

Repeat this exercise with several different functions. (Your professor
may assign a particular function to you.) Enter each function into
the Tangent Line Guesser SAGElet, then determine approximate values
of the derivative. Enter the appropriate points into the Function
Factory SAGElet, repeating until you have found enough points to guess
a formula for the derivative.

\noindent \begin{center}
\begin{tabular}{ccc}
$\ec e^{x}$  &  & $\ec\ln\left(x\right)$\tabularnewline
$\ec x^{2}$  &  & $\ec\sqrt{x}$\tabularnewline
$\ec\cos\left(x\right)$  &  & $\ec\sin\left(2x\right)$\tabularnewline
$\ec\tan\left(x\right)$  &  & $\ec\sin\left(x+\pi/2\right)$\tabularnewline
\end{tabular}
\par\end{center}


\lyxframeend{}\lyxframe{{Conclusion}}
\begin{itemize}
\item The derivative of a function $y$ can correspond to another function;
let's call it $y'$.
\item We can often guess at this $y'$ by considering our geometric intuition
of the derivative.
\item In class you will study and learn algebraic methods that should explain
why you obtain the result you obtained here. Feel free to experiment
with other functions.
\end{itemize}

\lyxframeend{}
\end{document}
