%% 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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: Optimization


%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{Newton's Method}


\subtitle{So far we have explored two different methods for finding the root
of a function: one based on the Intermediate Value Theorem, and one
based on Linear Approximation. Both of those approaches are quite
inefficient. In this module, we study a method developed by Isaac
Newton that is much more efficient. }

\makebeamertitle

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

\label{page:modf-problem} \begin{question}

Approximate a positive zero of $\ec x^{3}+0.4x^{2}-0.51x-0.16$ to
the ten thousandths place.\end{question}

\noindent %1



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

For this module you will need the SAGE worksheet {\hilite Newton's
Method}.


\lyxframeend{}\lyxframe{\noindent {Newton's Method: the idea}}

\noindent Newton's Method is based on the fact that the line tangent
to a function follows the same general direction as the function.
If you start {}``close enough'' to a root of the function, the root
of the tangent line will be close to the root of the function.

\noindent The illustration below gives an example. The root of $\ec f$
(the black curve) is approximately $\ec0.70$. A line tangent to the
graph of $\ec f$ at $\ec x=1$ has a root at approximately $\ec0.78$.
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/motivating_ex} 
\end{figure}



\lyxframeend{}\lyxframe{{Newton's Method: the idea}}
\begin{overlayarea}
{\textwidth}{6in}

By itself, $\ec0.78$ is not that good an approximation. Estimating
from the graph, it looks as if $\ec f(0.78)\approx0.15$, which is
not very close to zero.
\begin{onlyenv}%{}
<1>

Let's build a new line tangent to the graph of $\ec f$\ldots{} 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/motivating_ex} 
\end{figure}


\end{onlyenv}%{}

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

\noindent Let's build a new line tangent to the graph of $\ec f$\ldots{}
at $\ec x=0.78$. 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/motivating_ex_2step} 
\end{figure}


\end{onlyenv}%{}

\pause{}


\noindent The root of the second line is approximately $\ec0.70$.
The graph shows that it is closer to the zero of $\ec f$.

\end{overlayarea}

\lyxframeend{}\lyxframe{{Newton's Method: the algorithm}}

This experiment suggests an algorithm to find zeroes of a function.

\noindent \emph{Given} $\ec f$ and a point $\ec a$ that you think
is {}``close'' to a root of $\ec f$, you can approximate a root
of $\ec f$ by repeating these steps:\begin{method} 
\begin{itemize}
\item Compute the line tangent to $\ec f$ at $\ec x=a$. 
\item Find the root of this equation, and call it $\ec b$. 
\item Is $\ec b$ {}``close enough'' to the actual root? 

\begin{itemize}
\item If not, repeat the process using $\ec b$ in place of $\ec a$. 
\item If so, you are done! 
\end{itemize}
\end{itemize}
\end{method}


\lyxframeend{}\lyxframe{{{}``Close enough''?!?}}

How do we decide that our approximation is {}``close enough''? We
will base our decision on whether the decimal digits of the current
approximation ($\ec b$) are the same as those of the previous approximation
($\ec a$) up to the desired accuracy.


\lyxframeend{}\lyxframe{\noindent {Newton's Method: example}}

\noindent Let's try an example. Fire up the Newton's Method SAGElet.
It should start automatically, showing an approximation of the root
of $\ec x^{3}+4x^{2}-.51x-.16$ using an initial guess of $\ec a=2$,
and two tangent lines. 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.15]{figures/sagelet} 
\end{figure}



\lyxframeend{}\lyxframe{\noindent {Newton's Method: example}}

\noindent The approximation given ($\ec0.9661$) is clearly insufficient.
Move the slider labeled {}``Number of approximations'' to the midway
point, and the applet will try three approximations. You should obtain
$\ec0.7629$.


\pause{}

\noindent Increase the number of approximations repeatedly, one step
each time, seeing if the first four digits will remain equal.


\pause{}

Four approximations gives $\ec0.6937$, and five gives $\ec0.6853$.
We've managed to get the \emph{first} digit to repeat, but not the
rest. To obtain more accuracy, we will have to change the starting
point. Move the slider all the way to the left, then change the starting
point $\ec x_{0}$ to our last approximation, $\ec0.6853.$ It will
be hard to see what is going on, so change the window (\texttt{\ttcolor
xmin}, \texttt{\ttcolor xmax}) the details grow clear.


\lyxframeend{}\lyxframe{{Newton's Method: example}}

Putting $\ec\mathtt{\ttcolor xmin}=0.685$ and $\ec\mathtt{\ttcolor xmax}=0.6854$,
we obtained the following diagram. 
\begin{figure}[h!]
 

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



\pause{}

\noindent The SAGElet reports that running Newton's method one step
from $\ec0.6853$ gives the approximation $\ec0.6852$. We've now
managed to keep \emph{three} digits the same.


\lyxframeend{}\lyxframe{{Newton's Method: exampe}}

Move the slider right one spot, and you should obtain the new approximation
$\ec0.6852$. We've managed to keep four digits the same, so we will
decide that this approximation is \emph{close enough}, or at least
accurate to the ten thousandths place.

\noindent (In fact, we've managed to keep six digits the same.)


\lyxframeend{}\lyxframe{{Newton's Method: Dangers}}
\begin{overlayarea}
{\textwidth}{6in}

There are several cautions to observe with Newton's Method. 
\begin{itemize}
\item If we encounter a point whose tangent line is horizontal, the method
fails because the line has no root. \end{itemize}
\begin{onlyenv}%{}
<1>

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


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item If the method leads us into a {}``bowl'', there may be no way out
and towards the zero. The algorithm may {}``bounce around'' in bad
estimates. \end{itemize}
\begin{onlyenv}%{}
<2>

\begin{figure}[h!]
 

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


\end{onlyenv}%{}

\pause{}
\begin{itemize}
\item A bad starting point can lead to a root different than the one desired,
or even to no root at all. \end{itemize}
\begin{onlyenv}%{}
<3>

\begin{figure}[h!]
 

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


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

\lyxframeend{}\lyxframe{{Newton's Method: Simple example}}
\begin{overlayarea}
{\textwidth}{6in}

We will conclude with a simple example that you should work by hand,
on paper. In this example, we will estimate a root of $\ec\cos x-x$,
correct to the hundredths place, starting at $\ec x=0$.


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

Compute the equation of the first tangent line.

\end{onlyenv}%{}

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

Compute the equation of the first tangent line. You should get
\[
\ec y=-x+1.
\]

\begin{onlyenv}%{}
<3>

(Why? The slope is $\ec f'(0)=-1$. Substitute into $\ec y-y_{0}=m(x-x_{0})$,
where $\ec x_{0}=0$ and $\ec y_{0}=f(x_{0})=1$. Solve for $\ec y$.)

\end{onlyenv}%{}

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

Now solve for the root of the tangent line.

\end{onlyenv}%{}

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

Now solve for the root of the tangent line. You should get
\[
\ec x=1.
\]
 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/easy_step1} 
\end{figure}


\end{onlyenv}%{}

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

Compute the equation of the second tangent line.

\end{onlyenv}%{}

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

Compute the equation of the second tangent line. You should get
\[
\ec y=-(\sin1-1)(x-1)+(\cos1-1)\approx-1.841x+1.382.
\]
 Now solve for the root of the tangent line.

\end{onlyenv}%{}

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

Compute the equation of the second tangent line. You should get
\[
\ec y=-(\sin1-1)(x-1)+(\cos1-1)\approx-1.841x+1.382.
\]
 Now solve for the root of the tangent line. You should get
\[
\ec x\approx0.751.
\]
 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/easy_step2} 
\end{figure}


\end{onlyenv}%{}

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

Compute the equation of the third tangent line.

\end{onlyenv}%{}

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

Compute the equation of the third tangent line. You should get
\[
\ec y=-(\sin0.75-1)(x-0.75)+(\cos0.75-0.75)\approx-1.682x+1.243.
\]
 Now solve for the root of the tangent line.

\end{onlyenv}%{}

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

Compute the equation of the third tangent line. You should get
\[
\ec y=-(\sin0.75-1)(x-0.75)+(\cos0.75-0.75)\approx-1.682x+1.243.
\]
 Now solve for the root of the tangent line. You should get
\[
\ec x\approx0.739.
\]
 
\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/easy_step3} 
\end{figure}


\end{onlyenv}%{}

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

Compute the equation of the fourth tangent line. (Don't fret; we're
almost there!)

\end{onlyenv}%{}

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

Compute the equation of the fourth tangent line. You should get
\[
\ec y=-(\sin0.739-1)(x-0.739)+(\cos0.739-0.739)\approx-1.674x+1.237.
\]
 Now solve for the root of the tangent line.

\end{onlyenv}%{}

\pause{}
\begin{onlyenv}%{}
<14->

Compute the equation of the fourth tangent line. You should get
\[
\ec y=-(\sin0.739-1)(x-0.739)+(\cos0.739-0.739)\approx-1.674x+1.237.
\]
 Now solve for the root of the tangent line. You should get
\[
\ec x\approx0.739.
\]

\begin{onlyenv}%{}
<14>

\begin{figure}[h!]
 

\centering{}\includegraphics[scale=0.3]{figures/easy_step4} 
\end{figure}


\end{onlyenv}%{}

\pause{}


The third and fourth step agree in the hundredths place; the root
is approximately $\ec0.74.$

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

\lyxframeend{}\lyxframe{{Conclusion}}

Newton's method provides a simple method of approximating the roots
of functions. It is based on the observation that, in the neighborhood
of the root of a function, a line tangent to the function leads one
to the root. \begin{method} 
\begin{itemize}
\item Compute the line tangent to $\ec f$ at $\ec x=a$. 
\item Find the root of this equation, and call it $\ec b$. 
\item Is $\ec b$ {}``close enough'' to the actual root? 

\begin{itemize}
\item If not, repeat the process using $\ec b$ in place of $\ec a$. 
\item If so, you are done! 
\end{itemize}
\end{itemize}
\noindent \end{method} 


\lyxframeend{}
\end{document}
