ESS 305002 Numerical Analysis Midterm exam (130pts) 23 Nov 2006 1. (a) [10pts] The roots of x 2 83.4 x 1 0 are approximately x1 0.01199213 and x2 83.38800785 . Suppose now that you work under four-digit rounding arithmetic. Calculate x1 using the following two different formulas: x1 x1 b b 2 4ac and 2a 2c . Compute the relative error obtained by the two formulas. b b 2 4ac Explain why the second formula gives a more accurate answer than the first one. (b) [10pts] Let P( x) a n x n a n 1 x n 1 a1 x a0 be a polynomial. Construct an algorithm to evaluate P( x0 ) at given x x0 , using nested multiplication. 2. Suppose that f C 2 [a, b] . Let p0 [a, b] be an approximation to the solution p of f ( x) 0 such that f ' ( p0 ) 0 and p p0 is small. (a) [10pts] Newton-Raphson method generates an sequence pn n0 , which starts with the initial approximation p0 and tends toward the solution p as n . Please state what the Newton-Raphson method is and how to generate pn. (b) [10pts] Secant method is a modification of the Newton-Raphson method. Please state what this method is and how it works. Please point out the weak points of the Newton-Raphson method which people want to circumvent by using the secant method. (c) [10pts] Mueller’s method is a generalization of the secant method. Please state what it is and how it generates a sequence pn n0 converging to the solution p. (d) [10pts] Write down an algorithm for the secant method, given the two initial approximations p0, p1, the error tolerance TOL, and the maximum number of iteration N0 . 3. (a) [10pts] P(x) is the Lagrange interpolating polynomial to approximate the function f(x) passing through the (n+1) distinct points ( x j , f ( x j )) for j 0,1,, n . Please write down P(x). (b) [10pts] Denote Qi , j ( x) , for 0 j i , the Lagrange interpolating polynomial of degree j on (j+1) numbers xi j , xi j 1 , , xi . Show that Qi , j ( x) ( x xi j )Qi. j 1 ( x) ( x xi )Qi 1. j 1 ( x) xi xi j (c) [10pts] What is Neville’s iterated method and how does it work? Use Neville’s method to evaluate the Lagrange interpolating polynomial P(x) at the number x=1.7 for the function f(x) passing through the 4 distinct points in the table. xi f(xi) 1.0 0.7652 1.3 0.6201 1.6 0.4554 1.9 0.2818 4. (a) [10pts] Define a function f defined on [a,b] and a set of nodes a x0 x1 xn b . The cubic spline interpolation is a piecewise-polynomial approximation using cubic polynomials between each successive pair of nodes. Please state, respectively, the conditions which a cubic spline interpolant S for f should satisfy under free boundary and under clamped boundary. (b) [10pts] Denote S j ( x) a j b j ( x x j ) c j ( x x j ) 2 d j ( x x j ) 3 a cubic polynomial on the interval [ x j , x j 1 ] and h j x j 1 x j , for j 0,1,, n 1 . It can be derived that under clamped boundary, c j is the solution of the linear system Ax=b, where Show that (1) a j f ( x j ) , bj (2) d j (c j 1 c j ) / 3h j , (3) 1 (a j 1 a j ) c j h j d j h 2j hj (c) [10pts] Construct the clamped cubic spline for the data x f(x) -1 0.8620 -0.5 0.9580 0 1.099 0.5 1.294 and f’(-1)=0.1554 and f ’(0.5)=0.4519 5. [10pts] Obtain factorizations of the form A PLU for the matrix 1 2 3 0 1 2 3 1 A by means of Gaussian elimination, where P is a permutation 1 2 2 2 2 8 3 1 matrix, L is a lower-triangular matrix with 1s on the diagonal, and U is a upper-triangular matrix. Determine det A =?