\documentclass[12pt]{article} 

\usepackage{amsmath}    
\usepackage{amsfonts}  
\usepackage{amssymb}
\usepackage{graphicx}  
\usepackage{subfig}
\usepackage{tabularx}
\setlength{\parskip}{3pt plus 2pt}
\setlength{\parindent}{20pt}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\evensidemargin}{0.5cm}
\setlength{\marginparsep}{0.75cm}
\setlength{\marginparwidth}{2cm}
\setlength{\marginparpush}{1.0cm}
\setlength{\textwidth}{165mm}
\setlength{\textheight}{9 true in}
\setlength{\topmargin}{-2cm}
\setlength{\footskip}{10pt}

\linespread{1.5}

\begin{document}

\pagestyle{empty}

%\begin{flushright}
%Name: \line(1,0){200}
%\end{flushright}
%\vskip1ex
\begin{center}{
\large{ \bf{ Homework 2: due February 12 \\  MTH 365/465 Numerical Linear Algebra, Spring 2018}}
}\end{center}

\textbf{Note: For computational problems, you should attach both your code(s) and output.} 

\begin{enumerate}
 
\item (15pts) Chapter 6, Exercise 1 (a,b,c).
  \vskip1ex
\item (10pts) Chapter 6, Exercise 2. 
  \vskip1ex
\item (15pts) \emph{Numerical differentiaton.} One can aproximate the derivative of a function $f(x)$ by
  $$ f'(x) \approx \frac{f(x+h)-f(x)}{h}. $$
  Since, using Taylor theorem with reminder,
  $$f(x+h) = f(x)+ hf'(x) + (h^2/2)f''(\xi), \quad \xi \in [x,x+h],$$
  the \emph{truncation error} in approximation of $f'(x)$ is $O(h)$:
  $$ \Big |f'(x) - \frac{f(x+h)-f(x)}{h} \Big | = (h/2)f''(\xi).$$
  \begin{enumerate}
    \item (5pts) Let $f(x) = \sin(x)$ and $x = \pi/3$. Is the problem of computing $f'(x) = \cos(x)$ well-conditioned or ill-conditioned?
    \item (10pts) Use $f'(x) \approx \displaystyle \frac{f(x+h)-f(x)}{h}$ to approximate $f'(x)$ for $f(x) = \sin(x)$ and $x = \pi/3$.
      Take $h = 1.e-1, 1.e-2, \ldots, 1e-16$ and make a table of your results and the difference between the computed results and the true value of $f'(x)$, namely,
      $\cos(\pi/3) = 0.5$. (You may use MATLAB hints in Section 2.9 to create a table.) \\
      Note that the smallest error is achieved when $h \approx \sqrt{\epsilon_{machine}}$ (you do not have to show this), so you should see this in your table.
      Write your conclusions. (Recall: typing \emph{eps} in MATLAB gives double-precision $\epsilon_{machine}$ by default.)
  \end{enumerate}
  \vskip1ex
\item (15pts) Using MATLAB functions \emph{poly} and \emph{polyder}, compute the relative condition numbers of 
the roots $x_1, x_2, \ldots, x_{20}$ of the Wilkinson polynomial \\ $w(x) = (x-1)(x-2)\cdots(x-20) = x^{20}-210x^{19}+ \ldots$
with respect to perturbation of the coefficient of $x^{19}$, $a_{19}$, from $-210$ to $-210+2^{-23}$. 
Present your results in tabular form and write your conclusion on the ill-conditioninig of the Wilkinson polynomial. \\
(\emph{Recall:} condition number for the $j$th root is $\kappa(x_j) = \displaystyle \frac{|a_{i} x_j^{i-1}|}{|w'(x_j)|}$.)
\vskip5ex
\item (5pts each) \textbf{MTH 465 students only:} Chapter 6, Exercises 1(f) and 3. 
\end{enumerate}

\end{document}







