CITE THIS NOTEBOOK: Orthogonal polynomials computed via matrix determinants by Paul Abbott. Wolfram Community MAR 4 2023.
Two examples of orthogonal polynomials computed via matrix determinants are presented.

Legendre Polynomials

Any polynomial satisfying a three-term recurrence relation can be written as the determinant of a tridiagonal matrix.
Consider the following tridiagonal matrix:

n

x
1
0
⋯
0
1
3x
2
⋱
⋮
0
2
5x
⋱
0
⋮
⋱
⋱
⋱
n-1
0
⋯
0
n-1
(2n-1)x
,
(
1
)
Use
SparseArray
to define the matrix

n
(1) for general
n
:

n_
:=SparseArray{i_,i_}(2i-1)x,{i_,j_}
1
2
(i+j-1)/;i-j1,{n,n}
Compute

5
:

5
//Normal
x
1
0
0
0
1
3x
2
0
0
0
2
5x
3
0
0
0
3
7x
4
0
0
0
4
9x
Verify that


n
n!
P
n
(x)
where
P
n
(x)
are Legendre polynomials for
n=1,2,…,8
:
Table[{n,

n
n!
P
n
(x)//Simplify},{n,8}]
1
True
2
True
3
True
4
True
5
True
6
True
7
True
8
True

Orthogonal Polynomials from Moment Problem

Consider the closely related matrices,

n

1
x
⋯
n
x
m
1
m
2
⋯
m
n+1
⋮
⋮
⋱
⋮
m
n
m
n+1
⋯
m
2n
,
ℬ
n

m
0
m
1
⋯
m
n
m
1
m
2
⋯
m
n+1
⋮
⋮
⋱
⋮
m
n
m
n+1
⋯
m
2n
,
(
2
)
where
m
k
is the
th
k
moment of
x
,
m
k
=
∞
∫
0
-x

k
x
x
(
3
)
The ratio of the determinants of these matrices,
ℒ
n
(x)


n


ℬ
n

(
4
)
generates a set of orthogonal polynomials with respect to the inner product
〈f,g〉=
∞
∫
0
x
-x

f(x)g(x)x
(
5
)

th
k
moment of
x

Define
m
k
(3):
m/:
m
k_
=Assumingk≥0,
∞
∫
0
-x

k
x
x
Γ(k+1)

Matrices

n
and
ℬ
n

Use
SparseArray
to define the matrices

n
and
ℬ
n
(2) for general
n
.
Define

n
:

n_
:=SparseArray{1,j_}
j-1
x
,{i_,j_}
m
i+j-2
,{n+1,n+1}
Define
ℬ
n
:
ℬ
n_
:=SparseArray[{i_,j_}
m
i+j-2
,{n+1,n+1}]
Compute

4
:
Normal[

4
]
1
x
2
x
3
x
4
x
1
2
6
24
120
2
6
24
120
720
6
24
120
720
5040
24
120
720
5040
40320
Compute
ℬ
4
:
Normal[
ℬ
4
]
1
1
2
6
24
1
2
6
24
120
2
6
24
120
720
6
24
120
720
5040
24
120
720
5040
40320

Compute the determinant ratio

Compute
ℒ
n
(x)
from (4) for
n=0,1,…,5
:
Tablen,
ℒ
n
(x_)=Factor


n


ℬ
n

,{n,0,5}
0
1
1
2-x
2
1
2
(
2
x
-6x+6)
3
1
6
(-
3
x
+12
2
x
-36x+24)
4
1
24
(
4
x
-20
3
x
+120
2
x
-240x+120)
5
1
120
(-
5
x
+30
4
x
-300
3
x
+1200
2
x
-1800x+720)

Inner product

Define the inner product (5):
〈f_,g_〉:=
∞
∫
0
-x

Expand[xfg]x

Orthogonality

Verify orthogonality with respect to the inner product (5):
Table
ℒ
i
(x),
ℒ
j
(x),{i,0,5},{j,0,5}
1
0
0
0
0
0
0
2
0
0
0
0
0
0
3
0
0
0
0
0
0
4
0
0
0
0
0
0
5
0
0
0
0
0
0
6

Comments

The matrix
B
n
is a Hankel matrix.
The Hamburger moment problem is intimately related to orthogonal polynomials on the real line.
One can recognise that the orthogonal polynomials arising here are the associated Laguerre polynomials,
1
L
n
(x)
:
Table[n,
1
L
n
(x),{n,0,5}]
0
1
1
2-x
2
1
2
(
2
x
-6x+6)
3
1
6
(-
3
x
+12
2
x
-36x+24)
4
1
24
(
4
x
-20
3
x
+120
2
x
-240x+120)
5
1
120
(-
5
x
+30
4
x
-300
3
x
+1200
2
x
-1800x+720)
This is as expected from the given inner product (5).