Legendre polynomials Pn(x) and a Gaussian quadrature formula
Prof. Massimo Priano (maxpri@tin.it)
| |
Now, we can calculate the Legendre polynomial Pn(x) by the recurrence relation
if n>1
The Pn(x) coefficients are stored in the array coeffs
Now, we can find the roots X of Pn(x)
The Pn(x):
is now calculate.
(In the table there are also Christoffel's constants used after in quadrature formula)
Now, we can define the function f(x) to integrate over [a, b]
f(x) =
The definite integral
may be approximated using the Gaussian
formula
This is the result of the approximation
Using Mathcad integration, we obtain