Function Repository Resource:

# NewtonCompanionMatrix

Generate the companion matrix for the Newton interpolating polynomial of a given set of points

Contributed by: Jan Mangaldan
 ResourceFunction["NewtonCompanionMatrix"][{f1,f2,…}] yields the Newton companion matrix of an interpolating polynomial which reproduces the function values fi at successive integer values 1, 2, …. ResourceFunction["NewtonCompanionMatrix"][{{x1,f1},{x2,f2},…}] yields the Newton companion matrix of an interpolating polynomial for the function values fi corresponding to the abscissas xi. ResourceFunction["NewtonCompanionMatrix"][{{{x1},f1,df1,…},…}] yields the Newton companion matrix of an interpolating polynomial that reproduces derivatives as well as function values.

## Details

ResourceFunction["NewtonCompanionMatrix"][data] gives an upper Hessenberg matrix whose characteristic polynomial is a scalar multiple of InterpolatingPolynomial[data,x].
The result of ResourceFunction["NewtonCompanionMatrix"] is a SparseArray.
With a list of data of length n, ResourceFunction["NewtonCompanionMatrix"] gives a square matrix with dimensions less than or equal to n-1.

## Examples

### Basic Examples (2)

Construct the Newton companion matrix for the squares:

 In[1]:=
 Out[1]=

Check its characteristic polynomial:

 In[2]:=
 Out[2]=

Construct the Newton companion matrix corresponding to an interpolating polynomial through three points:

 In[3]:=
 Out[3]=

The characteristic polynomial is a scalar multiple of the corresponding interpolating polynomial:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

### Scope (2)

Newton companion matrix for symbolic points:

 In[6]:=
 Out[6]=

Construct the Newton companion matrix for points with derivative information supplied:

 In[7]:=
 Out[7]=

### Applications (2)

Find the roots of an interpolating polynomial by computing the eigenvalues of a Newton companion matrix:

 In[8]:=
 Out[8]=

Compare with the result of using NSolve:

 In[9]:=
 Out[9]=

### Properties and Relations (2)

The dimensions of a Newton companion matrix might be much less than the number of points supplied:

 In[10]:=
 Out[10]=
 In[11]:=
 Out[11]=

In this case, the corresponding interpolating polynomial has degree 3:

 In[12]:=
 Out[12]=

## Version History

• 1.0.0 – 26 April 2021