H09 Gauss quadrature computations

Orthogonal polynomial computation

GSorth[n_] := Module[{ϕ={}},
ScProd[f_,g_]:= -Integrate[Log[t] (f) ( g),{t,0,1}];
For[i=0,i<=n,i++,
  w=t^i; Print["i=",i," w=",w];
  For[j =1, j<=i, j++,
    w = w - ScProd[w,ϕ[[j]]] ϕ[[j]];
  Print["j=",j," w=",w] 
];
 w = w/Sqrt[ScProd[w,w]];
AppendTo[ϕ,Expand[w]]
Print["ϕ=",ϕ];
];
Return[ϕ]
]

GSorth[8]

ϕ=%%;

Roots[N[ϕ[[-1]]]==0,t]

TeXForm[ϕ[[-1]]]

Roots of orthogonal polynomials

N[Roots[ϕ[[4]]==0,t]]

N[Roots[ϕ[[5]]==0,t]]