This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Solutions for Homework 4 Foundations of Computational Math 2 Spring 2011 Problem 4.1 Suppose we want to approximate a function f ( x ) on the interval [ a, b ] with a piecewise quadratic interpolating polynomial with a constant spacing, h , of the interpolation points a = x < x 1 . . . < x n = b . That is, for any a x b , the value of f ( x ) is approximated by evaluating the quadratic polynomial that interpolates f at x i 1 , x i , and x i +1 for some i with x = x i + sh , x i 1 = x i h , x i +1 = x i + h and 1 s 1. (How i is chosen given a particular value of x is not important for this problem. All that is needed is the condition x i 1 x x i +1 .) Suppose we want to guarantee that the relative error of the approximation is less than 10 d , i.e., d digits of accuracy. Specifically,  f ( x ) p ( x )   f ( x )  10 d . (It is assumed that  f ( x )  is sufficiently far from 0 on the interval [ a, b ] for relative accuracy to be a useful value.) Derive a bound on h that guarantees the desired accuracy and apply it to interpolating f ( x ) = e x sin x on the interval 4 x 3 4 with relative accuracy of 10 4 . (The sin is bounded away from 0 on this interval.) Solution: On each interval we have f ( x ) p ( x ) = ( x x i 1 )( x x i )( x x i +1 ) 6 f ( ) = h 3 s ( s + 1)( s 1) 6 f ( ) = h 3 q ( s ) 6 f ( ) To bound the term with q ( s ) we note that q ( s ) = s 3 s q ( s ) = 3 s 2 1 extrema are s = radicalbig 1 / 3 q ( s ) 6 = 1 9 radicalbigg 1 3 . 06416 < 2 3 1 10 . 067 We must bound  f ( x )  from above and  f ( x )  from below to set an upper bound on h 1 that guarantees the desired accuracy. We have on 4 x 3 4 f ( x ) = 2 e x (cos x sin x ) 4 x 2  cos x sin x  1 2 x 3 4  cos x sin x  2 e x e 3 / 4 < 10 . 6  f ( x )  < 43  f ( x )  f ( / 4) = e / 4 2 1 . 6 Therefore we can put all of these bounds together to get h 3  q ( s )  6  f ( x )   f ( x )  < . 067 43 1 . 6 h 3 2 h 3 10 4 h 3 . 00005 . 04 Given that / 4 . 8 and 3 / 4 2 . 35 h = 0 . 04 implies n 38. Problem 4.2 4.2.a (i) Find the cubic polynomial p 3 ( x ) that interpolates a function f ( x ) at the values: f (0) = 0 , f (0) = 1 f (1) = 3 , f (1) = 6 (ii) Find the quartic polynomial p 4 ( x ) that interpolates a function f ( x ) at the values: f (0) = 0 , f (0) = 0 f (1) = 1 , f (1) = 1 f (2) = 1 Solutions: Consider the data: f (0) = 0 , f...
View
Full
Document
This note was uploaded on 11/10/2011 for the course MAD 5404 taught by Professor Gallivan during the Spring '11 term at FSU.
 Spring '11
 gallivan

Click to edit the document details