
\documentstyle[11pt]{article}
\font\tenmsb=msbm10
\font\sevenmsb=msbm7
\font\fivemsb=msbm5


\newfam\msbfam
\textfont\msbfam=\tenmsb
\scriptfont\msbfam=\sevenmsb
\scriptscriptfont\msbfam=\fivemsb
\def\Bbb#1{{\fam\msbfam #1}}

\font\teneufm=eufm10
\font\seveneufm=eufm7
\font\fiveeufm=eufm5
\newfam\eufmfam
\textfont\eufmfam=\teneufm
\scriptfont\eufmfam=\seveneufm
\scriptscriptfont\eufmfam=\fiveeufm
\def\frak#1{{\fam\eufmfam\relax#1}}
\let\goth\frak




\newcommand\qed{{\hspace*{\fill}Q.E.D.\vskip12pt plus 1pt}} \newcommand\sA{{\cal A}}%script letters
\newcommand\sB{{\cal B}}
\newcommand\sC{{\cal C}}
\newcommand\sD{{\cal D}}
\newcommand\sE{{\cal E}}
\newcommand\sF{{\cal F}}
\newcommand\sG{{\cal G}}
\newcommand\sH{{\cal H}}
\newcommand\sJ{{\cal J}}
\newcommand\sK{{\cal K}}
\newcommand\sL{{\cal L}}
\newcommand\sM{{\cal M}}
\newcommand\sN{{\cal N}}
\newcommand\sO{{\cal O}}
\newcommand\sP{{\cal P}}
\newcommand\sQ{{\cal Q}}
\newcommand\sR{{\cal R}}
\newcommand\sS{{\cal S}}
\newcommand\sT{{\cal T}}
\newcommand\sU{{\cal U}}
\newcommand\sW{{\cal W}}
\newcommand\sX{{\cal X}}
\newcommand\sV{{\cal V}}
\newcommand\sZ{{\cal Z}}

\newcommand\shw{\sO_{\cal W}}

\newcommand\gra{\alpha}
\newcommand\grb{\beta}
\newcommand\grG{\Gamma}
\newcommand\grg{\gamma}
\newcommand\grd{\delta}
\newcommand\gre{\epsilon}
\newcommand\grk{\kappa}
\newcommand\grL{\Lambda}
\newcommand\grl{\lambda}
\newcommand\vphi{\varphi}
\newcommand\grr{\rho}
\newcommand\grs{\sigma}
\newcommand\grt{\tau}
\newcommand\grx{\chi}
\newcommand\grz{\zeta}

\newcommand\rat{{\Bbb Q}}
\newcommand\reals{{\Bbb R}}
\newcommand\comp{{\Bbb C}}
\newcommand\zed{{\Bbb Z}}
\newcommand\eff{{\Bbb F}}
\newcommand\fm{{\frak m}}
\newcommand\fri{{\frak I}}
\newcommand\fj{{\frak K}}
\newcommand\fL{{\frak L}}


\newcommand\oline[1]{{\overline {#1}}}


\def\rank{{\mathop{\rm rank}\nolimits}}
\def\cod{{\mathop{\rm cod}\nolimits}}
\def\min{{\mathop{\rm min}\nolimits}}
\def\dim{{\mathop{\rm dim}\nolimits}}






\newcommand\proof{{\noindent\bf Proof.\ }} 

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{clam}[theorem]{Claim}
\newtheorem{prop}[theorem]{Proposition}
\newtheorem{no}[theorem]{Notation}
\newtheorem{con}[theorem]{Conjecture}
\newtheorem{question}[theorem]{Question} \newtheorem{definition}[theorem]{Definition} \newtheorem{re}[theorem]{Remark}
\newtheorem{pargrph}[theorem]{}
\newtheorem{examp}[theorem]{Example}
\newtheorem{problem}{Problem}


\newenvironment{rem*}{\begin{re}\em}{\end{re}} \newenvironment{example}{\begin{examp}\em}{\end{examp}} \newenvironment{def*}{\begin{definition}\em}{\end{definition}} 

\newenvironment{prgrph}{\indent\begin{pargrph}\em}{\end{pargrph}} \newenvironment{prgrph*}[1]{\indent\begin{pargrph}{\bf #1.}\em\ }{\end{pargrph}}





\begin{document}
\title{Mathematics 423:
Numerical Analysis (Spring 1998)}
\date{May 5, 1998}
\author{Andrew J. Sommese}
\maketitle
\tableofcontents

\newpage
\section{Syllabus}The book used was Burden and Faires, {\em Numerical Analysis} (sixth ed.). As the homework assignments show I jumped around in the book filling in material as needed. I often went deeper into the material than the book, e.g., the Euler-Maclaurin series was derived, the properties of Bernoulli and Chebychev polynomials were proved, and their generating functions were derived. The basic theory of finite difference equations was covered and used to solve some stiff and some unstable
differential equations. The book is the standard book, and is recommended by the actuary society for student
taking that test. I have used the book before, but will probably 

not use it in the future. It is somewhat dated, and given the software available, the emphasis is very old fashioned. 

\begin{enumerate}
\item[Chapter 1:\ ] Preliminaries
\begin{enumerate}
\item[1.1:\ ] Review of Calculus
\item[1.2:\ ] Roundoff Errors and Computer Arithmetic \item[1.3:\ ] Algorithms and Convergence \end{enumerate}
\item[Chapter 2:\ ] Solutions of Equations in One Variable 
\begin{enumerate}
\item[2.1:\ ] The Bisection Method
\item[2.2:\ ] Fixed Point Iteration
\item[2.3:\ ] The Newton-Raphson Method
\item[2.4:\ ] Error Analysis for Iterative Methods \end{enumerate}
\item[Chapter 3:\ ] Interpolation and Polynomial Approximation 
\begin{enumerate}
\item[3.1:\ ] Interpolation and the Lagrange Polynomial \item[3.2:\ ] Divided Differences
\item[3.3:\ ] Hermite Interpolation
\item[3.4:\ ] Cubic Spline Interpolation \end{enumerate}
\item[Chapter 4:\ ] Preliminaries
\begin{enumerate}
\item[4.1:\ ] Numerical Differentiation
\item[4.2:\ ] Richardson's Extrapolation \item[4.3:\ ] Elements of Numerical Integration \item[4.4:\ ] Composite Numerical Integration \item[4.5:\ ] Romberg Integration
\item[4.6:\ ] Adaptive Quadrature Methods \end{enumerate}
\item[Chapter 5:\ ] Initial-Value Problems for Ordinary Differential Equations 
\begin{enumerate}
\item[5.1:\ ] The Elementary Theory of Initial-Value Problems \item[5.2:\ ] Euler's Method
\item[5.3:\ ] Higher Order Taylor Methods \item[5.4:\ ] Runge-Kutta Methods
\item[5.5:\ ] Error Control and the Runge-Kutta-Fehlberg Method \item[5.6:\ ] Multistep Methods
\item[5.9:\ ] Higher-Order Equations and Systems of Differential Equations \end{enumerate}
\item[Chapter 7:\ ] Iterative Techniques in Matrix Algebra 
\begin{enumerate}
\item[7.1:\ ] Norms of Vectors and Matrices \item[7.3:\ ] Iterative Techniques for Solving Linear Systems \item[7.4:\ ] Error Estimates and Iterative Refinement \end{enumerate}
\item[Chapter 8:\ ] Approximation Theory 
\begin{enumerate}
\item[8.1:\ ] Discrete Least Squares Approximation \item[8.2:\ ] Orthogonal Polynomials and Least Squares Approximation \item[8.3:\ ] Chebychev Polynomials
\end{enumerate}
\item[Chapter 9:\ ] Approximating Eigenvalues 
\begin{enumerate}
\item[9.1:\ ] Linear Algebra and Eigenvalues \end{enumerate}
\item[Chapter 10:\ ] Numerical Solutions of Nonlinear Systems of Equations 
\begin{enumerate}
\item[10.1:\ ] Fixed Points for Functions of Several Variables \item[10.2:\ ] Newton's Method
\end{enumerate}
\item[Chapter 11:\ ] Boundary-Value Problems for Ordinary Differential Equations
\begin{enumerate}
\item[11.1:\ ] The Linear Shooting Method \item[11.2:\ ] The Shooting Method for Nonlinear Problems \item[11.3:\ ] The Finite-Difference Method for Linear Problems \item[11.4:\ ] The Finite-Difference Method for Nonlinear Problems \end{enumerate}
\item[Chapter 12:\ ] Numerical Solutions of Partial-Differential Equations 
\begin{enumerate}
\item[12.1:\ ] Elliptic Partial-Differential Equations \end{enumerate}
\end{enumerate}



\section{Handout}
\begin{center}
{\bf Mathematics 423, Spring Semester 1998}\\ January 12, 1998
\end{center}

\bigskip

\begin{tabbing}
Text: \=Elements of \=Modern Algebra, by Gilbert and Gilbert\kill {\em Instructor}: \>\> Andrew Sommese\\
\>\>	231 CCMB (On Juniper, just south of the main library)\\
\>\>e-mail: sommese.1@nd.edu\ \ \ \	Phone: 631-6498\\
{\em Text}: \>Numerical Analysis (sixth ed.), by Burden and Faires\\ \end{tabbing}
{\em Office Hours}: Open Door: I am in my office almost all of every weekday, and encourage you to
visit any time. If you just come to my office you will probably find me, but if you set up a time with me before hand, then you can be sure that I will be there. \\

\noindent{\em Examinations, homework, and grades:\ } 
There will be two one-hour departmental examinations worth 100 points and a two-hour final
examination worth 150 points.	The final exam will cover all
the material of the course with emphasis on the material covered after the second exam.



A student who misses an examination will receive no points for that exam unless he or she has written permission from the {\em Vice President for Student
Affairs}. (Travel plans are not considered to be a sufficient excuse for taking an exam
on a different date.)



Homework will be assigned regularly, and is an integral part of the course. I ask students to form groups of three (and one or two groups of size four depending on the number of students in the class modulo 3) to do all the assignments. If there are people who would like to be in the same group, please let me know by the end of class on Friday, January 16. I will hand out the lists of members of the class by groups on Monday, January 19. If the class enrollment changes I might have to add members
to a few groups.
Typically I will give assignments throughout the week and collect them the following Monday.
I strongly encourage you to see me if there is anything connected with the course or the mathematics in the course that you are unclear on or would like to know more about.	You are allowed and encouraged
to use your notes and C programs, any numerical analysis or C books, and any library books while doing the homework. 



Both examinations and the homework are conducted under the honor code. People within a group are graded together on the homework assignments, and are expected to work together.
People in different groups are encouraged to discuss the mathematics, but should not
discuss how to do the week's assignment before it is handed in! 



Homework will be worth 100 points.
Thus the total number of possible points for the semester is 450. The numerical break points for letter grades (A, A-, B+,\ldots) will be based only on the
test scores and the homework.





\medskip


\begin{tabbing}
Exam 1:\ \ \=8:00 A.M.; Tuesday, Nov.\ 29 1994\ \ \ \ \ \ \=(in class)\kill
Exam 1: \> Wednesday, February 25 in class \\ Exam 2: \> Wednesday, April 8 in class.\\ Final: \> Thursday, May 7, 1998: 8:00-10:00 AM.\\ \end{tabbing}
{\em The most recent version of this handout plus other useful materials can be found in}\ \ \
{\verb+/afs/nd.edu/coursesp.98/math/math423.01+}. 

\newpage
\section{Homework Assigned}


\begin{tabbing}
August 31 (Wednesday )\=\ pagepage \ \ \ \ \=16, 17, 23, 27, 29, 37\kill \ \ \ \ {\em Due Date} \>{\em Page Number}\ \>{\em Problems Assigned}\\ \smallskip
1st week\>26\>1a,c;3a,c;5e,h;6e,h;7e,h;8e,h;27\\ January 28 (Wed.)\>53\>1 (use a calculator); 7c,d; 13\\ extended to Feb. 2\>63\>1; 2; 12; 17 \\
\>75\>1 (use a calculator); 6a,f; 8i:a,f; 13b,c\\ \>86\>4; 6\\
February 2 (Mon.)\>119-123\>1a,c; 2a,c; 3a,b; 5; 7a,b; 14; 16\\ February 9 (Mon.)\>132-134\>1; 2; 4; 13\\ \>141-142\>1a,c; 2a,c; 7\\
February 16 (Mon.)\>197\>1ab; 3ab; 5ab\\ \>205--206\>1a,b; 2a,b; 3ab; 7\\
\>221--222\>1a; 2a; 3ab; 7\\
\>Exercise 1 of the Bernoulli polynomial handout\\ February 23 (Mon.)\>177-178\>1 (forward diff.\ only); 3a,b\\ \>186-187\>9; 10; 11\\
\>213\>1h; 2h\\
March 2 (Mon.)\>259\>4\\
\>267\>1a\\
\ \ \ for Mar.\ 16 (Mon.) Read to pg.\ 292\\ March 18 (Wed.)\>258\>1c,d; \\
\>267\>1c; 2c; 3b,c; 4c\\
\>274\>1a,d; 2a; 3b\\
March 23 (Mon.)\>285\>11a; 15--use maple\\ \>293\>6 (use rkf45; maple makes this easy)\\ \>304\>1a; 2a;\ (only two-step methods, only $t\le 0.4$)\\ March 30 (Mon.)\>328\> 2\\
(write as a system of first order equations, do not solve)\\ \>340\>4b,c\\
\>483-485\>5acd(use logs in d); 7; 10\\
\>496\>11; 12a\\
\>506\>1a\\
April 6 (Mon.)\>597\> 2, 4, 5a, 9a\\
\>604\>1d, 3a; \ Also do the Problems 1, 2 below.\\ April 20 (Mon.) \>631\> 3b\\
\>638\> 3a,c\\
\>644\> 3a,d\\
\> 547\> 3\\
April 27 (Mon.) \>651\> 3c,d\\
\>154\> 1; 3a,d; 11\\
\end{tabbing}

\bigskip

\noindent {\bf Problem 1.} Let $V_4$ denote the degree $\le 4$ polynomials. Compute the degree $\le 4$ polynomial $p(x)$ such that $\displaystyle
||p(x)-T_6(x)||=\min_{q\in V_4}||q(x)-T_6(x)||. $
where $T_6(x)$ is the sixth Chebychev polynomial and $\displaystyle ||f||=\sqrt{<f,f>}$, where for two functions $f,g$ on $[-1,1]$ $$
<f,g> =\int_{-1}^1\frac{f(x)g(x)}{\sqrt{1-x^2}}\mbox{\rm d}x. $$

\noindent {\bf Problem 2.} Let $V_3$ denote the degree $\le 3$ polynomials. For two functions $f,g$ on $[0,1]$ let
$$
<f,g> =\int_{0}^1 f(x)g(x)\mbox{\rm d}x. $$
Find a basis of $V_3$ that contains $1$ and is orthogonal relative to $<f,g>$.


\newpage
\section{First Test}
\begin{center}
{\em Mathematics 423: Test I: February 25, 1998} \end{center}

{

\noindent\large Name: }

{\large \em To receive credit you must show your work.} 

\begin{center}
\large\begin{tabular}{c|c|r}
Problem Number& Maximum Points & Points attained\\ \hline\hline 1&8\\ \hline
2&8 \\ \hline
3&16 \\ \hline
4&6 \\ \hline
5&6 \\ \hline
6&6 \\ \hline
7&6 \\ \hline
8&10 \\ \hline
9&10 \\ \hline
10&10 \\ \hline
11&6 \\ \hline
12&8\\ \hline
TOTAL&100\\
\end{tabular}
\end{center}
\section*{Some Useful Results}The following results may be of some use. You can assume them
in any argument you need to give.



\begin{theorem}[Neville's Recursion Formula]Let $x_0,\ldots,x_n$ be distinct real numbers in the interval, $[a,b]$. Let $f$ be a real valued function on $[a,b]$, and let $P(x)$ denote the
unique polynomial of degree $\le n$ such that $f(x_i)=P(x_i)$ for $i=0,\ldots,n$. For $c=0,\ldots,n$, let $P_{\widehat{c}}(x)$ denote the unique polynomial
of degree $\le n-1$ such that $P_{\widehat{c}}(x_i)=f(x_i)$ for $0\le i\le n$ with
$i\not= c$. Then for two distinct points $x_j$ and $x_k$ in the set $\{x_0,\ldots,x_n\}$:
$$P(x)=\frac{(x-x_j)P_{\widehat{j}}(x)-(x-x_k)P_{\widehat{k}}(x)}{x_k-x_j}$$ or equivalently:
$$P(x)=\frac{x-x_j}{x_k-x_j}P_{\widehat{j}}(x)+\frac{x-x_k}{x_j-x_k}P_{\wide hat{k}}(x).$$
\end{theorem}


\bigskip
\begin{theorem}[Hermite Interpolation Error Formula]\label{hermite}Let $x_0,\ldots,x_n$ be distinct real numbers in the interval, $[a,b]$. Let $f$ be an $2n+2$ times continuously differentiable function on $[a,b]$. Let $H(x)$ denote the
the unique polynomial of degree $\le 2n+1$ such that for $0\le i\le n$, $f(x_i)=H(x_i)$ and $f'(x_i)=H'(x_i)$. Then for each $x\in [a,b]$, there exists a point $\xi\in (a,b)$ such that
$$f(x)-H(x)=\frac{f^{(2n+2)}(\xi)}{(2n+2)!}(x-x_0)^2\cdots(x-x_n)^2.$$ \end{theorem}
\bigskip



\begin{theorem}[Euler Summation Formula]Let $f$ be an $2m+2$ times continuously differentiable function on $[a,b]$. Let $h:= \displaystyle\frac{b-a}{n}$ for some integer $n\ge 1$. Let $x_j:= a+jh$ for $j=0,\ldots,n$. Let $B_j$ denote the $j$-th Bernoulli number.
There exists $\xi\in (a,b)$ such that
\begin{eqnarray*}
\left(f(a)+\sum_{j=1}^{j=n-1}2f(x_j) +f(b)\right)\frac{h}{2} &=&\int_a^bf(x)dx+\sum_{j=1}^m\left[f^{(2j-1)}(b)-f^{(2j-1)}(a)\right]B_{2j} \frac{h^{2j}}{(2j)!}
\\ &+&f^{2m+2}(\xi)B_{2m+2}\frac{h^{2m+2}(b-a)}{(2m+2)!}. \end{eqnarray*}
\end{theorem}





\section*{Problems}In the following you must show your work. \bigskip

\begin{problem}[8 points total] Perform the following computations in 
a) 3 digit rounding arithmetic; and compute b) the absolute error, and
c) the relative error in each case:
\begin{enumerate}
\item $(121-0.3)-119$;
\item $(121-119)-0.3$.
\end{enumerate}
Put your answers in the table below.
\end{problem}

\vspace{0.1in}

\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
expression to &3 digit rounding answer&absolute error& relative error\\ be evaluated&{\em(2 points each)}&{\em(1 point each)}& {\em(1 point each)}\\ \hline\hline
{\rule[-2mm]{0mm}{7mm}$(121-0.3)-119$}&&&\\ \hline {\rule[-2mm]{0mm}{7mm}$(121-119)-0.3$}&&&\\ \hline \end{tabular}
\end{center}






\begin{problem}[8 points total] Perform the following computations in 
a) 3 digit chopping arithmetic; and compute b) the absolute error, and
c) the relative error in each case:
\begin{enumerate}
\item $(102-0.3)-0.7$;
\item $102-(0.3+0.7)$.
\end{enumerate}
Put your answers in the table below.
\end{problem}


\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
expression to &3 digit rounding answer&absolute error& relative error\\ be evaluated&{\bf(2 points each)}&{\bf(1 point each)}& {\bf(1 point each)}\\ \hline\hline
{\rule[-2mm]{0mm}{7mm}$(102-0.3)-0.7$}&&&\\ \hline {\rule[-2mm]{0mm}{7mm}$102-(0.3+0.7)$}&&&\\ \hline \end{tabular}
\end{center}





\begin{problem}[16 points total] A person wishes to find a zero of $f(x)=e^x-3x$ for $0\le x\le 1$. That person decides to use the bisection method to accomplish this. {\em Assume for simplicity that you are using exact arithmetic, i.e., that the errors of computer arithmetic play no role here.}
\begin{enumerate}
\item[\bf 5 pts:]State a theorem and show that it applies to guarantee 
that $f(x)$ has a zero on $[0,1]$.
\item[\bf 5 pts:]The first approximation to a solution by the bisection 
method is $0.5$ with $f(0.5)=e^{0.5}-3\cdot 0.5\approx 0.15$.
What is the second approximation to a solution by the bisection method?
\item[\bf 6 pts:]You would like to find an approximation to a zero of $f(x)$ 
on $[0,1]$ with an absolute error of no more than $0.001$. Using the bisection method as outlined in the previous part of this problem, and the error estimate for the bisection method,
which is the smallest integer $n$ for which you know that on the
$n$-th approximation you will be within $0.001$ of the correct
answer. An answer without justification by the error estimate
for the bisection method will receive no credit. \end{enumerate}
\end{problem}




\begin{problem}[6 points total] A person wishes to find a zero of $f(x)=e^x-3x$ for $0\le x\le 1$. That person decides to use the secant method
for finding a solution of the equation $f(x)=0$ on the interval, $[0,1]$. {\em Assume for simplicity that you are using exact arithmetic, i.e., that the
errors of computer arithmetic play no role here.} What is the first approximation to a solution in the open interval $(0,1)$ by the secant method? \end{problem}




\begin{problem}[6 points total] A person wishes to find a zero of $f(x)=e^x-3x$ for $0\le x\le 1$. That person decides to use Newton's method (also known as the Newton-Raphson method) for finding a solution of the equation $f(x)=0$ on the interval, $[0,1]$. {\em Assume for simplicity that you are using exact arithmetic, i.e., that the errors of computer arithmetic play no role here.} Write down iteration formula that Newton's method gives for solving $f(x)=0$, and using $1.0$ as a starting guess find the first approximation to a solution of $f(x)=0$ given by this formula.
\end{problem}









\begin{problem}[6 points total] Does $p_n=10^{-3^n}$ with $n=1,2,3,\ldots$ converge to zero of order $3$? To receive credit you must justify your answer, i.e., show it converges of order $3$ to zero or show why it does not converge of order $3$ to zero.
\end{problem}












\begin{problem}[6 points total] Write down the Lagrange form \hbox{\rm (}{\em not the Newton form}\hbox{\rm )} of the interpolating polynomial of degree $\le 2$ with the value $0$ at $x_0=0$, the value $2$ at $x_1=1$, and the value $3$ at $x_2=3$. \end{problem}








\begin{problem}[10 points total]Given the function $f(x)=x^3$:
\begin{enumerate}
\item[\bf 7 pts:]Compute the divided differences, 
$\displaystyle f[0],f[0,2],f[0,2,3];$
\item[\bf 3 pts:]Write down the interpolating polynomial, $p_2(x)$, of 
degree $\le 2$ for $f(x)$ with the node points $x_0=0$, $x_1=2$, $x_2=3$ using Newton's interpolatory 
divided-difference formula, i.e., by using the Newton polynomial built out of divided differences \hbox{\rm (} {\em not the Lagrange form}\hbox{\rm )}. \end{enumerate}
\end{problem}




\begin{problem}[10 points total]Neville's method is used to approximate $f(1)$ giving the following table:
$$
\begin{array}{llll}
x_0=0&P_0=0 \\
x_1=2&P_1=16 &P_{01}=8\\
x_2=3&P_2 &P_{12} &P_{123}=8 \\
%24,8
\end{array}
$$
Determine $P_2=f(3)$.
\end{problem}







\begin{problem}[10 points]Let $\displaystyle f(x)=\sin\left(\frac{\pi}{2} x\right)$.
Let $H_3(x)$ denote the unique polynomial of degree $\le3 $ such that $f(0)=H_3(0)$, $f'(0)=H_3'(0)$, $f(1)=H_3(1)$, $f'(1)=H_3'(1)$. \begin{enumerate}
\item[\bf 5 points:] Compute the coefficients $a_0, a_1, a_2, a_3$, of $H_3$ 
in the Newton divided difference form
$\displaystyle H_3(x) := a_0+a_1x+a_2x^2+a_3x^2(x-1).$ \item[\bf 5 points:] Use the error term in theorem (\ref{hermite}) to estimate $\displaystyle|H_3(0.5)-f(0.5)|$. 
{\em You may use the upper bound $\displaystyle\max_{[0,1]}|f^{(4)}(x)|\le 6.4$.}
\end{enumerate}
\end{problem}


\begin{problem}[6 points]Let $f(x)$ be a $2m+2$ times differentiable function
defined on the real line. Assume that $f(x)$ is {\em periodic} with period $4$,
i.e., $f(x+4)=f(x)$ for all real points $x$. Prove that the trapezoidal approximation on $[0,4]$ is an order $2m+2$ method, i.e., show that with $h=4/n$,
and $x_j=jh$ for $j=0,\ldots,n$:
$$
\left(f(0)+\sum_{j=1}^{j=n-1}2f(x_j) +f(4)\right)\frac{h}{2} 
=\int_0^4f(x)dx+O(h^{2m+2}).
$$
\end{problem}




\begin{problem}[8 points total]Consider
a four times continuously differentiable real valued function $f(x)$ on $[0,1]$.
Assume that the trapezoidal approximations for $n=1, 2$ are $2, 2.3$ respectively.
What is the Richardson extrapolation estimate to $\int_0^1f(x)dx$ that the Romberg method of integration makes using these trapezoidal approximations? \end{problem}

\setcounter{problem}{0}
\section{Second Test}
\begin{center}
{\em Mathematics 423: Test II: April 8, 1998 }
\end{center}

{

\noindent\large Name:
............................................................. 

}

{\large \em To receive credit you must show your work.} 

\begin{center}
\large\begin{tabular}{c|c|r}
Problem Number& Maximum Points & Points Lost\\ \hline\hline 1&10\\ \hline
2&10 \\ \hline
3&10 \\ \hline
4&15 \\ \hline
5&11 \\ \hline
6&12 \\ \hline
7&10 \\ \hline
8&8 \\ \hline
9&14 \\ \hline
TOTAL LOST&\\
\end{tabular}
\end{center}
\vspace{0.4in}

\noindent{\bf Runge-Kutta of Order Four} For the ordinary differential equation $y'=f(t,y)$ on $[a,b]$ with initial condition $y(a)=\alpha$ and stepsize $h$ we have
\begin{eqnarray*}
w_0&=&\alpha\\
k_1&=&hf\left(t_i,w_i\right)\\
k_2&=&hf\left(t_i+\frac{h}{2},w_i+\frac{k_1}{2}\right)\\ k_3&=&hf\left(t_i+\frac{h}{2},w_i+\frac{k_2}{2}\right)\\ k_4&=&hf\left(t_i+h,w_i+k_3\right)\\
w_{i+1}&=&w_i+\frac{1}{6}(k_1+2k_2+2k_3+k_4) \end{eqnarray*}




\section*{Problems}In the following you must show your work. \bigskip






\begin{problem}[{\bf 10 points}]\label{same}\ \ \ \begin{enumerate}
\item Use Euler's method to approximate the solution of the following initial value problem:
$$y'=ty; \ 1\le t\le 2;\ y(1)=\sqrt{e}, \mbox{with\ } h=1.0.$$ 
\item The actual solution of the above differential equation is $\displaystyle y(t)= e^\frac{t^2}{2}$.
Compute the absolute error of the approximate solution at $\displaystyle t =2.0$ found in part 1 of this problem.
\end{enumerate}\end{problem}


\begin{problem}[{\bf 10 points}]\ \ \
\begin{enumerate}
\item Use Taylor's method of order two to approximate the solution of the initial
value problem as in Problem \ref{same}:
$$y'=ty; \ 1\le t\le 2.0;\ y(1)=\sqrt{e}, \mbox{with\ } h=1.0.$$ \item The actual solution of the above differential equation is $\displaystyle y(t)= e^\frac{t^2}{2}$.
Compute the absolute error of the approximate solution at $\displaystyle t =2.0$ found in part 1 of this problem.
\end{enumerate}
\end{problem}



\begin{problem}[{\bf 10 points}]\ \ \
\begin{enumerate}
\item{\bf 5 points:} Use the Runge-Kutta method of order four to approximate the solution of the initial
value problem as in Problem \ref{same}:
$$y'=ty; \ 1\le t\le 2.0;\ y(1)=\sqrt{e}, \mbox{with\ } h=1.0.$$ (See page one for some useful formulae!) 
\item{\bf 5 points:} The actual solution of the above differential equation is $\displaystyle y(t)= e^\frac{t^2}{2}$. Compute the absolute error of the approximate solution at $\displaystyle t =2.0$ found in part 1 of this problem.
\end{enumerate}
\end{problem}






\begin{problem}[{\bf 15 points}] Consider the difference equation: $$y_n=7y_{n-1}-10y_{n-2}+4.$$
\begin{enumerate}
\item {\bf 10 points:} Solve the above difference equation, i.e., 
find $y_n$ for $n\ge 0$, subject to the initial conditions $y_0=1$, $y_1=4$. \item {\bf 5 points:} Find $\displaystyle\lim_{n\to \infty}\frac{y_{n+1}}{y_n}$.
\end{enumerate}
\end{problem}









\begin{problem}[{\bf 12 points}] Let $v=(2,2,4)$ be the vector in $\reals^3$. 
Compute $||v||_1$, $||v||_2$, and $||v||_\infty$. \end{problem}




\begin{problem}[{\bf 11 points}]
Consider the solution $y(t)$ of the initial value problem: $$y''-xy'+4y=0;\ \ -1\le x\le 1$$
with initial values $y(-1)=-1,y'(-1)=2$. 
Rewrite the ordinary differential equation as a $1$st order system of ordinary
differential equations.
\end{problem}






\begin{problem}[{\bf 8 points}] Let
$\displaystyle <f(x),g(x)> = \int_{-1}^1\frac{f(x)g(x)}{\sqrt{1-x^2}}dx$ 
be an inner product
on $V_5$, the vector space of polynomials of degree $\le5$ on $[-1,1]$. It is known that the
Chebychev polynomials
$$T_0(x), T_1(x), T_2(x), T_3(x), T_4(x), T_5(x)$$ form an orthogonal basis of $V_5$ relative to this inner product. Moreover it is known that
$\displaystyle <T_n(x),T_n(x)>=\frac{\pi}{2}$ for $n>0$ and $\displaystyle <T_0(x),T_0(x)>=\pi$ .

Assume that $f(x)=T_1(x)+4T_2(x)-4T_3(x)+T_4(x)$. Find $<f(x),f(x)>$.
\end{problem}


\begin{problem}[{\bf 10 points}] Let $\displaystyle ||g(x)|| = \int_0^1g(x)^2dx$ be the norm
associated to the inner product
$\displaystyle <f(x),g(x)> = \int_0^1f(x)g(x)dx$ on the polynomials on $[0,1]$.
\begin{enumerate}
\item {\bf 7 points:} Find the linear least squares polynomial approximation to $f(x)=x^2+2$
on $[0,1]$, i.e.,
find the polynomial $h(x)$ of degree $\le 1$ such that $||h(x)-f(x)||$ is minimum.
\item {\bf 3 points:} What is $\displaystyle\int_0^1(h(x)-f(x))(3x+7)dx$? If you do this without a computation
explain why you know the number you wrote down is the answer. \end{enumerate}
\end{problem}







\begin{problem}[{\bf 14 points}] Consider the problem of finding a solution of $f(x)=0$ where $f$ is
a system of polynomials in $x=(x_1,x_2)\in \reals^2$ $$
f(x) =\left(
\begin{array}{c}
2x_1+x_2+x_2^2-x_1x_2-1\\
x_1^2-2x_1+2x_2\\
\end{array}\right)
$$
\begin{enumerate}
\item {\bf 7 points:} Compute the Jacobian of $f$. 
\item {\bf 7 points:} Use Newton's method with $\displaystyle x^0=\left[
\begin{array}{c}
1\\
0\\
\end{array}\right]$ to compute the first approximation $x^1$ to a solution of $f(x)=0$.
\end{enumerate}
\end{problem}


\setcounter{problem}{0}

\section{Final}
\begin{center}
{\em Mathematics 423: Final Exam: May 7, 1998 }
\end{center}




\noindent{\large Name:
$\underline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }$}
\begin{center}
\large\begin{tabular}{r|c|r}
Problem Number& Maximum Points & Points Lost\\ \hline\hline 1&12\\ \hline
2&12 \\ \hline
3&12 \\ \hline
4&12 \\ \hline
5&12 \\ \hline
6&12 \\ \hline
7&12 \\ \hline
8&12 \\ \hline
9&12 \\ \hline
10&10 \\ \hline
11&10 \\ \hline
12&10 \\ \hline
13&12 \\ \hline
TOTAL&\\
\end{tabular}
\end{center}






\vspace{0.2in}


{\bf Neville's Recursion Formula:}\ Let
$x_0,\ldots,x_n$ be distinct real numbers in the interval, $[a,b]$. Let $f$ be a real valued function on $[a,b]$, and let $P(x)$ denote the
unique polynomial of degree $\le n$ such that $f(x_i)=P(x_i)$ for $i=0,\ldots,n$.
For each $c=0,\ldots,n$, let $P_{\widehat{c}}(x)$ denote the unique polynomial of degree $\le n-1$ such that $P_{\widehat{c}}(x_i)=f(x_i)$ for $0\le i\le n$ with
$i \not= c$. Then for two distinct points $x_j$ and $x_k$ in the set $\{x_0,\ldots,x_n\}$:
$$P(x)=\frac{(x-x_j)P_{\widehat{j}}(x)-(x-x_k)P_{\widehat{k}}(x)}{x_k-x_j}$$ or equivalently:
$$P(x)=\frac{x-x_j}{x_k-x_j}P_{\widehat{j}}(x)+\frac{x-x_k}{x_j-x_k}P_{\wide hat{k}}(x).$$




\section*{Problems}{\large\em To receive credit you must show your work.} 

\bigskip

\begin{problem}[12 points total] Perform the following computations in 
a) 3 digit rounding arithmetic; and compute b) the absolute error, and
c) the relative error in each case:
\begin{enumerate}
\item $(100-0.6)+0.6$;
\item $(99.8+0.6)-0.6$.
\end{enumerate}
Put your answers in the table below.
\end{problem}

\vspace{0.1in}

\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
expression to &3 digit rounding answer&absolute error& relative error\\ be evaluated&{\em(2 points each)}&{\em(2 points each)}& {\em(2 points each)}\\ \hline\hline
{\rule[-2mm]{0mm}{7mm}$(100-0.6)+0.6$}&&&\\ \hline {\rule[-2mm]{0mm}{7mm}$(99.8+0.6)-0.6$}&&&\\ \hline \end{tabular}
\end{center}




\begin{problem}[12 points total] A person decides to use Newton's method (also known as the Newton-Raphson method) to find a zero of $f(x)=x^2-2$ for $1\le x\le 2$. {\em Assume that you are using exact arithmetic,
i.e., that the errors
of computer arithmetic play no role here.} Write down iteration formula that Newton's method gives for solving $f(x)=0$, and using $2.0$ as a starting guess find the first and the second approximation to a solution of $f(x)=0$
given by this formula.
\end{problem}





\begin{problem}[12 points total]Given a
function $f: \reals\to \reals$ such that $f(0)=0$, $f(1)=0$, $f(2)=4$, $f(3)=0$, write down in Lagrange form {\em (not the Newton form)}
of the
interpolating polynomial of degree $\le 3$ with values agreeing with $f$ at $x=0,1,2,3$.
\end{problem}






\begin{problem}[12 points total]Given a
function $f: \reals\to \reals$ such that $f(0)=0$, $f(1)=0$, $f'(1)=2$, $f(2)=4$: \begin{enumerate}
\item[\em 8 pts]Write down the divided differences, $f[0],f[0,1],f[0,1,1],f[0,1,1,2]$;
\item[\em 4 pts]Write down the Hermite interpolating polynomial of degree $\le 3$ for
$f$ at the values $0,1,1,2$ using Newton's interpolatory divided-difference formula, i.e., by using the Newton polynomial built out of divided differences.
\end{enumerate}
\end{problem}



\begin{problem}[12 points total]Let $S(x)$ be a free cubic spline defined on $[0,2]$ with nodes $x_0=0,x_1=1, x_2=2$, and $S(0)=0$, $S(1)=0$ and
$S(2)=4$.
Assume that
$S(x)$ is given by the cubic polynomials $S_0(x)=
a-x+x^3$ on $[0,1]$, and by $S_1(x)=
b(x-1)+c(x-1)^2-(x-1)^3$ on $[1,2]$.
Find the real numbers $a,b,c$, i.e.,
find the actual numbers. {\em [Recall the free splines satisfy the conditions that
$S_0''(0)=0=S_1''(2)$.]}
%0,2,3
\end{problem}




\begin{problem}[12 points total]Neville's method is used to approximate $f(2)$ giving the following table:
$$
\begin{array}{llll}
x_0=0&P_0=f(0)=1 \\
x_1=1&P_1=f(1)=2 &P_{01}=3\\
x_2=3&P_2=f(3)=\ ? &P_{12}= 15&P_{012}=11 \\ %28
\end{array}
$$
Determine $P_2=f(3)$.
\end{problem}






\begin{problem}[12 points total]You would like to integrate $\displaystyle\int_1^2[\ln(x)]^2\mbox{\rm d}x$. The trapezoidal approximation for $n=1$ is $0.240$, and for $n=2$ it is $0.202$.
What is the Richardson extrapolation estimate to $\displaystyle\int_1^2[\ln(x)]^2\mbox{\rm d}x$ that the Romberg method of integration makes using these trapezoidal approximations? \end{problem}


\begin{problem}[12 points]\ \ \
\begin{enumerate}
\item Set up the Taylor method of order $2$ to solve $y'=y^2t^2$ for $t \in [0,1]$ with $h=0.25$, $y(0)=1$.
\item Set up the Euler method to solve the same initial value problem and with $h=0.25$.
\end{enumerate}
\end{problem}







\begin{problem}[12 points]
Consider the initial value problem:
$$y'''+2y''+4y'+8y=t^4;\ \ 0\le t\le 3$$ with initial values $y(0)=1,y'(0)=2$, $y''(0)=0$. Rewrite the ordinary differential equation as a $1$st order system of ordinary differential equations. {\em [Do not forget to write down the initial conditions
for the system.]}
\end{problem}




\begin{problem}[10 points]
Give an argument based on the Gershgorin Theorem to show that the matrix 
$\displaystyle \left[\begin{array}{ccccc} 5&1&1&1&1\\
1&5&1&1&1\\
1&1&5&1&1\\
1&1&1&5&1\\
1&1&1&1&5\\
\end{array}
\right]
$ is invertible. {\em Hint: You can use the fact that a matrix $A$ is invertible if and only if $0$ is not an eigenvalue of $A$.} \end{problem}


\begin{problem}[10 points]
What is the infinity norm $||A||_\infty$ of the matrix $$A=\left[\begin{array}{ccc}
-10&1&2\\
1&0&2\\
4&2&2\end{array}
\right]
$$
\end{problem}

\begin{problem}[10 points]
What is the condition number (using the infinity norm) of the matrix $$\left[\begin{array}{cc}
4&1\\
0&0.25\\
\end{array}
\right]
$$
\end{problem}



\begin{problem}[12 points]
Consider the boundary value problem:
$$y''=y+x;\ \ 0\le x\le 2$$
with boundary values $y(0)=1,y(2)=2$.
Solve this equation using finite differences with the node points $x_0=0,x_1=1,x_2=2$.
\end{problem}



\end{document}
