\begin{enumerate} \item Section 3.1: Problem 6(a). Write a program to evaluate the degree three polynomial using for loops. Hint: One can compute $$ L_{n,k}(x) = \prod_{i=0, \atop i\neq k}^n { (x-x_i) \over (x_k - x_i)} $$ with a for loop in $i$ for each of the $k=0,\cdots,n$, then evaluate $$ P(x) = \sum_{k=0}^n f(x_k) L_{n,k}(x) $$ with another for loop on $k$. Note that, in C, the index for an array $a(i)$ starts with $i=0$ by default. However, the index starts with $i=1$ in matlab. One should shift the index in the Lagrange interpolation formula accordingly. {\noindent \bf Remark}: This is not the most efficient method to evaluate the Lagrangian interpolation. The proper way is to evaluate $P(x)$ using Neville's method in section 3.2. An alternative way is to compute the coefficients of $P(x)$ using Newton's divided-difference formula in section 3.3, then evaluate $P(x)$. % Both these methods are and will not % appear in the exams in this class. % \item % Section 3.1: Problems 25. % Use the sample file. % What you will observe is known as Runge's phenomenum. % This is the reason to use piecewise polymomial interpolaton, % instead of a high order polynomial interpolation. % Section 3.1: 6(a), 9, 10, 13(a), 17; p114, 9th ed % Section 3.1: 6(a), 9, 10, 13(a), 17; p112, 10th ed \item Section 3.1: % Problem 6(a) with degree two and % $x_i = 0.25, 0.5, 0.75$. % Problem 8 ($n=2$), Problems 9, 10, 13(a), 17 (the last sentence simply means $h= (10-1)/n$ for some positive integer $n$). \item Let $x_0, \cdots, x_n$ be uniformly spaced nodes on $[a,b]$ with $x_j = a + j h$, $h = (b-a)/n$. \begin{enumerate} \item Show that $|(x-x_0)\cdots (x-x_n)| \le n! h^{n+1}$ on $a \le x \le b$. \item Let $P_n$ be the degree $n$ interpolating polynomial of $e^x$ with uniformly spaced nodes on $[0,1]$. Show that $$ \max_{0\le x \le 1} | e^x - P_n(x) | \le C h^n \to 0 \quad \mbox{as } n \to \infty $$ \end{enumerate} Note that uniform convergence of interpolating polynomials as in (b) does not hold in general. % The example on p158-p160 % 9th ed The Illustration on p154-p157 % 10th ed is a good example. In general, we only have $$ \max_{a\le x \le b} | f(x) - P_n(x) | \le C_n h^n $$ from Theorem 3.3. A well known example with similar behavior is $f(x) = 1/(1+x^2)$ on $[-5,5]$ with uniformly spaced nodes. % \item Section 3.5: Problems 12, 13, 14, 20, 26, 27. % % \item % The cubic spline with not-a-knot condition gives rise to % to a linear system $A x = b$ where % $A$ is an $(n+1)\times (n+1)$ matrix and % $x = (c_0, c_1, \cdots, c_n)^T$. Write down $A$.