Legendre-Gauss Quadrature

Author

Eric W. Weisstein
September 16, 2005

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumericalMath/Legendre-GaussQuadrature.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Legendre-GaussQuadrature.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Parameters

a[n_]:=(((2n)!)/((2^n)(((n!))^2)))

Together[FullSimplify[a[n+1]/a[n]]]

Integrate[LegendreP[n,x]^2,{x,-1,1}]

Table[Integrate[LegendreP[n,x]^2,{x,-1,1}],{n,5}]

Sum of Weights

RootReduce[Plus@@@Table[GaussianQuadrature[LegendreP,1,{-1,1},n][[2]],{n,6}]]//Timing

Table[Plus@@(((2(1-((#)^2)))/((((n+1))^2)LegendreP[n+1,#]^2))&/@(x/.{ToRules[Roots[LegendreP[n,x]==0,x]]})),{n,5}]//FullSimplify

Table[Plus@@(((2(1-((#)^2)))/((((n+1))^2)LegendreP[n+1,#]^2))&/@(x/.{ToRules[NRoots[LegendreP[n,x]==0,x,20]]})),{n,50}]

Table[(x/.{ToRules[Roots[LegendreP[n,x]==0,x]]}),{n,4}]

Table

Analytic

Map[Together,ToRadicals@RootReduce[Table[GaussianQuadrature[LegendreP,1,{-1,1},i],{i,2,5}]],{2}]//TableForm

Degrees

<<NumberTheory`AlgebraicNumberFields`

Abscissas

Timing[abs=Table[RootReduce[GaussianQuadrature[LegendreP,1,{-1,1},n][[1,1]]],{n,12}]]

MinimalPolynomial[#,x]&/@abs//ColumnForm//TraditionalForm

Table[LegendreP[n,x],{n,8}]//ColumnForm//TraditionalForm

Exponent[MinimalPolynomial[#,x],x]&/@abs

Table[2Floor[n/2],{n,12}]

Weights

Timing[w=Table[RootReduce[GaussianQuadrature[LegendreP,1,{-1,1},n][[2,1]]],{n,10}]]

MinimalPolynomial[#,x]&/@w//ColumnForm//TraditionalForm

Exponent[MinimalPolynomial[#,x],x]&/@w

Table[Floor[n/2],{n,10}]