\magnification = \magstep1
\def\l{\lambda}
\centerline{Mathematics 371--Numerical Analysis}
\centerline{Take-Home Final Exam}
\centerline{\it December 3, 2001}
\bigskip
\noindent
{\it Ground Rules}
\bigskip
This is an open book, open notes, open Swords 219 lab, open 335 Swords
exam.  If you consult library books, the Internet, etc. in preparing your 
solutions, please footnote your sources (give full URL's for any web 
sites you use).  You must work {\it independently} on these problems;
you may not consult with other faculty members, etc.
{\it You may (and should) use Maple for any needed calculations.}
When you submit your solutions, please write out a short statement that
you have abided by these rules, and sign it.
\bigskip
\leftline{{\it Due:} No later than 5:00pm on Wednesday, December 12.}
\bigskip
\noindent
I.  The current $I$ in an electrical circuit (as a function of time) is 
measured experimentally as follows:
$$\matrix{t& 1.0&1.1& 1.2& 1.3&1.4 \cr
       I(t) & 28.2277 & 7.2428 & -5.9908 & 4.5260 & .29122\cr}$$
\item{A)} (5) Find the interpolating polynomial of degree
4 or less for these five data points, and use it to 
estimate $I'(1.25)$.
\item{B)} (5) Use an appropriate cubic spline 
interpolating function to approximate $I'(1.25)$.
\item{C)} (5) Compute an approximation to $I'(1.25)$ by
3-point centered 
differences and extrapolation.  
\item{D)} (5) Discuss the possible sources of error in each computation.
If you can identify one method that is giving the best results, say why.
\bigskip
\noindent
II.  Values of the Bessel function of order zero, denoted $J_0(x)$, 
can be computed by integration:
$$J_0(x) = {1 \over \pi}\int_0^\pi \cos(x\sin(t)) dt.$$
\item{A)} (10)  Using the error formula for Simpson's Rule, determine how 
many subdivisions are needed to compute $J_0(0.6)$ to 7 decimal place 
accuracy.  Do the computation. (Your answer to 7 decimal places should be 
0.9120049.)
\item{B)} (10) Approximate $J_0(0.6)$ to 7 decimal place accuracy using
Romberg integration (start with $h = {\pi \over 2}$--two subintervals, and
continue until no change is observed in the first 7 decimals).  
\item{C)} (10) Now, approximate $J_0(0.6)$ 
to 7 decimal place accuracy using Gaussian Quadrature.
Use the 5 point formula (with the roots and the 
weights from the text or from Lab 4).  You may need
to subdivide the interval
$[0,\pi]$ and apply GQ on each subinterval. 
Which of the three methods (Simpson, Romberg, or 
Gauss) is most efficient in terms of the number of evaluations
of $f(t) = \cos(0.6\sin(t))$ that must be carried out in order to obtain
7 decimal place accuracy?
\bigskip
\noindent
III.  (Gauss-Laguerre Quadrature) The Laguerre polynomials are
defined by the following recurrence relation:  $L_0(x) = 1$, 
$L_1(x) =  1- x$ and for $n \ge 1$:
$$L_{n+1}(x) = (1 + 2n - x)L_{n}(x) - n^2 L_{n-1}(x)$$
\item{A)} (5) Compute $L_2, L_3, L_4$ from the recurrence relation.
\item{B)}  (5) Show that 
$$\langle f,g \rangle = \int_0^\infty f(x)g(x)e^{-x} dx$$
defines an inner product on the vector space of continuous functions 
on $[0, \infty)$ which grow no faster than some power $x^n$ as 
$x \rightarrow \infty$.  (Note: this condition is needed to make the 
improper integral in the definition converge!)
\item{C)} (5) Show that $\{L_0, L_1, L_2, L_3\}$ is an orthogonal set
with respect to the inner product from part B by computing the inner products. 
(The same is true for the whole collection $\{L_k : k \ge 0\}$.)
\bigskip
\noindent
Our general Gaussian
Quadrature theorem applies to give numerical approximation methods:
$$\int_0^\infty f(x)e^{-x} dx \doteq \sum_{i=1}^n c_i f(x_i)$$
where the $x_i$ are the roots of a the Laguerre polynomial $L_n$ and 
the $c_i$ are appropriate weights.  Here is a listing of the 
roots and weights for the two,
three, and four point Gauss-Laguerre quadrature formulas:  
$$\matrix{ \hbox{2\ point:}& & &\hbox{3\ point:} & & & &\cr
 x_i & 0.585786 & 3.414214 & x_i & 0.415775 & 2.294280 & 6.289945 \cr
 c_i & 0.853553 & 0.146447 & c_i & 0.711093 & 0.278518 & 0.010389 \cr}$$
 
$$\matrix{
\hbox{4\ point:}& & & & \cr
x_i & 0.322548 & 1.745761& 4.536620 & 9.395071\cr
c_i & 0.603154 & 0.357419& 0.038888 & 0.000539\cr}$$
\bigskip
\item{D)} (5)  Verify the given roots for the polynomial $L_4$
by using {\it Newton-Raphson} iteration on the equation $L_4(x) = 0$ (not
the {\tt fsolve} command in Maple).
\item{E)} (5) Use the two, three, and four-point Gauss-Laguerre quadrature 
formulas to approximate
$$\int_0^{\infty} e^{-x} (x^5-2x^3) dx$$
Note: $f(x) = x^5 - 2x^3$ here.  (Any guess as to the exact value?)  
\bigskip
\noindent
{\it Extra credit} -- Evaluate the integral exactly and compare to the 
Gauss-Laguerre approximations.
\bigskip
\noindent
IV.    In this problem, we will
examine a simple example of a class of ODE that present severe problems
for numerical methods.
\bigskip
\item{A)} (10) Solve the initial value problem $y' = -20y;\ y(0) = 1$
with $h = .2$ for $0 \le t \le 3.0$  using the ``classical'' $4^{th}$ order
Runge-Kutta method,
and compare to the values of the exact solution $y(t) = e^{-20 t}$.  (Your
results {\it should} be {\it terrible}.)  We need to understand
why this happened--it's not just a round-off problem!
\item{B)} (5) From class on November 28, we know that
the Runge-Kutta method applied to
the equation $y^{\prime} = \l y$  with a step size of $h$
yields approximate solution values:
$$w_i = \left(1 + h\l + {1\over 2} (h\l)^2 + {1\over 6}(h\l)^3
             + {1\over 24}(h\l)^4\right)w_{i-1}\leqno(1)$$
Let $Q(h\l)$ be the term in parentheses on the right side
of (1)--the ``multiplier'' in going from $w_{i-1}$ to $w_i$.  With
$h = .1$, $\l = -20$, what is the value of $Q(h\l)$?  How is this
related to the results you got in part A?
\item{C)} (10) How small should $h$ be taken so that $w_i$ is at least
decreasing in absolute value as $i$ increases? Use one 
such $h$, apply Runge-Kutta again, and compare to the exact solution.
\bigskip
\centerline{\it Have a peaceful and joyous holiday season!}
\bye