Function Repository Resource:

OrthogonalPolynomialCoefficientConvert

Source Notebook

Convert coefficients of a series with respect to one orthogonal polynomial basis into another

Contributed by: Jan Mangaldan

ResourceFunction["OrthogonalPolynomialCoefficientConvert"][poly,x,basis]

gives a list of coefficients ci of the orthogonal polynomial series that is equal to poly, where pi(x) is represented by the orthogonal polynomial basis.

ResourceFunction["OrthogonalPolynomialCoefficientConvert"][cof,basis1basis2]

gives a list of coefficients of the orthogonal polynomial series that is equal to , where ci is the (i+1)th element of the list cof and pi(x) and are respectively represented by the orthogonal polynomials basis1 and basis2.

Details

The following polynomial bases are supported:
"Monomial"monomial basis xi
"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,x]
{"Laguerre",a}associated Laguerre polynomial LaguerreL[i,a,x]
{"Jacobi",a,b}Jacobi polynomial JacobiP[i,a,b,x]
Strings in specifications like "Monomial" and {"Jacobi",a,b} can be replaced with the corresponding symbols, as in Power and {JacobiP,a,b}.

Examples

Basic Examples (2) 

Get the coefficients of a polynomial in the Legendre basis:

In[1]:=
coef = ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
  1 + 6 x - x^4, x, "Legendre"]
Out[1]=

Verify that the Legendre coefficients reproduce the original polynomial:

In[2]:=
coef . LegendreP[Range[0, Length[coef] - 1], x] // Expand
Out[2]=

Convert coefficients for a Laguerre series to coefficients for a Chebyshev series of the first kind:

In[3]:=
c2 = ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
  c1 = {4/15, -(7/15), 9/5, -(12/5), 4/5}, "Laguerre" -> "ChebyshevFirst"]
Out[3]=

Verify the equivalence:

In[4]:=
c1 . LaguerreL[Range[0, Length[c1] - 1], x] == c2 . ChebyshevT[Range[0, Length[c2] - 1], x] // Expand
Out[4]=

Scope (2) 

Convert a Laguerre series with symbolic coefficients and parameters to a Hermite series:

In[5]:=
ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
 Array[C, 3, 0], {"Laguerre", a} -> "Hermite"]
Out[5]=

An equivalent specification:

In[6]:=
ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
 Array[C, 3, 0], {LaguerreL, a} -> HermiteH]
Out[6]=

Convert monomial basis coefficients to coefficients for a Chebyshev series of the second kind:

In[7]:=
ResourceFunction[
 "OrthogonalPolynomialCoefficientConvert"][{1, 0, 3, 0, 4}, "Monomial" -> "ChebyshevSecond"]
Out[7]=

An equivalent specification:

In[8]:=
ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
 1 + 3 x^2 + 4 x^4, x, ChebyshevU]
Out[8]=

Properties and Relations (2) 

Converting an orthogonal polynomial series to the monomial basis is equivalent to expanding the series out and getting its coefficients:

In[9]:=
ResourceFunction[
 "OrthogonalPolynomialCoefficientConvert"][{-(7/75), 59/
  75, -(19/105), -(4/75), 4/525}, "Legendre" -> "Monomial"]
Out[9]=
In[10]:=
CoefficientList[{-(7/75), 59/75, -(19/105), -(4/75), 4/525} . LegendreP[Range[0, 4], x], x]
Out[10]=

OrthogonalPolynomialCoefficientConvert can be used as its own inverse:

In[11]:=
ResourceFunction[
 "OrthogonalPolynomialCoefficientConvert"][{1, -1, 3, 0, 4}, {"Laguerre", -1/2} -> {"Jacobi", 1/4, 1}]
Out[11]=
In[12]:=
ResourceFunction[
 "OrthogonalPolynomialCoefficientConvert"][%, {"Jacobi", 1/4, 1} -> {"Laguerre", -1/2}]
Out[12]=

Neat Examples (1) 

Express a Jacobi series in terms of another Jacobi series with different parameters:

In[13]:=
ResourceFunction["OrthogonalPolynomialCoefficientConvert"][
  Array[C, 3, 0], {"Jacobi", Subscript[\[Alpha], 1], Subscript[\[Beta], 1]} -> {"Jacobi", Subscript[\[Alpha], 2], Subscript[\[Beta], 2]}] // Simplify
Out[13]=

Version History

  • 1.0.0 – 05 April 2021

Source Metadata

Related Resources

License Information