0% found this document useful (0 votes)
55 views3 pages

Math 231 Assignment 2: Solution

This document contains the solution to a Math 231 assignment on interpolation polynomials. It shows: 1) Constructing a linear interpolation polynomial P1(x) using two points and computing its error; 2) Constructing a quadratic interpolation polynomial P2(x) using three points and finding its improved error over P1(x); 3) Computing divided differences and a cubic interpolation polynomial P3(x) for four points; 4) Extending P3(x) to a quartic polynomial P4(x) using a fifth point.

Uploaded by

Gabriel Ramos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views3 pages

Math 231 Assignment 2: Solution

This document contains the solution to a Math 231 assignment on interpolation polynomials. It shows: 1) Constructing a linear interpolation polynomial P1(x) using two points and computing its error; 2) Constructing a quadratic interpolation polynomial P2(x) using three points and finding its improved error over P1(x); 3) Computing divided differences and a cubic interpolation polynomial P3(x) for four points; 4) Extending P3(x) to a quartic polynomial P4(x) using a fifth point.

Uploaded by

Gabriel Ramos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Math 231 Assignment 2

Solution:

a) Interpolation polynimials of degree at most one:

x − x1 x − x0
P1 ( x) = y 0 + y1
x0 − x1 x1 − x0
x0 = 0.0, y 0 = cos( x0 ) = 1.0 , x1 = 0.6, y1 = cos( x1 ) = 0.8253
x − x1 x − x0 x − 0.6 x − 0.0
P1 ( x) = y 0 + y1 =1 + 0.8253 = −0.2911x + 1
x 0 − x1 x1 − x0 0.0 − 0.6 0.6 − 0.0
P1 (0.45) = −0.2911 * (0.45) + 1 = 0.8690
Absolute error: cos(0.45) − P1 (0.45) = 0.0314

b) Interpolation polynimials of degree at most two:

( x − x1 )( x − x 2 ) ( x − x0 )( x − x 2 ) ( x − x0 )( x − x1 )
P2 ( x) = y 0 + y1 + y2
( x 0 − x1 )( x0 − x 2 ) ( x1 − x0 )( x1 − x 2 ) ( x 2 − x0 )( x 2 − x1 )
x0 = 0.0, y 0 = cos( x0 ) = 1.0 , x1 = 0.6, y1 = cos( x1 ) = 0.8253 ,
x 2 = 0.9, y 2 = cos( x 2 ) = 0.6216

( x − 0.6)( x − 0.9) ( x − 0.0)( x − 0.9) x( x − 0.6)


P2 ( x) = + 0.8253 + 0.6216
(0.0 − 0.6)(0.0 − 0.9) (0.6 − 0.0)(0.6 − 0.9) 0.9(0.9 − 0.6)
= −0.4311x − 0.0325 x + 1
2

P2 (0.45) = 0.8981
Absolute error: cos(0.45) − P2 (0.45) = 0.0023
Solution:

a) Divided-defference table:
xk f [x k ] f[ , ] f[ , , ] f[ , , , ]
x0 =-0.1 5.30
x1 =0.0 2.00 -33.0
x 2 =0.2 3.19 5.95 129.833
x3 =0.3 1.00 -21.9 -92.833 -556.677
P3 ( x) = 5.3 − 33( x + 0.1) + 129.833( x + 0.1)( x − 0.0) − 556.677( x + 0.1) x( x − 0.2)

b)
Divided-defference table:

xk f [x k ] f[ , ] f[ , , ] f[ , , , ] f[ , , , , ]
x0 =-0.1 5.30
x1 =0.0 2.00 -33.0
x 2 =0.2 3.19 5.95 129.833
x3 =0.3 1.00 -21.9 -92.833 -556.677
x 4 =0.35 0.9726 -0.548 142.347 671.943 2730.243

P4 ( x) = P3 ( x) + 2730.243( x + 0.1) x( x − 0.2)( x − 0.3)

You might also like