# Polynomial interpolation problem [Solved]

This topic is 4643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well homework again, i solved the matrix problem but now we got some more "fun" homework. I blazed through spline and linear interpolation but now at polynomial interpolation i got a problem. This is the table of values i got x f(x) 0 0 2 1.9 4 2.1 5 -0.2 6 0 So the 4th degree polynomial would look like: P4(x)= a0 + a1*(x-x0) + a2*(x-x0)*(x-x1) + a3*(x-x0)*(x-x1)*(x-x2) + a4*(x-x0)*(x-x1)*(x-x2)*(x-x3) So putting up some linear equations i get the result: x= 0: a0 = 0 x= 2: a0 + a1*2 = 1.9 x= 4: a0 + a1*4 + a2*4*2 = 2.1 x= 5: a0 + a1*5 + a2*5*4 + a3*5*4*2 = -0.2 x= 6: a0 + a1*6 + a2*6*5 + a3*6*5*4 + a4*6*5*4*2 = 0 a0: 0 a1: 0.95 a2: -0.2125 a3: -0.0175 a4: 0.0115625 So the polynomial should be: 0 + 0.95x - 0.2125x(x-2) - 0.0175x(x-2)(x-4) + 0.0115625x(x-2)(x-4)(x-5) right? Well the problem is that it totally misses x=5 so i don't know what i did wrong. Here is a pic of what happened So any idea what i did wrong? [Edited by - KeGA84 on March 1, 2006 12:27:44 AM]

##### Share on other sites
Careless substitution for the xi values when calculating the last few terms.

##### Share on other sites
Quote:
 Original post by Anonymous PosterCareless substitution for the xi values when calculating the last few terms.

Thank you, it looks much better now. Staring at it to long just made me blinder so it was good to have a fresh pair of eyes to look at it. :)

##### Share on other sites

This topic is 4643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

This topic is now closed to further replies.

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633323
• Total Posts
3011361
• ### Who's Online (See full list)

There are no registered users currently online

×