% Newton's Method
% MATH 266B Exercise 3
\documentclass[12pt]{article}
\usepackage{times}
\pagestyle{empty}
\addtolength{\textwidth}{1.2in}
\addtolength{\textheight}{1.2in}
\addtolength{\oddsidemargin}{-.58in}
\addtolength{\evensidemargin}{-.58in}
\renewcommand{\baselinestretch}{1.0}
\parindent = 0cm
\parskip = .1cm
\begin{document}
\begin{center}
{\Large Newton's Method
\footnote{Copyright \copyright 2003 Winfried Just, Department Mathematics,
Ohio University. All rights reserved.}}
\end{center}
In this exercise, we will do some experiments to see what can go wrong with Newton's method.
You may be asked to submit this exercise as part of Quiz~2. You should prepare a worksheet
with the answers to all questions posed below for submission.\\
For this exercise, you need to download the file Newton.m from my web page and save it in
the ``work'' directory of your \textsc{MatLab} folder without changing its name (and without changing
the extension .m)! \\
First let us explore an example that was already discussed in class. Let
$f(x) = x^2 + 1$.
This function never takes on the value zero, so Newton's method should fail. There are
several ways in which the method could fail; let us explore some. Enter:
\smallskip
\verb$>> Newton$\\
\smallskip
At the next prompt enter:
\smallskip
\verb$>> x^2 + 1$\\
\smallskip
Enter an initial value of \verb& 1&, and instruct \textsc{MatLab} to display the results on the
interval $[-2 , 2]$ with the $y$-values ranging from -1 to 5 by entering the appropriate
numbers at the prompts. Then hit ENTER twice.\\
\begin{enumerate}
\item
What answer does \textsc{MatLab} give you, and why?\\
Now let us run the program ``Newton'' for the same function with the same viewing window, but
starting with an initial value $x_0 = 0.7$. Hit ENTER a few times.\\
\item
Describe in your own words what you observe about the behavior of the subsequent ``approximations''
$x_n$ generated by Newton's method.\\
Now let us look at a different example. Run ``Newton'' for the function
$f(x) = x^5 - x + 2$.
Let the initial value be $x_0 = -0.9$,
and let the program display the graphs for $x$-values in
the interval $[-2, 1.5]$ and $y$-values ranging from -0.5 to 3.5.\\
\item
What $x$-value do the subsequent approximations appear to get close to? Does this make sense?\\
Now let us run ``Newton'' on the same function in the same viewing window, but this time
start from an initial value of 0.9. Hit ENTER until you get the same approximation as in
the previous run, and keep track of the number of times you have to hit ENTER (it may take a while).\\
\item
How often did you have to hit ENTER to get the desired approximation? What went wrong in
the first few approximations?\\
Finally, let us explore the behavior of Newton's method for the function
$f(x) = xe^{-x^2}$.
Enter the function as:
\smallskip
\verb$>> x*exp(-x^2)$\\
\smallskip
Start with $x_0 = 0.4$.
Let the interval for the $x$-values be $[-0.5, 4]$, and let the $y$-values range from
-0.5 to 0.5.
\item
Does Newton's method approximate an $x$ such that $f(x) = 0$? What is the $x$?\\
Now let us explore the same function with the same viewing window, but start with an initial
value $x_0 = 1$. Hit ENTER ten times to observe the pattern.
\item
What pattern do you observe? Will the updates ever approach the $x$ that you found as the answer
to the previous question? Why or why not?\\
\item
Based on your observation, what recommendation can you give to potential users of Newton's
method? Explain the reason for your recommendation in a couple of sentences.
\end{enumerate}
\end{document}