{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

solhw4

# solhw4 - Solutions for Homework 4 Foundations of...

This preview shows pages 1–4. Sign up to view the full content.

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 0 <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 0 . 06416 < 2 3 1 10 0 . 067 We must bound | f ′′′ ( x ) | from above and | f ( x ) | from below to set an upper bound on h 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
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 ) | < 0 . 067 × 43 1 . 6 h 3 2 h 3 10 4 h 3 0 . 00005 0 . 04 Given that π/ 4 0 . 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 (0) = 1 f (1) = 3 , f (1) = 6 2
We can use the Newton form to derive p 3 ( x ) via the table x 0 x 0 x 1 x 1 f 0 f 0 f 1 f 1 f 0 f [ x 0 ,x 1 ] f 1 f [ x 0 ,x 0 ,x 1 ] f [ x 0 ,x 1 ,x 1 ] f [ x 0 ,x 0 ,x 1 ,x 1 ] The values are 0 0 1 1 0 0 3 3 1 3 6 2 3 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern