Function Repository Resource:

# ComradeMatrix

Generate the comrade matrix corresponding to an orthogonal polynomial series

Contributed by: Jan Mangaldan
 ResourceFunction["ComradeMatrix"][cof,poly] yields the comrade matrix corresponding to , where pi(x) is an orthogonal polynomial represented by poly and ci is the (i+1)th element of the list cof.

## Details

A comrade matrix is an upper Hessenberg matrix whose characteristic polynomial is a scalar multiple of the sum .
The argument poly can be any of the following:
 "ChebyshevFirst" Chebyshev polynomial of the first kind ChebyshevT[i,x] "ChebyshevSecond" Chebyshev polynomial of the second kind ChebyshevU[i,x] "Hermite" Hermite polynomial HermiteH[i,x] "Laguerre" Laguerre polynomial LaguerreL[i,x] "Legendre" Legendre polynomial LegendreP[i,x] {"Gegenbauer",m} Gegenbauer polynomial GegenbauerC[i,m,z] {"Laguerre",a} Jacobi polynomial JacobiP[i,a,b,x] {"Jacobi",a,b} Jacobi polynomial JacobiP[i,a,b,x]
Strings in specifications like "Legendre" and {"Jacobi",a,b} can be replaced with the corresponding built-in symbols, as in LegendreP and {JacobiP,a,b}.
If poly is "ChebyshevFirst", the comrade matrix is also referred to as a colleague matrix.
The result of ResourceFunction["ComradeMatrix"] is a SparseArray.

## Examples

### Basic Examples (3)

The comrade matrix of a Legendre series:

 In[1]:=
 Out[1]=

Compute its characteristic polynomial:

 In[2]:=
 Out[2]=

The characteristic polynomial is a scalar multiple of the corresponding orthogonal polynomial series:

 In[3]:=
 Out[3]=

### Scope (2)

Comrade matrix of a Jacobi series with symbolic coefficients and parameters:

 In[4]:=
 Out[4]=

An equivalent specification:

 In[5]:=
 Out[5]=

Generate a colleague matrix:

 In[6]:=
 Out[6]=

### Applications (2)

Use the comrade matrix with Eigenvalues to find the roots of a Chebyshev series of the second kind:

 In[7]:=
 Out[7]=

Compare with the result of using NSolve and the resource function OrthogonalPolynomialSum:

 In[8]:=
 Out[8]=

## Version History

• 1.0.0 – 05 April 2021