# Numerical Analysis Problem

• Oct 21st 2011, 10:56 PM
jzellt
Numerical Analysis Problem
The following data are taken from a polynomial of degree >= 5. What is the polynomial and what is its degree?

x| -2, -1, 0, 1, 2, 3
p(x)| -5, 1, 1, 1, 7, 25

Not sure how to go about finding the poly...

I know I need to apply Newton's Divided Difference Interpolation Formula some how; I just not sure how? Thanks
• Oct 22nd 2011, 12:10 AM
CaptainBlack
Re: Numerical Analysis Problem
Quote:

Originally Posted by jzellt
The following data are taken from a polynomial of degree >= 5. What is the polynomial and what is its degree?

x| -2, -1, 0, 1, 2, 3
p(x)| -5, 1, 1, 1, 7, 25

Not sure how to go about finding the poly...

I know I need to apply Newton's Divided Difference Interpolation Formula some how; I just not sure how? Thanks

You have a typo, the degree cannot be >=5 for a number of reasons, the first is that there is insufficient data (a quintic has 6 degrees of freedom, and you have 6 data points and you can always put a quintic through six points). Secondly it is a perfect fit for a cubic (construct a difference table, the third differences are constant => a cubic).

CB
• Oct 22nd 2011, 12:18 AM
jzellt
Re: Numerical Analysis Problem
You are absolutely correct! It is supposed to be <=5. Thanks
• Oct 23rd 2011, 01:07 AM
jzellt
Re: Numerical Analysis Problem
Ok I see that that the third differences are constant and therefore a cubic, but I still don't know how to find the polynomial...
• Oct 23rd 2011, 03:42 AM
CaptainBlack
Re: Numerical Analysis Problem
Quote:

Originally Posted by jzellt
Ok I see that that the third differences are constant and therefore a cubic, but I still don't know how to find the polynomial...

You have already been shown in class how to do that from the difference table, I will not repeat that here.

Let the cubic be:

$p(x)=ax^3+bx^2+cx+d$

Then you have:

$p(0)=1$

$p(1)=1$

$p(2)=7$

$p(3)=25$

Which when you expand them constitute a set of four simultaneous equations in the four unknowns $a,b,c,d$.

CB
• Oct 23rd 2011, 11:23 AM
jzellt
Re: Numerical Analysis Problem
Thank you! But wouldn't p(0) = -5?
• Oct 23rd 2011, 11:38 AM
CaptainBlack
Re: Numerical Analysis Problem
Quote:

Originally Posted by jzellt
Thank you! But wouldn't p(0) = -5?

Code:

```x  | -2,-1, 0, 1, 2, 3 p(x)| -5, 1, 1, 1, 7, 25```
• Oct 23rd 2011, 11:57 AM
jzellt
Re: Numerical Analysis Problem
Pardon me. My mistake. What I meant to say is why leave out p(-2) and p(-1)? Thanks
• Oct 23rd 2011, 11:59 AM
CaptainBlack
Re: Numerical Analysis Problem
Quote:

Originally Posted by jzellt
Pardon me. My mistake. What I meant to say is why leave out p(-2) and p(-1)? Thanks

You only need four equations. You can choose any four

CB