I want to write a code to generate Legendre Polynomials using the Gram-Schmidt Process. I have no experience with programing. Here is how the process should work:
Given "(f) = {f[0]=1, f[1]=x , f[2]=x^(2) , f[3]=x^(3) , ... , f[n]=x^(n)} "
Find the Legendre Polynomials: "{P[0] , P[1] , P[2] , P[3] , ... , P[n]}"
First, P[0]=f[0]=1
then, the rest are defined recursively by
P[1]=f[1]-(()/())*P[0] = x