# Interpolation polynomial

Consider the following table of values for a function $j_0(x)$:

$\begin{array}{c|ccccc} x & \delta_0(x) \\ \hline 0.0&1.00000\\0.1&.99833\\0.2&.99335\\0.3&.98507\\0.4&.97355\\0.5&.95885\\0.6&.94107\\0.7&.92031\\0.8&.89670\\0.9&.87036\\1.0&.84147\\1.1&.81019\\1.2&.77670\\1.3&.74120 \end{array}$

What should be the maximum degree of polynomial interpolation used with the table?

I know that I must use the forward difference table so that I can detect the influence of the rounding errors. From that, do I find the polynomial by using $$f[x_0,...,x_n]=\frac{\triangle^nf(x_0)}{n!h^n}$$ where $\triangle f(x)=f(x+h)-f(x)$ and $h$ is the step length? Or do I use newton divided difference? Confused on how I can solve this.

-

If there are no errors, interpolation is the way to go. The forward differences tell you the right degree, but in practice you'd use Newton interpolation (as you have equally spaced data). If there are errors, you'd get the form right and use least squares to get parameters. – vonbrand Feb 4 at 2:37
@vonbrand Can you elaborate a little more please? – user60514 Feb 4 at 3:34
– vonbrand Feb 4 at 3:39
@vonbrand Thanks but that link you gave me says "Not Found" – user60514 Feb 4 at 3:46

## 1 Answer

The data is only given to 5 decimal places. So, we can assume that the data points might be in error by as much as 0.000005. So any curve that deviates from the data points by less than this would be fine. If you plot the data (in Excel, for example) you will see that the curve gently slopes downwards. I would guess that a curve of degree 5 or 6 would fit the points with an error of less than 0.000005. As far as I know, there is no good way to predict the error, other than constructing the curve and measuring. To construct curves, use least-squares fitting: http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html

To use the Wolfram formulae: In your case, $n=14$, $\{x_1, x_2, \ldots, x_n\} = \{0.0, 0.1, \ldots, 1.3\}$, and $\{y_1, y_2, \ldots, y_n\} = \{1.00000, 0.99833, \ldots, 0.74120\}$. But you can probably find some software to do the fitting for you. For example, you can use the "Fit" function in Mathematica. http://reference.wolfram.com/mathematica/ref/Fit.html

You can do it in Excel, too. Look up the "Add Trendline" function. The function $y = -0.0008x^5 + 0.0096x^4 - 0.0009x^3 - 0.1664x^2 - 0.00002x + 1$ gives a maximum error of $0.00003$.

-

Thank you Bubba, I am confused on how I can plot my table into that wolfram site you provided? What will be in my matrix? – user60514 Feb 4 at 5:50
I added an explanation. – bubba Feb 4 at 6:19
So, on the mathematica site you gave where it says "$data = \{\{0, 1\}, \{1, 0\}, \{3, 2\}, \{5, 4\}\};$ the x side is the left and y on the right. So I plug my points there? – user60514 Feb 4 at 7:06
And is $y = -0.0008x^5 + 0.0096x^4 - 0.0009x^3 - 0.1664x^2 - 0.00002x + 1$ from my data? – user60514 Feb 4 at 8:13
Yes, the Excel answer is for your data. The function allows you to adjust the degree, too. – bubba Feb 4 at 11:14
show 2 more comments
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9071630239486694, "perplexity_flag": "middle"}