Example 7. Start with over the interval . Use the Gram-Schmidt orthogonalization to construct a few of the orthogonal polynomials over the interval . Construct the corresponding Legendre polynomials .
We can let Mathematica do it all using recursion as follows. First define the inner product and the recursive formulas.
The polynomials are generated using the above recursive formulas.
Set up the inner product function.
Construct the first few orthogonal polynomials.
These orthogonal polynomials are related to the Legendre polynomials, all we need to do is normalize them so that .
(c) John H. Mathews 2005