%% 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{amsmath}
\usepackage{amssymb}
\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: Continuity


%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 of polynomials }


\subtitle{In this module we will determine more efficient ways of computing
the derivatives of \emph{polynomials}. We use the precise definition
of the derivative to explain these methods. }

\makebeamertitle
%1



\lyxframeend{}\lyxframe{{Defining the problem}}

\noindent Recall the definition of the derivative as a function.
\begin{definition}%{}
[(The derivative as a function)]If a function $\ec f$ is differentiable
at every point in its domain, then \emph{\hilite the derivative of
$\ec f$} is
\[
{\ec f'(x)=\lim_{x\rightarrow a}\frac{f(x+h)-f(x)}{h}}.
\]
 It is tedious to compute the derivative using the precise definition.
Polynomials have a certain structure that is different from trigonometric,
exponential, or logarithmic functions. We'd like to exploit that structure
and find a shorter way of computing the derivative for polynomials.
%2

\end{definition}%{}

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

\noindent You will need a blank SAGE worksheet for this module.


\lyxframeend{}\lyxframe{{The derivative of a polynomial}}

\noindent Let $\ec f(x)$ be a polynomial. We want to compute the
derivative of $\ec f(x)$.


\pause{}

The simplest form of a polynomial is a monomial $\ec x^{n}$, where
$\ec n$ is a positive integer. Before looking at this {}``generic''
monomial, we'll look at a few examples: $\ec x$, $\ec x^{2}$, and
$\ec x^{3}$.


\lyxframeend{}\lyxframe{{The derivative of $x$}}

\noindent Using the precise definition, the derivative of $\ec f(x)={\hilite x}$
is
\[
\ec\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h}=\lim_{h\rightarrow0}\frac{(\cancel{x}+h)-\cancel{x}}{h}=\lim_{h\rightarrow0}1.
\]
 Hence we can say
\begin{theorem}%{}
\noindent  
\begin{itemize}
\item If $\ec f(x)=x$, then $\ec f'(x)=1$. 
\end{itemize}
\end{theorem}%{}

\lyxframeend{}\lyxframe{{The derivative of $x^{2}$}}
\begin{overlayarea}
{\textwidth}{6in}
\begin{onlyenv}%{}
<1>

\noindent Using the precise definition, the derivative of $\ec f(x)={\hilite x^{2}}$
is
\begin{align*}
\ec\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \ec=\lim_{h\rightarrow0}\frac{(x+h)^{2}-x^{2}}{h}
\end{align*}


\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{2}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{(x+h)^{2}-x^{2}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{(\cancel{x^{2}}+2xh+h^{2})-\cancel{x^{2}}}{h}
\end{align*}


\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{2}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{(\cancel{x^{2}}+2xh+h^{2})-\cancel{x^{2}}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{\cancel{h}(2x+h)}{\cancel{h}}
\end{align*}
 \begin{explanation}Factored a common $h$ in the numerator.\end{explanation}

\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{2}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{\cancel{h}(2x+h)}{\cancel{h}}\\
 & \ec=\lim_{h\rightarrow0}2x+\cancelto{0}{h}.
\end{align*}
 \begin{explanation}Evaluated the limit be substituting $h=0$.\\
 We can do this because $2x+h$ is a continuous function.\end{explanation}

\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{2}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}2x+\cancelto{0}{h}\\
 & \ec=2x.
\end{align*}
 Hence we can say
\begin{theorem}%{}
\noindent  
\begin{itemize}
\item If $\ec f(x)=x$, then $\ec f'(x)=1$. 
\item If $\ec f(x)=x^{2}$, then $\ec f'(x)=2x$. 
\end{itemize}
\end{theorem}%{}
\end{onlyenv}%{}
\end{overlayarea}

\lyxframeend{}\lyxframe{{The derivative of $x^{3}$}}
\begin{overlayarea}
{\textwidth}{6in}
\begin{onlyenv}%{}
<1>

\noindent Using the precise definition, the derivative of $\ec f(x)={\hilite x^{3}}$
is
\begin{align*}
\ec\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \ec=\lim_{h\rightarrow0}\frac{(x+h)^{3}-x^{3}}{h}
\end{align*}


\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{3}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{(x+h)^{3}-x^{3}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{(\cancel{x^{3}}+3x^{2}h+3xh^{2}+h^{3})-\cancel{x^{3}}}{h}
\end{align*}


\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{3}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{(\cancel{x^{3}}+3x^{2}h+3xh^{2}+h^{3})-\cancel{x^{3}}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{\cancel{h}(3x^{2}+3xh+h^{2})}{\cancel{h}}
\end{align*}
 \begin{explanation}Factored a common $h$ in the numerator.\end{explanation}

\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{3}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}\frac{\cancel{h}(3x^{2}+3xh+h^{2})}{\cancel{h}}\\
 & \ec=\lim_{h\rightarrow0}3x^{2}+3x\cancelto{0}{h}+\cancelto{0}{h^{2}}
\end{align*}
 \begin{explanation}Evaluated the limit be substituting $h=0$.\\
 We can do this because $3x^{2}+3xh+h$ is a continuous function.\end{explanation}

\end{onlyenv}%{}

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

\noindent Using the precise definition, the derivative of $\ec f(x)=x^{3}$
is
\begin{align*}
\dims\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h} & \dims=\lim_{h\rightarrow0}3x^{2}+3x\cancelto{0}{h}+\cancelto{0}{h^{2}}\\
 & \ec=3x^{2}.
\end{align*}
 Hence we can say
\begin{theorem}%{}

\begin{itemize}
\item If $\ec f(x)=x$, then $\ec f'(x)=1$. 
\item If $\ec f(x)=x^{2}$, then $\ec f'(x)=2x$. 
\item If $\ec f(x)=x^{3}$, then $\ec f'(x)=3x^{2}$. 
\end{itemize}
\end{theorem}%{}
\end{onlyenv}%{}
\end{overlayarea}

\lyxframeend{}\lyxframe{{Geometrically}}
\begin{overlayarea}
{\textwidth}{6in}

You can see this geometrically in SAGE. Plot $\ec f(x)$ and $\ec f'(x)$
on the same graph, and observe how the graph of $\ec f(x)$ relates
to the graph of $\ec f'(x)$.


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

When $\ec f(x)=x$, $\ec f'(x)=1$. This reflects the constant slope
of the tangent line. 
\begin{figure}[h!]
 

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


\end{onlyenv}%{}

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

When $\ec f(x)=x^{2}$, $\ec f'(x)=2x$. 
\begin{figure}[h!]
 

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



\noindent Notice that when the slope of the line tangent to $\ec x^{2}$
is negative---as it is for $\ec x\in(-\infty,0)$---the $y$-values
of $\ec f'(x)$ are negative.

\end{onlyenv}%{}

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

When $\ec f(x)=x^{3}$, $\ec f'(x)=3x^{2}$. 
\begin{figure}[h!]
 

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



Notice that the $y$-values of $\ec f'(x)$ are always positive in
this graph, reflecting the fact that the slope of the line tangent
to $\ec f(x)$ is always positive.

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

\lyxframeend{}\lyxframe{{Did you notice a pattern?}}

\noindent You may have noticed the outlines of a pattern here: 

\begin{center}
{\ec%
\begin{tabular}{c|c}
$f(x)$  & $f'(x)$ \tabularnewline
\hline 
$x$  & $1=1x^{0}$ \tabularnewline
$x^{2}$  & $2x$ \tabularnewline
$x^{3}$  & $3x^{2}$ \tabularnewline
$x^{4}$  & ?? \tabularnewline
\end{tabular}}
\par\end{center}

Can you guess what the next derivative should be?


\pause{}

It looks as if the derivative of $\ec f(x)=x^{4}$ should be $\ec f'(x)=4x^{3}$.
You might guess further that the derivative of $\ec f(x)=x^{n}$ is
$\ec f'(x)=nx^{n-1}$.


\lyxframeend{}\lyxframe{{A pattern in the precise definition}}
\begin{overlayarea}
{\textwidth}{6in}

\noindent To prove this guess, look back at the algebra of the precise
definition of the derivative.


\pause{}


Everything is the same each time except
\begin{align*}
\ec(x+h) & \ec=x^{1}+h\\
\ec(x+h)^{2} & \ec=x^{2}+2xh+h^{2}\\
\ec(x+h)^{3} & \ec=x^{3}+3x^{2}h+3xh^{2}+h^{3}
\end{align*}
Notice a pattern here: $\ec(x+h)^{n}=x^{n}+h(nx^{n-1}+g)$ where $\ec g$
is a polynomial with a power of $\ec h$ \emph{in every term}.


\pause{}


Test this pattern using SAGE: for different values of $\ec n$, expand
$\ec(x+h)^{n}$ and verify the result looks like $\ec x^{n}+h(nx^{n-1}+g)$.
\begin{onlyenv}%{}
<3>

(Hint 1: Use the \texttt{\ttcolor expand} command to expand each
product. For example, the command \texttt{\ttcolor expand((x+h)\^{}4)}
will expand the product $\ec(x+h)^{4}$.)

\end{onlyenv}%{}

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

(Hint 2: You can see as many examples as you want using a \texttt{\ttcolor
for} loop. For example, 


\begin{center}
\vspace{-2ex}
\parbox[c]{4in}{%
\texttt{\ttcolor var('h')}~\\
\texttt{ for n in range(19):}~\\
\texttt{ \phantom{\ \ }expand((x+h)\^{}(n+2)) }%
}
\par\end{center}


\vspace{-2ex}
will compute $\ec(x+h)^{2}$, $\ec(x+h)^{3}$, \ldots{} $\ec(x+h)^{20}$.)

\end{onlyenv}%{}

\pause{}


Try to think about why this pattern is true for every positive integer
$\ec n$. We will not dwell on a proof, but your instructor and/or
textbook can provide one if you ask.

\end{overlayarea}

\lyxframeend{}\lyxframe{{The derivative of a monomial}}
\begin{overlayarea}
{\textwidth}{6in}

We can now prove
\begin{theorem}%{}
[(The derivative of a monomial)]If 
\begin{itemize}
\item $\ec f(x)=x^{n}$ for some $\ec n\in\mathbb{N}$, 
\end{itemize}

then 
\begin{itemize}
\item $\ec f'(x)=nx^{n-1}$. 
\end{itemize}
\end{theorem}%{}

Why?


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

\begin{align*}
\ec f'(x) & \ec=\lim_{h\rightarrow0}\frac{(x+h)^{n}-x^{n}}{h}
\end{align*}
 \begin{explanation} From the precise definition of a derivative.
\end{explanation}

\end{onlyenv}%{}

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

\begin{align*}
\dims f'(x) & \dims=\lim_{h\rightarrow0}\frac{(x+h)^{n}-x^{n}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{(\cancel{x^{n}}+h(nx^{n-1}+g))-\cancel{x^{n}}}{h}
\end{align*}
 \begin{explanation} From the pattern described previously. \end{explanation}

\end{onlyenv}%{}

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

\begin{align*}
\dims f'(x) & \dims=\lim_{h\rightarrow0}\frac{(\cancel{x^{n}}+h(nx^{n-1}+g)-\cancel{x^{n}}}{h}\\
 & \ec=\lim_{h\rightarrow0}\frac{\cancel{h}(nx^{n-1}+g)}{\cancel{h}}
\end{align*}
 \begin{explanation} It is important to note that since $h\rightarrow0$
we can assume that $h\neq0$.\\
 Hence this division is perfectly legal. \end{explanation}

\end{onlyenv}%{}

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

\begin{align*}
\dims f'(x) & \dims=\lim_{h\rightarrow0}\frac{\cancel{h}(nx^{n-1}+g)}{\cancel{h}}\\
 & \ec=\lim_{h\rightarrow0}nx^{n-1}+\cancelto{0}{g}\\
 & \ec=nx^{n-1}.
\end{align*}
 \begin{explanation}$g$ is a polynomial with a power of $h$ \emph{in
every term}, and $h\rightarrow0$. \end{explanation}

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

\lyxframeend{}\lyxframe{{Example}}

\noindent We can now say, \emph{without using the precise definition},
that 
\begin{itemize}
\item if $\ec f(x)=x^{27}$, 
\item then $\ec f'(x)=27x^{26}$. 
\end{itemize}
\bigskip{}
{\hilite That's a \emph{lot} easier than using the precise definition!}


\lyxframeend{}\lyxframe{\noindent {Other forms of $x^{n}$}}

\noindent We have shown that the derivative of $\ec x^{n}$ is $\ec nx^{n-1}$
when \emph{$\ec n$ is a positive integer}. What about cases where
$\ec n$ is a negative integer, or a fraction, or \emph{any} real
number?


\pause{}

\bigskip{}
The same pattern extends to all \emph{nonzero} real numbers $\ec n$.
We can say that 

\noindent \begin{center}
{\ec%
\begin{tabular}{c|c|c}
$f(x)$  & $f'(x)$  & reasoning\tabularnewline
\hline 
$x^{\pi}$  & $\pi x^{\pi-1}$  & shortcut\tabularnewline
$\frac{1}{x}$  & $-\frac{1}{x^{2}}$  & $\frac{1}{x}=x^{-1}$ \tabularnewline
$\sqrt{x}$  & $\frac{1}{2\sqrt{x}}$  & $\sqrt{x}=x^{\frac{1}{2}}$ \tabularnewline
\end{tabular}}
\par\end{center}


\pause{}

We \emph{do not} say that the derivative of $\ec x^{0}$ is $\ec0x^{-1}$,
because $\ec x^{0}=1$, and the derivative of a constant is $\ec0$.
So the property of the derivative of $\ec x^{n}$ does not work for
every real number.


\lyxframeend{}\lyxframe{\noindent {The derivative of a polynomial}}
\begin{overlayarea}
{\textwidth}{6in}

\noindent Using the properties of derivatives, we can extend this
shortcut for \emph{monomials} to a shortcut for \emph{polynomials}.
For example, suppose that $\ec f(x)=4x^{2}+3x+2$.


\pause{}
\begin{itemize}
\item \vspace{-1ex}
The shortcut tells us that the derivative of $\ec x^{2}$ is $\ec2x$,
and the derivative of $\ec x$ is $\ec1$. \end{itemize}
\begin{onlyenv}%{}
<2>

\[
{\dims4{\ec\cancelto{2x}{\left(x^{2}\right)}}+3{\ec\cancelto{1}{\left(x\right)}}+2}.
\]


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item \vspace{-2ex}
One property of the derivative tells us that the derivative of the
last term, $\ec2$, is $\ec0$. \end{itemize}
\begin{onlyenv}%{}
<3>

\[
{\dims4\cancelto{2x}{\left(x^{2}\right)}+3\cancelto{1}{\left(x\right)}+{\ec\cancelto{0}{2}}}.
\]


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item \vspace{-2ex}
Another property of the derivative tells us that the derivative of
$\ec4x^{2}$ is $\ec4$ times the derivative of $\ec x^{2}$, or $\ec4\cdot2x=8x$. \end{itemize}
\begin{onlyenv}%{}
<4>

\[
{\dims{\ec\cancelto{8x}{\left(4\cancelto{2x}{\left(x^{2}\right)}\right)}}+3\cancelto{1}{\left(x\right)}+\cancelto{0}{2}}.
\]


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item \vspace{-2ex}
Likewise, the derivative of $\ec3x$ is $\ec3\cdot1=3$. \end{itemize}
\begin{onlyenv}%{}
<5>

\[
{\dims\cancelto{8x}{\left(4\cancelto{2x}{\left(x^{2}\right)}\right)}+{\ec\cancelto{3}{\left(3\cancelto{1}{\left(x\right)}\right)}}+\cancelto{0}{2}}.
\]


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item \vspace{-2ex}
Another property of the derivative tells us that \emph{the derivative
of a sum} is \emph{the sum of the derivatives}. \end{itemize}
\begin{onlyenv}%{}
<6>

\[
{\ec\cancelto{8x+3+0}{\dims\left(\cancelto{8x}{\left(4\cancelto{2x}{\left(x^{2}\right)}\right)}+\cancelto{3}{\left(3\cancelto{1}{\left(x\right)}\right)}+\cancelto{0}{2}\right)}}.
\]


\end{onlyenv}%{}

\pause{}


\vspace{-2ex}
\[
{\dims\cancelto{8x+3+0}{\left(\cancelto{8x}{\left(4\cancelto{2x}{\left(x^{2}\right)}\right)}+\cancelto{3}{\left(3\cancelto{1}{\left(x\right)}\right)}+\cancelto{0}{2}\right)}}.
\]
 Thus $\ec f'(x)=8x+3$.

\end{overlayarea}

\lyxframeend{}\lyxframe{{Conclusion}}
\begin{itemize}
\item We found a shortcut for {\hilite the derivative of a monomial}:\\
 if $\ec f(x)=x^{n}$ then $\ec f'(x)=nx^{n-1}$. 
\item This shortcut works for all $\ec n\in\mathbb{R}\backslash\{0\}$. 
\item To find this shortcut, we used the precise definition of the derivative
and exploited some patterns that we noticed for $\ec n=1,2,3$. 
\item We can use properties of the derivative to extend this shortcut to
all polynomials. 
\end{itemize}

\lyxframeend{}
\end{document}
